JSPM

  • Created
  • Published
  • Downloads 568
  • Score
    100M100P100Q97621F
  • License MIT

Swell API library for NodeJS

Package Exports

  • swell-node

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (swell-node) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Swell API library for NodeJS

Build and scale ecommerce with Swell.

Install

npm install swell-node --save

Connect

const swell = require('swell-node');

swell.init('my-store', 'secret-key');

Usage

try {
  const products = await swell.get('/products', { active: true });
  console.log(products);
} catch (err) {
  console.error(err);
}

Caching

This library provides in-memory caching enabled by default, using a version protocol that means you don't have to worry about stale cache. Records that don't change too frequently, such as products, will always return from cache when possible.

To disable caching behavior, use the option cache: false.

swell.init('my-store', 'secret-key', {
  cache: false,
});

Documentation

Coming soon!

Contributing

Pull requests are welcome

License

MIT