README
Generator
Lob's Yeoman generator for creating Node modules.
Installation
$ yarn install --global generator-lob
Usage
To generate a complete repository:
$ yo lob
To generate a portion of a repository, you may use a sub-generator.
Sub-Generators
Config yo lob:config
Continuous Integration yo lob:ci
Lint yo lob:lint
Node Version yo lob:node-version
Release yo lob:release
Test yo lob:test
Config
$ yo lob:config
- Prompts for whether to generate a
configdirectory - Generates a
config/index.jsfile that reads an object of config variables from one ofconfig/developments.js,config/production.js,config/staging.js, orconfig/test.jsbased on theNODE_ENV. Initializes each environment's config file to export an empty object.
Continuous Integration
$ yo lob:ci
- Prompts for a CI platform (CircleCI or Travis) and Node version and composes a
.ymlfile accordingly
Lint
$ yo lob:lint
- Installs
eslintandeslint-config-lob - Creates an
.eslintrcfile that configures the linter to useeslint-config-lob's default rules - Creates an
.eslintignorefile that excludes thecoverage/folder from linting - Adds a
lintyarn script to lint all javascript files in the project
Node Version
$ yo lob:node-version
- Prompts for a node version and uses it in a
.node-versionfile
Release
$ yo lob:release
- Installs generate-changelog
- Adds yarn scripts for
release:patch,release:minor, andrelease:major
Test
$ yo lob:test
- Installs chai, istanbul, and mocha
- Creates
test/setup.jsfile that defines anexpectglobal - Adds yarn scripts for
enforce,test, andtest-no-cover
Extension
To learn more about building generators, read the Yeoman Guide to Authoring Generators. New sub-generators can be added in the generators/ folder and made available as a yo lob:SUB command through the index.js file. To modify the list of sub-generators that are run as part of the default yo lob command, modify the generators/index.js file.