Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/shinnn/sum-up
Summarize package information
https://github.com/shinnn/sum-up
cli-utility information javascript nodejs package-json terminal
Last synced: 26 days ago
JSON representation
Summarize package information
- Host: GitHub
- URL: https://github.com/shinnn/sum-up
- Owner: shinnn
- License: isc
- Created: 2014-11-29T05:01:23.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2017-12-11T05:16:55.000Z (almost 7 years ago)
- Last Synced: 2024-09-20T05:12:43.164Z (about 2 months ago)
- Topics: cli-utility, information, javascript, nodejs, package-json, terminal
- Language: JavaScript
- Homepage:
- Size: 69.3 KB
- Stars: 15
- Watchers: 1
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# sum-up
[![npm version](https://img.shields.io/npm/v/sum-up.svg)](https://www.npmjs.com/package/sum-up)
[![Build Status](https://travis-ci.org/shinnn/sum-up.svg?branch=master)](https://travis-ci.org/shinnn/sum-up)
[![Coverage Status](https://img.shields.io/coveralls/shinnn/sum-up.svg)](https://coveralls.io/r/shinnn/sum-up)Summarize package information
```javascript
const sumUp = require('sum-up');
console.log(sumUp(require('./package.json')));
```![Screenshot](./screenshot.png "Screenshot")
It helps your CLI tool to display information with `--help` flag.
## Installation
[Use npm.](https://docs.npmjs.com/cli/install)
```
npm install sum-up
```## API
```javascript
const sumUp = require('sum-up');
```### sumUp(*pkgData* [, *option*])
*pkgData*: `Object`
*option*: `Object`
Return: `string`It joins the `name`, `version`, `homepage` and `description` properties (all is optional) of the first argument into a string colorized with [ANSI escape code](https://github.com/sindresorhus/ansi-styles).
#### option.color
Type: `boolean`
Default: `true` if [the environment supports colors](https://github.com/sindresorhus/supports-color), otherwise `false``false` omits all ANSI escape code from the string.
```javascript
const data = {
name: 'cli-name',
version: '0.6.11',
description: 'My CLI tool.'
}sumUp(data); //=> '\u001b[36mcli-name\u001b[39m \u001b[90mv0.6.11\u001b[39m\nMy CLI tool.'
sumUp(data, {color: false}); //=> 'cli-name v0.6.11\nMy CLI tool.'
```## License
[ISC License](./LICENSE) © 2017 Shinnosuke Watanabe