app.js
: The main entry point of the application. It parses command-line arguments and orchestrates the product search process.searchProducts.js
: Contains theProductSearch
class, which handles the logic for searching products using the Shopify Admin GraphQL.shopifyClient.js
: Provides a reusable Shopify API client for making authenticated requests to the Shopify Admin GraphQL API.
# Make new directory
mkdir anatta
# Change to the new directory
cd anatta
# Create environment dotfile
touch .env
SHOP_DOMAIN='your-store.myshopify.com'
ADMIN_TOKEN='yourAdminToken'
# Installs axios, minimist, and dotenv
npm install
# Change to the app's directory
cd SearchApp
# Defaults
# - pagination: true
# - product limit: 30
# - variant limit: 100
node app.js --name shirt
# No pagination
node app.js -n a --no-pagination
# Example limiting number of products and variants fetched per page
node app.js --name "a" --products 1 --variants 1
# Example limiting number of products and variants fetched and only making 1 request
node app.js --n "a" -p 1 -v 1 --no-pagination