A node.js starter with typescript, eslint, prettier, unit testing and a logging util.
This repo assumes you have node.js installed using NVM.
- Run
nvm use
to install the required version of Node.js - Run
npm install
to install dependencies
Run npm start
to compile code and run.
Run npm start:dev
to compile and watch for changes, recompiled and run.
Run npm run test
to run any tests matching src/**/*.spec.ts
.
Run npm run build
to generate a build of the code in the ./dist
directory.
Includes ts-node and ts-node-dev to compile code and/or watch for changes and recompile.
Includes eslint and prettier configured at the root of the application.
Includes Mocha, Chai and Sinon for testing. Tests should match the pattern of {somefile}.spec.ts
.
Includes dotenv by default. You may create a root-level .env
file to pass configuration values to the application.
Includes winston as a logging library (see ./src/util/log.ts
). Usage is as follows:
import Logger from './util/log
Logger.error('I am an error!')
Lodash is also included.
This repo was created out of a frequent need to spin up smaller Node.js projects and provides some boilerplate to start building apps. Feel free to contribute, but the intent of this repo is generally for my personal usage :).