npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

shopify-collection-bulk

v1.1.0

Published

A powerful Node.js utility for bulk creating and managing Shopify collections from CSV files and Word documents via the Shopify Admin API

Downloads

44

Readme

Shopify Collection Bulk

A powerful Node.js utility for bulk creating and managing Shopify collections from CSV files and Word documents via the Shopify Admin API.

Features

  • 🚀 Bulk Collection Creation: Create multiple Shopify collections from CSV files
  • 📄 Word Document Support: Extract collection data from Word documents (.docx)
  • 🎯 Smart & Custom Collections: Support for both smart and custom collection types
  • 🔄 Retry Logic: Built-in retry mechanism for API rate limits and errors
  • 📊 Progress Tracking: Detailed logging and error reporting
  • Rate Limiting: Respects Shopify API rate limits with automatic throttling

Installation

# Clone the repository
git clone https://github.com/inioluwadavid/Shopify-Collection-Bulk.git
cd shopify-collection-bulk

# Install dependencies
npm install

# Copy environment variables template
cp .env.example .env

Configuration

Create a .env file with your Shopify store credentials:

SHOPIFY_STORE=your-store-name.myshopify.com
SHOPIFY_ADMIN_TOKEN=your-admin-api-token
SHOPIFY_API_VERSION=2024-10

Getting Your Shopify Admin Token

  1. Go to your Shopify Admin → Apps → App and sales channel settings
  2. Click "Develop apps" → "Create an app"
  3. Configure Admin API access scopes:
    • write_products (for collections)
    • read_products (for smart collection rules)
  4. Install the app and copy the Admin API access token

Usage

1. Bulk Create Collections from CSV

# Using npm script
npm run bulk:collections

# Or directly
node scripts/bulk-collections.js data/collections.sample.csv

2. Extract Collections from Word Document

# Extract data from Word document
npm run extract:docx

3. Parse Bulk Upload Logs

# Generate success/error reports
npm run parse:log

CSV Format

Your CSV file should include the following columns:

For Custom Collections

title,handle,body_html,image_src,published
"Electronics","electronics","Shop our latest electronics","https://example.com/image.jpg","true"

For Smart Collections

title,handle,body_html,image_src,published,type,rules_json,disjunctive
"Expensive Items","expensive","High-value products","https://example.com/image.jpg","true","smart","[{\"column\":\"price\",\"relation\":\"greater_than\",\"condition\":\"100\"}]","false"

CSV Columns Reference

| Column | Required | Description | Example | |--------|----------|-------------|---------| | title | ✅ | Collection title | "Electronics" | | handle | ❌ | URL handle (auto-generated if empty) | "electronics" | | body_html | ❌ | Collection description | "Shop our latest electronics" | | image_src | ❌ | Collection image URL | "https://example.com/image.jpg" | | published | ❌ | Published status (default: true) | "true" | | type | ❌ | Collection type: "custom" or "smart" (default: "custom") | "smart" | | rules_json | ⚠️ | Smart collection rules (required for smart collections) | [{"column":"price","relation":"greater_than","condition":"100"}] | | disjunctive | ❌ | Smart collection logic (default: false) | "false" |

Smart Collection Rules

Smart collections use JSON rules to automatically include products. Example rules:

[
  {
    "column": "title",
    "relation": "contains",
    "condition": "electronics"
  },
  {
    "column": "price",
    "relation": "greater_than",
    "condition": "100"
  }
]

Available Rule Types

  • Column: title, type, vendor, tag, price, compare_at_price, weight, inventory_stock, created_at, updated_at
  • Relation: equals, not_equals, contains, not_contains, starts_with, ends_with, greater_than, less_than
  • Condition: The value to match against

Word Document Extraction

The tool can extract collection data from Word documents by:

  1. Parsing hyperlinks and their associated text
  2. Extracting images and their URLs
  3. Generating collection titles from link text
  4. Creating descriptions automatically

Supported Word Document Features

  • Hyperlinks with text
  • Images with URLs
  • Automatic deduplication
  • CSV export with proper formatting

Error Handling

The tool includes comprehensive error handling:

  • Rate Limiting: Automatic retry with exponential backoff
  • API Errors: Detailed error messages with context
  • Validation: Input validation for required fields
  • Logging: Detailed logs for debugging and monitoring

Output Files

After running the bulk upload, you'll find:

  • data/upload_report_successes.csv - Successfully created collections
  • data/upload_report_errors.csv - Failed collections with error details
  • scripts/bulk-collections.log - Detailed execution log

Development

Project Structure

├── scripts/
│   ├── bulk-collections.js      # Main bulk upload script
│   ├── extract-from-docx.js     # Word document extraction
│   └── parse-bulk-log.js        # Log parsing utility
├── data/
│   ├── collections.sample.csv   # Example CSV file
│   └── collections.from_docx.csv # Extracted from Word doc
├── docs/
│   └── categorylist.docx        # Example Word document
└── package.json

Adding New Features

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Add tests if applicable
  5. Submit a pull request

Contributing

We welcome contributions! Please see CONTRIBUTING.md for guidelines.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Support

Changelog

v1.0.0

  • Initial release
  • Bulk collection creation from CSV
  • Word document extraction
  • Smart and custom collection support
  • Comprehensive error handling and logging