Skip to content

An example repo using Nest Commander to fetch Shopify products via Shopify Admin Graphql API, given a searchString via CLI (using exponential backoff).

Notifications You must be signed in to change notification settings

riyadshauk/fetch-shopify-products-nest-cli-example

Repository files navigation

fetch-shopify-products-nest-cli-example

Nest Logo

A progressive Node.js framework for building efficient and scalable server-side applications.

NPM Version Package License NPM Downloads CircleCI Coverage Discord Backers on Open Collective Sponsors on Open Collective Support us

Description

Nest framework TypeScript starter repository using Commander.

Installation

$ npm install

Running the app

specific for this example:

Make sure to first rename .env.example to .env, and update the values, accordingly. The defaults that need to be updated are as follow:

ADMIN_API_TOKEN=shpat_xxxxxx
SHOP_DOMAIN=my-store-123.myshopify.com

Then you should be able to successfully run the command (assuming token has sufficient Shopify Admin API privileges, such as read_products).

# run without explicit build step
$ nest start -- findproducts -name glove

# run with build step first
$ npm run build
$ node ./dist/main.js findproducts -name glove

example usage

$ nest start -- findproducts -h
Usage: main findproducts [options]

A command for finding product variants by provided name substring, sorted by
price.

Options:
  -name, --name [string]  the input product name substring to search for
  -all, --all             a boolean flag, if you want to retrieve all products
  -h, --help              display help for command

default commands:

# development
$ npm run start

# watch mode
$ npm run start:dev

# production mode
$ npm run start:prod

Test

# unit tests
$ npm run test

# e2e tests
$ npm run test:e2e

# test coverage
$ npm run test:cov

Support

Nest is an MIT-licensed open source project. It can grow thanks to the sponsors and support by the amazing backers. If you'd like to join them, please read more here.

Stay in touch

License

Nest is MIT licensed.

About

An example repo using Nest Commander to fetch Shopify products via Shopify Admin Graphql API, given a searchString via CLI (using exponential backoff).

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published