kgryte / node-module-starter-kit

Node module starter kit.
MIT License
2 stars 0 forks source link

Node Module Starter Kit

NPM version Build Status Coverage Status Dependencies

Node module starter kit.

Installation

$ npm install @kgryte/node-module-starter-kit

Usage

var starter = require( '@kgryte/node-module-starter-kit' );

starter( dest[, opts ][, clbk ] )

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:

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!' );
}

Notes

Examples

To run the example code from the top-level application directory,

$ node ./examples/index.js

CLI

Installation

To use the module as a general utility, install the module globally

$ npm install -g @kgryte/node-module-starter-kit

Usage

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.

Notes

Examples

$ 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

Tests

Unit

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.

Test Coverage

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

License

MIT license.

Copyright

Copyright © 2015-2016. Athan Reines.