0.1.1 • Published 2 years ago
@shopify-wrapper/client v0.1.1
@pnxdxt/shopify-wrapper
Query and mutate shopfiy data easily and safely
Install
$ npm install @shopify-wrapper/client
or
$ yarn add @shopify-wrapper/client
Usage
import shopifyWrapper from @shopify-wrapper/client
const config = {
domain: process.env.domain,
token: process.env.token
}
const product = await shopifyWrapper.product.find({handle:'my-super-product', config})
Import
This package is pure ESM. It cannot be require()
'd from CommonJS.
Use import foo from 'foo'
instead of const foo = require('foo')
to import the package.
// Load entire build
import * as shopifyWrapper from '@shopify-wrapper/client';
// Load by method
import {getProductByHandle} from '@shopify-wrapper/client';
If the package is used in an async context, you could use await import(…)
from CommonJS instead of require(…)
.
You also need to make sure you're on the latest minor version of Node.js. At minimum Node.js 12.20, 14.14, or 16.0.
Read more here: sindresorhus/esm-package
License
MIT © pnxdxt