项目作者: tiphedor

项目描述 :
Yeoman generator for a JS boilerplate project
高级语言:
项目地址: git://github.com/tiphedor/generator-js.git
创建时间: 2018-11-06T15:42:52Z
项目社区:https://github.com/tiphedor/generator-js

开源协议:MIT License

下载


generator-js

Yeoman generator for a JS boilerplate project

What will be generated ?

A boilerpate JS project structure, with babel-powered ES8 transpiling, eslint (with amazing settings provided by yours truly, pm2, nodemon, jest unit tests, …

Usage

  1. yarn add global generator-js-tiphedor
  2. # or
  3. npm i -g generator-js-tiphedor
  4. yo js-tiphedor

Project usage

The project ships with a couple of useful scripts that you can invoke with npm run <script> or yarn <script>. Thoses scripts are:

  • start alias to start:dev
  • start:dev Runs the project in dev mode (using babel-node, so with sub-optimal perfomances), watched by nodemon
  • start:prod Runs build:prod to transpile the code, then serves the app as a pm2 deamon (so with auto-restart, …), and then attaches the logs of the app to the terminal. Ctrl-C will only stop the logging, to stop the app use stop
  • stop alias to stop:dev
  • stop:dev stops the pm2 deamon
  • build alias to build:prod
  • build:prod transpiles the ES8 code to standard JS, and places the result in the dist folder.
  • test runs test:lint and test:unit
  • test:lint runs eslint on the whole project
  • test:unit runs all the unit tests, located in ./src/*.{test,spec}.js. Saves the coverage info to ./coverage