0.1.1 • Published 6 years ago

daft-conf v0.1.1

Weekly downloads
-
License
Unlicense
Repository
-
Last release
6 years ago

Bulletproof Nodejs Boilerplate

Package version Travis build status License: Unlicense Coverage Status PRs Welcome NPS Security Check Share on Twitter

Lean, and functional boilerplate to get you started with creating a nodejs app. You have ES6/7, corresponding linting rules, a debugging config for vscode, Jest test runner.

No tie-up with any plugins like Express and the likes. It's a barebones NodeJS app with live-reload, testing, test-coverage and a simple TravisCI build.

It is also a good base for your node or CLI apps and is designed to be:

  • Compatible with latest LTS of node, but backwards compatible with Node 6 (you'll need to run yarn run start:legacy)
  • Forward-thinking (async / await / object spreads and the likes)
  • Debuggable (includes vscode debug config)
  • Testable (check out the test file to see cool async tests)
  • CI ready (Travis config included)
  • NVM-friendly (see .nvmrc)

Developer goodies

  • .editorconfig
  • relateable linting rules
  • tests & test coverage
  • create-nodejs-app cli tool (WIP)
  • live-reload when you save a file.

Get started

There are three ways of using this boilerplate.

  1. Download the release and extract
  2. Clone the repo without it's history:

    # clone this repo
    git clone --depth=1 --branch=master https://github.com/piggyslasher/bulletproof-node-boilerplate.git youNewProject
    
    rm -rf !$/.git #removes the .git directory
  3. Use the create-nodejs-app (in progress :)

To start the app

# To just run the script and see output
npm start # or
yarn start

# for development and live-reload
npm run start:watch #or
yarn run start:watch

Debug in VSCode

Debug using VSCode

Using nvm? Got you covered

Debug with nvm version in .nvmrc

Progress Tracker

  • use create-new-cli to provision node app
  • maintain node version compatibility
    • Latest LTS
    • Node 6+
  • perform live-reload of all scripts using nodemon
  • provide testing using Jest
  • provide TravisCI basic testing
  • provide codacy stats
  • provide code coverage
  • provide sane linting rules (currently based on Airbnb but allows goodies like dangling commas and semi-colon-free development)
  • use async/await/promisify
  • support CLI tools (have a look at bin/cli.js)
  • allow options for 3rd party linting rules (standard, airbnb)
  • debug using vscode's node debugger
    • use babel sourcemaps during debgging (workaround, use debugger)