node-package-template-typescript
v1.0.0
Published
Template for develop a NodeJS package with Typescript
Readme
node-package-template-typescript
Template for develop a NodeJS package with Typescript.
Requirements
- NodeJS: https://nodejs.org/
- npm: https://www.npmjs.com/
- Npmjs access token.
- Github secret defined.
Npmjs & Github Authorization
It must be created a new Access Token into your Account section in npmjs.com.
Manage your authentication tokens for your npm account
Store it in Github browsing to the repository and click on 'Settings > Secrets & Variables > Actions > Repository Secrets ' and click on 'New repository secret' and follow the instructions.
Using secrets in GitHub Actions
Token Name
The token must be called 'npm_token'
Whether the token is not called this way or is not defined, the workflow will fail and will break abd finish the Github Action with an error state.
Tools
Linter: ESLint
Manage lint rules for Typescript, Javascript, JSON and Github Markdown: eslint
Typescript support: typescript-eslint
Javascript support: @eslint/js
JSON support: @eslint/json+
Markdown support (for Github Markdown): @eslint/markdown
Formatter: Prettier
Manage format rules: prettier
Deactivate conflictive and not compatible rules between ESLint and Prettier: eslint-config-prettier
Running Prettier with ESLint: eslint-plugin-prettier
Unit Test: Jest
Creating and Running the unit tests: jest
Bundler: Tsup
Bundle Typescript easily: tsup
Install
npm i [package] [-D] [-S]How to use
import { [member] } from [package];
...more code here