ts-npm-starter
v1.0.7
Published
Self-publishing Typescript NPM package starter
Downloads
5
Readme
ts-npm-starter
Self-publishing Typescript NPM package starter
Features
✓ Auto publish to NPM - Powered by Github actions
✓ Typescript - Build with confidence
✓ Jest - Don't guess, test
Get it!
$ npx startmeup ts-npm-starter [local-folder]
Setup
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)
Adding your NPM Automation Token
To authenticate the publish-to-npm.yml
Github Actions workflow, you will need to setup a NPM access token in two easy steps:
Step #1 - Get a NPM publish token
- 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!)
Step #2 - Add NPM token as "NPM_TOKEN" secret
- 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
:
Development
yarn watch
/ npm run watch
Test
yarn test
/ npm run test
Publish to NPM
Push a commit to main branch - .github/workflows/publish-to-npm.yml
will automatically publish a new patch version to NPM.
Node Version
tsconfig.json
is setup to work with Node v12 (supported on AWS Lambda)
License
MIT