🛩ī¸

How to make an NPX to scaffold projects package.

I should peep this

This is an article to help you learn how to create the beginnings of a package like create-turbo or create-react-app that help you begin a project by scaffolding out the needed files.

inspired by/learned in part from.

  1. Create a Bin file.
    1. #! /usr/bin/env node
  2. package.json
  3. "bin": {
    	"multiply": "bin/index.js"
    },
  4. Test locally with npm i -g
  5. Run with npx package-name
  6. publish with npm account
    1. npm login
    2. npm publish

Scoped package.

  1. package.json
  2. {
      "name": "@<YOUR_GITHUB_USERNAME>/<YOUR_PACKAGE_NAME>",
      ...
    }
  3. publishConfig.
  4. {
      ...
      "publishConfig": {
        "access": "public"
      }
    }