Node module starter kit.
$ npm install @kgryte/node-module-starter-kit
var starter = require( '@kgryte/node-module-starter-kit' );
Runs starter tasks.
var dir = 'path/to/a/directory';
starter( dir, done );
function done( error ) {
if ( error ) {
throw error;
}
console.log( 'Success!' );
}
The function accepts the following options
:
boolean
indicating whether a module is browser compatible. Default: true
.boolean
indicating whether to initialize a local Git repository. Default: true
.boolean
indicating whether to create a remote Github repository. Default: true
.boolean
indicating whether to star a remote Github repository. Default: true
.boolean
indicating whether to initialize continuous integration. Default: true
.boolean
indicating whether to run installation tasks. Default: true
.false
. Default: 'subl .'
. boolean
indicating whether to silence verbose logging. Default: false
.opts = {
'name': 'example',
'desc': 'An example module.',
'author': 'Jane Doe',
'email': 'janedoe@example.com',
'keywords': [
'beep',
'boop',
'bop'
],
'cmd': 'eg',
'repo': 'janedoe/example',
'license': 'MIT',
'holder': 'D&D, Inc'
};
starter( dir, opts, done );
function done( error ) {
if ( error ) {
throw error;
}
console.log( 'Success!' );
}
To run the example code from the top-level application directory,
$ node ./examples/index.js
To use the module as a general utility, install the module globally
$ npm install -g @kgryte/node-module-starter-kit
Usage: nodemodule [options] [destination]
Options:
-h, --help Print this message.
-V, --version Print the package version.
--name name Module name.
-desc, --description desc Module description.
--author author Module author.
--email email Author email.
--keywords keywords Keywords describing module; e.g., word1,word2,...
--cmd cmd Command-line interface command.
--repo repo Module repository.
--license name License. Default: 'MIT'.
--holder holder Copyright author.
-o, --open cmd Command to open a destination directory.
Default: 'subl .'.
--no-browser Module is not browser compatible.
--no-git Do not initialize a git repository.
--no-remote Do not initialize a remote git repository.
--no-star Do not star the remote git repository.
--no-ci Do not initialize continuous integration.
--no-install Do not run installation tasks.
--no-open Do not open module directory in a text editor.
--silent Do not display verbose logging.
destination
directory is the current working directory.$ cd ~/my/project/directory
$ nodemodule
# => runs starter tasks in the current working directory
To specify a destination other than the current working directory, provide a destination
.
$ nodemodule ./../some/other/directory
This repository uses tape for unit tests. To run the tests, execute the following command in the top-level application directory:
$ make test
All new feature development should have corresponding unit tests to validate correct functionality.
This repository uses Istanbul as its code coverage tool. To generate a test coverage report, execute the following command in the top-level application directory:
$ make test-cov
Istanbul creates a ./reports/coverage
directory. To access an HTML version of the report,
$ make view-cov
Copyright © 2015-2016. Athan Reines.