@hounddesk/test-pkg
v1.4.0
Published
The best starting point for your new NPM package
Downloads
4
Readme
pkg-template
The best starting point for your new Node project
Installation
This is a GitHub template repository Read more
It provides basic foundations for package authors, but it can be used as a good starting point for your Node.js application
Before using, download and install Node.js. Node.js 10.16.3 or higher is recommended.
Available utilities enabled by default
- TypeScript
- Testing with Jest and Tap reporter
- TypeScript linting using eslint
- TypeScript watch mode using ts-node-dev
- Formatting using Prettier
- Pre-commit hook using Husky (will run linter, formatting and unit tests before each commit)
VSCode support
- Format on save / type enabled by default using Prettier
- Prettier extension configuration, Read more
Conventions
- Source folder: src
- Output directory: dist
- Sourcemaps enabled by default
- Jest current file: Unit test debugging command for VSCode
- Debug: Node debugging command for VSCode
- All the eslint plugins are using the recommended defaults
Available commands
Start in development mode (watch mode with automatic restart)
$ npm run dev
Build TypeScript
$ npm run build
Build TypeScript in watch mode (without automatic restart)
$ npm run build:watch
Run unit tests
$ npm test
Run linter
$ npm run lint
Run linter with auto fix
$ npm run lint:fix
Run tests with coverage report
$ npm run coverage
VSCode developer suggested extensions
The following extensions works great alongside with this setup:
Usage for publishing packages
The recommended approach is to create a scoped public package (if you are not using private packages) Read more about scoped packages here
If you're using the package.json from the template you may want to change the name and references to pgk-template and change it to your library.