0.1.1 • Published 2 years ago

@shopify-wrapper/server v0.1.1

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

@shopify-wrapper/server

Query and mutate shopfiy data easily and safely

XO code style GitHub workflow status npm downloads

About

This packages uses node-fetch and is meant to be run on node environnements or nextjs backends / SSR

Install

$ npm install @shopify-wrapper/server

or

$ yarn add @shopify-wrapper/server

Usage

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