Self-publishing Typescript NPM package starter
✓ Auto publish to NPM - Powered by Github actions
✓ Typescript - Build with confidence
✓ Jest - Don't guess, test
$ npx startmeup ts-npm-starter [local-folder]
yarn
/npm install
- Add your username & email in
.github/workflows/publish-to-npm.yml
- Set package name & description in
package.json
- Set
NPM_TOKEN
inRepository Settings > Secrets > "Action Secrets"
(see below)
To authenticate the publish-to-npm.yml
Github Actions workflow, you will need to setup a NPM access token in two easy steps:
- Login to npmjs.com
- Go to
Access Token
>Create New Access Token
- Select an "Automation" token, then press
Generate Token
- Store the token somewhere! (for the second step - it's only displayed once!)
- Go to repository settings on Github (where you push your package's code to)
- Go to
Settings (repository)
>Secrets
>New repository secret
- Add your NPM publish token (from Step #1) as
NPM_TOKEN
:
yarn watch
/ npm run watch
yarn test
/ npm run test
Push a commit to main branch - .github/workflows/publish-to-npm.yml
will automatically publish a new patch version to NPM.
tsconfig.json
is setup to work with Node v12 (supported on AWS Lambda)
MIT