sum-up
Summarize package information
var sumUp = require('sum-up');
console.log(sumUp(require('./package.json')));
It helps your CLI tool to display information with --help
flag.
Installation
Use npm.
npm install sum-up
API
var sumUp = require('sum-up');
sumUp(options)
options: Object
Return: String
It joins the name
, version
, homepage
and description
of the object (all is optional) into a string colorized with ANSI escape code.
options.color
Type: Boolean
Default: true
if the environment supports color, otherwise false
false
omits all ANSI escape code from the string.
var data = {
name: 'cli-name',
version: '0.6.11',
description: 'My CLI tool.'
}
sumUp(data);
data.color = false;
sumUp(data);
License
Copyright (c) 2014 - 2015 Shinnosuke Watanabe
Licensed under the MIT License.