Truitt7
Truitt7

Reputation: 69

How to create a boilerplate npm package

I have created a repo that contains all of the basic configuration for starting any new Gatsby + Shopify site. I would like to take it in it's current state and create a "starter" or "boilerplate" package similar to create-react-app where I can reuse the same setup for other sites in the future..

For example I would like to be able to run a command like gatsby-shopify-create <repo name> and have a new repo created with all of the configuration ready. Similar to the way create react app works.

I am looking for any resources on how to do this or any help from someone who has done this before.

Upvotes: 0

Views: 1193

Answers (1)

vhflat
vhflat

Reputation: 589

You can use the bin entry in package.json.

"bin": {
  "gatsby-shopify-create": "./create.js"
}

after you create a node commmandline tool in create.js

Checkout this guide.

Upvotes: 0

Related Questions