Skip to content

spence-s/spence-s-starter-template

Repository files navigation

spence-s-starter-template

Node.js CI

A bleeding edge, prod ready starter template for creating and publishing Node.js libraries to npm.

Features Include:

Getting starting

Installation

This is a github template and is best used by using the github UI to start a new project.

Once you've cloned the template for a new repository, the first thing you want to do is to make sure all the deps are up to date!

  1. Run npm install to get the immediately needed deps
  2. run npm run update to have npm-check-updates run an interactive program to update all the other deps.
  3. run npm run test to ensure updates haven't broken anything themselves (this typically shouldn't happen).

Run the hello world

This starter-template is already set up to run typescript code out of the box with tsc and node --watch in parallel.

npm run dev

Will compile the src/index.ts in memory and execute it.

Building the project

npm run build will build the project to the dist directory (which is already gitignored).

Developing

npm run dev will build the project with tsc --watch execute the script with the new nodejs watch flag.

Testing

npm run test will build the project and run the tests once npm run test:coverage will build the project once and run the tests once with node experimental test coverage flags. npm run test:watch will build the project in watch mode, and re-run the tests anytime something changes.

Updating dependencies

npm run update will use ncu -i to update all dependencies to their latest versions, interactively

Releasing

To encourage best practices for publishing an open source package on npm, np is installed by default.

npm run release

About

An opinionated ESM + typescript starter template for new node.js project.

Resources

License

Stars

Watchers

Forks

Packages

No packages published