A translucent Node.js server starter-kit
Express + Babel + Prettier + ESLint + Jest
- Use a familiar Node.js HTTP server library (via Express)
- Use the latest and greatest ECMAScript (via Babel)
- Keep code clean and consistent (via Prettier and ESLint)
- Provide a fast development workflow (via nodemon)
- Write tests with ease (via Jest)
Clone the repo via git:
git clone --depth=1 https://github.com/justinsisley/clear.git your-project-name
Initialize your own git repository:
$ cd your-project-name
$ rm -rf .git && git init
Install dependencies:
$ npm i
Run the server in development mode:
npm run dev
Note: In development mode, the server will restart any time your code is changed.
Run all tests:
npm test
Run tests in watch mode:
npm test -- --watch
Note: Any file in the
src
directory that ends in.test.js
will be found by Jest.
Create a static build:
npm run build
Note: This script will use Babel to compile code within the
src
directory into adist
directory.
Run the server in production mode:
npm start
Note: This script requires a build via
npm run build
.
This starter-kit is pre-configured with a git pre-commit hook, which will automatically clean up your staged code using Prettier and ESLint. This is done using lint-staged and husky.
You can modify the pre-commit workflow in the .lintstagedrc
file.