0.1.1 • Published 4 years ago
@shopify-wrapper/server v0.1.1
@shopify-wrapper/server
Query and mutate shopfiy data easily and safely
About
This packages uses node-fetch and is meant to be run on node environnements or nextjs backends / SSR
Install
$ npm install @shopify-wrapper/serveror
$ yarn add @shopify-wrapper/serverUsage
import shopifyWrapper from @shopify-wrapper/server
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/server';
// Load by method
import {getProductByHandle} from '@shopify-wrapper/server';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