Plop Node + Express generator
Plop generator for Node + Express apps coding in ES6.
Requirements
The first requirement is to have isntalled Node.
Then install Plop globally $ npm install -g plop
.
Usage
First, you should install the generator: $ npm install plop-node-express
.
Create in the root of your project a plopfile.js
with this content:
moduleexports = ;
In the terminal, type: $ plop
, this will be execute the generator.
Before start to develop, remember to install all the dependencies: $ npm install
.
Provided generator
The generator provides a fresh starting point for Node + Express project:
- NPM as a package manager and a task runner.
- Babel as a transpiler. I use to work in ES6.
- ESLint as a linter.
- Mocha as a test framework, with Chai as assertion library and Chai-http as an extension for testing HTTP APIs.
Commands available:
Command | Action |
---|---|
eslint | Run ESLint on src/ directory. |
test | Run test framework. |
dev | Run the compilation (with Babel ) and a nodemon that restarts node at any change in the code. |
build | Run eslint task, test task, compile the code and output it at dist/ dir. |
start | Run build task and start the app. |
To run a command: $ npm run <command>
.