commercejs - a headless e-commerce API

Commercejs is another headless e-commerce API and it is also the one I feel fits most cases.

It provides a free plan with 2% transaction fees, sounds like SnipCart but it also provides paid plan for 0 transaction fees.

If you don't know which one to choose then maybe commercejs is it.

check more information form their website
https://commercejs.com/

snipcart.com - a headless shopping cart api

There are a number of choices for the headless cart solution, SnipCart is another one.

The reason I list it here is that SnipCart is one of the oldest in the game.

They are charging a 2% transaction fee + payment gateway fees, without a monthly fee making it fit for most less traffic e-commerce sites.

check more information on their website.

https://snipcart.com

idb.js - A tiny IndexedDB wrapper

idb.js is a tiny (~1.06kB brotli'd) library that mostly mirrors the IndexedDB API, but with small improvements that make a big difference to usability.

import { openDB } from 'idb/with-async-ittr.js';

async function demo() {
  const db = await openDB('Articles', 1, {
    upgrade(db) {
      // Create a store of objects
      const store = db.createObjectStore('articles', {
        // The 'id' property of the object will be the key.
        keyPath: 'id',
        // If it isn't explicitly set, create a value by auto incrementing.
        autoIncrement: true,
      });
      // Create an index on the 'date' property of the objects.
      store.createIndex('date', 'date');
    },
  });

  // Add an article:
  await db.add('articles', {
    title: 'Article 1',
    date: new Date('2019-01-01'),
    body: '…',
  });

  // Add multiple articles in one transaction:
  {
    const tx = db.transaction('articles', 'readwrite');
    await Promise.all([
      tx.store.add({
        title: 'Article 2',
        date: new Date('2019-01-01'),
        body: '…',
      }),
      tx.store.add({
        title: 'Article 3',
        date: new Date('2019-01-02'),
        body: '…',
      }),
      tx.done,
    ]);
  }

  // Get all the articles in date order:
  console.log(await db.getAllFromIndex('articles', 'date'));

  // Add 'And, happy new year!' to all articles on 2019-01-01:
  {
    const tx = db.transaction('articles', 'readwrite');
    const index = tx.store.index('date');

    for await (const cursor of index.iterate(new Date('2019-01-01'))) {
      const article = { ...cursor.value };
      article.body += ' And, happy new year!';
      cursor.update(article);
    }

    await tx.done;
  }
}

https://github.com/jakearchibald/idb