Home

Awesome

[!WARNING] Theme Kit has been deprecated (and thus node-themekit). Theme developers should use Shopify CLI for Shopify theme development, as parts of Theme Kit will become unsupported and may stop working soon.

npm version

@shopify/themekit

Node wrapper for Theme Kit.

Table Of Contents

Installation

$ npm install @shopify/themekit

Usage

const themeKit = require('@shopify/themekit');

await themeKit.command('version');
//=> ThemeKit 0.8.1 darwin/amd64

Examples

Run commands

This wrapper exposes a single function in its API which allows it to run any command available in the original Theme Kit CLI. Here are a collection of examples to run Theme Kit commands.

For a complete list of commands and args: shopify.github.io/themekit/commands.

Example 1

Remove specific files from development environment.

const themeKit = require('@shopify/themekit');

await themeKit.command('remove', {
  env: 'development',
  files: ['snippets/pagination.liquid', 'snippets/date.liquid']
});

Example 3

Deploy all files to staging environment.

const themeKit = require('@shopify/themekit');

themeKit.command('deploy', {
  env: 'staging'
});

Example 4

Deploy theme to production via NPM scripts.

Warning: This example will overwrite the theme based on your config.yml.

"dependencies": {
  "@shopify/themekit": "1.0.0"
},
"scripts": {
  "deploy": "shopify-themekit replace --env production"
}

API

command(command[, flags][, options])

Executes command with arguments using the Theme Kit binary.

For a complete list of commands and flags, see the Theme Kit documentation.

CLI

$ shopify-themekit <args>

This CLI component of this package is intended to be used with NPM scripts. It functions exactly the same as the original Theme Kit binary. If you plan on using the command line interface heavily, please refer to the original Theme Kit repository.

Contributing

Releases

This information is for project maintainers:

Instructions

License

MIT, see LICENSE.md for details.

<img src="https://cdn.shopify.com/shopify-marketing_assets/builds/19.0.0/shopify-full-color-black.svg" width="200" />