Nodeplate
A boilerplate for your rock-solid node.js projects. Includes static code analysis, development and building tools.
Install / Use
/learn @g-div/NodeplateREADME
nodeplate
A boilerplate for your rock-solid node.js projects. Includes static code analysis, development and building tools.
What's included ?
-
Babel transpiling
npm start(using babel)Write your code in ES6.
-
Watch files and reload
npm run dev(using nodemon)Run your script and watch for changes.
-
Debugging
npm run debug(using babel-node-debug)Debug your application using a babel-compatible version of node-inspector.
-
Test runner
npm test(using lab)Write your tests in the
testfolder and run them withnpm test. -
Code coverage
npm run coverage(using lab)Lab can also calculate the code coverage.
-
Code linting
npm run lint(using xo)Lint your code (even ES6/7 and JSX).
-
Code format
npm run format(using xo)Beautify and format you code. Fix errors found by xo
-
Recognize duplicate code
npm run inspect(using jsinspect)Recognize duplicate, copy-pasted and similar code.
-
License checker
npm run licenses(using license-checker)Print the link and the license type of each dependency
-
Package building
npm run build(using nar)You can build an executable file out of your project including all dependencies.
Please refer to nar's documentation if you like to include a custom node.js version or to build a package for a different system-architecture/OS. You should simple edit the
buildproperty in thescriptssection ofpackage.jsonto something like:
nar create --executable --os darwin --arch x64 --node 0.12.0
-
Find vulnerabilities
npm run deps:sec(using nsp)nsp (Node Security Project) will check if any dependency is affected by a known vulnerability.
-
Keep dependencies up-to-date
npm run deps:updates(using david)David keeps dependencies up-to-date and will help you to update them.
-
README generator
npm run readme(using node-readme)Generate a README like this from an ES6 template extracting data from
package.json. Edit the.README.mdtemplate and run the command. Check the node-readme documentation for all available variables/functions.Do not edit the
README.mdin your project folder, since this will be overwritten running thenpm run readmecommand. -
Git hooks (using husky)
Custom
precommitandprepushare defined in order to run tests (and vulnerabilities discovery) on commit and push. You can define your own in thepackage.json
Install
git clone https://github.com/g-div/nodeplate
cd nodeplate
npm install
Usage
Use npm commands listed above as following:
npm run lint
npm run test:deps
or use npm-run-all:
npm-run-all --parallel lint test:deps test --sequential build
Scripts
- npm run readme :
node-readme - npm run precommit :
npm test - npm run prepush :
npm-run-all lint test test:deps - npm run start :
npm run boot - npm run boot :
babel-node $npm_package_main - npm run dev :
nodemon --exec babel-node -- $npm_package_main - npm run debug :
babel-node-debug $npm_package_main - npm run lint :
xo - npm run format :
xo --fix - npm run inspect :
jsinspect - npm run test :
lab - npm run coverage :
lab -r lcov - npm run build :
nar create --executable - npm run deps:sec :
nsp audit-package - npm run deps:updates :
david - npm run test:deps :
npm-run-all deps:sec deps:updates - npm run licenses :
license-checker
Dependencies
Package | Version | Dev --- |:---:|:---: babel | ^5.8.29 | ✖ babel-node-debug | ^1.3.0 | ✔ david | ^6.4.0 | ✔ husky | ^0.10.1 | ✔ jsinspect | ^0.7.0 | ✔ lab | ^7.0.0 | ✔ license-checker | ^4.2.0 | ✔ nar | ^0.3.20 | ✔ node-readme | ^0.1.9 | ✔ nodemon | ^1.8.0 | ✔ npm-run-all | ^1.2.12 | ✔ nsp | ^1.1.0 | ✔ xo | ^0.10.1 | ✔
TODOs:
- [ ] Documentation tool (JSDoc, dox, ...)
- [ ] Aggregate commands using npm-run-all
- [ ] Use a scaffolding system (init)
- [x] Consider standard instead of xo
- [ ] Fix nar: should be able to use $npm_package_main variable (see h2non/nar#115 and h2non/nar#116)
- [ ] Consider strong-build instead of nar
- [ ] Consider semantic-release
- [ ] Consider hotel and minihost
Contributing
Contributions welcome; Please submit all pull requests the against master branch.
Author
g-div <undefined> http://github.com/g-div
License
- ISC : http://opensource.org/licenses/ISC
Related Skills
node-connect
335.4kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
82.5kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
335.4kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
commit-push-pr
82.5kCommit, push, and open a PR
Security Score
Audited on Aug 30, 2023
