Galerie und tage
This commit is contained in:
20
node_modules/sum-up/LICENSE
generated
vendored
Normal file
20
node_modules/sum-up/LICENSE
generated
vendored
Normal file
@@ -0,0 +1,20 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2014 - 2016 Shinnosuke Watanabe
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||
this software and associated documentation files (the "Software"), to deal in
|
||||
the Software without restriction, including without limitation the rights to
|
||||
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
||||
the Software, and to permit persons to whom the Software is furnished to do so,
|
||||
subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
||||
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
||||
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
||||
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
66
node_modules/sum-up/README.md
generated
vendored
Normal file
66
node_modules/sum-up/README.md
generated
vendored
Normal file
@@ -0,0 +1,66 @@
|
||||
# sum-up
|
||||
|
||||
[](https://www.npmjs.com/package/sum-up)
|
||||
[](https://travis-ci.org/shinnn/sum-up)
|
||||
[](https://coveralls.io/r/shinnn/sum-up)
|
||||
[](https://david-dm.org/shinnn/sum-up)
|
||||
[](https://david-dm.org/shinnn/sum-up#info=devDependencies)
|
||||
|
||||
Summarize package information
|
||||
|
||||
```javascript
|
||||
const sumUp = require('sum-up');
|
||||
console.log(sumUp(require('./package.json')));
|
||||
```
|
||||
|
||||

|
||||
|
||||
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(*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](https://github.com/sindresorhus/ansi-styles).
|
||||
|
||||
#### options.color
|
||||
|
||||
Type: `Boolean`
|
||||
Default: `true` if [the environment supports color](https://github.com/sindresorhus/supports-color), otherwise `false`
|
||||
|
||||
`false` omits all ANSI escape code from the string.
|
||||
|
||||
```javascript
|
||||
let 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.'
|
||||
|
||||
data.color = false;
|
||||
|
||||
sumUp(data); //=> 'cli-name v0.6.11\nMy CLI tool.'
|
||||
```
|
||||
|
||||
## License
|
||||
|
||||
Copyright (c) 2014 - 2016 [Shinnosuke Watanabe](https://github.com/shinnn)
|
||||
|
||||
Licensed under [the MIT License](./LICENSE).
|
||||
51
node_modules/sum-up/index.js
generated
vendored
Executable file
51
node_modules/sum-up/index.js
generated
vendored
Executable file
@@ -0,0 +1,51 @@
|
||||
/*!
|
||||
* sum-up | MIT (c) Shinnosuke Watanabe
|
||||
* https://github.com/shinnn/sum-up
|
||||
*/
|
||||
'use strict';
|
||||
|
||||
var util = require('util');
|
||||
|
||||
var Chalk = require('chalk').constructor;
|
||||
|
||||
module.exports = function sumUp(pkgData) {
|
||||
if (!pkgData || Array.isArray(pkgData) || typeof pkgData !== 'object') {
|
||||
throw new TypeError(
|
||||
util.inspect(pkgData).replace(/\n/g, '') +
|
||||
' is not a plain object. Expected an object of package information,' +
|
||||
' for example npm\'s package.json `{name: ... version: ..., description: ..., ...}`.'
|
||||
);
|
||||
}
|
||||
|
||||
if (pkgData.color !== undefined && typeof pkgData.color !== 'boolean') {
|
||||
throw new TypeError(
|
||||
util.inspect(pkgData.color).replace(/\n/g, '') +
|
||||
' is neither true nor false. `color` option must be a Boolean value.'
|
||||
);
|
||||
}
|
||||
|
||||
var chalk = new Chalk({enabled: pkgData.color});
|
||||
var lines = [];
|
||||
|
||||
var nameAndVersion = chalk.cyan(pkgData.name || '');
|
||||
if (pkgData.version) {
|
||||
if (pkgData.name) {
|
||||
nameAndVersion += ' ';
|
||||
}
|
||||
nameAndVersion += chalk.gray('v' + pkgData.version);
|
||||
}
|
||||
|
||||
if (nameAndVersion) {
|
||||
lines.push(nameAndVersion);
|
||||
}
|
||||
|
||||
if (pkgData.homepage) {
|
||||
lines.push(chalk.gray(pkgData.homepage));
|
||||
}
|
||||
|
||||
if (pkgData.description) {
|
||||
lines.push(pkgData.description);
|
||||
}
|
||||
|
||||
return lines.join('\n');
|
||||
};
|
||||
40
node_modules/sum-up/package.json
generated
vendored
Normal file
40
node_modules/sum-up/package.json
generated
vendored
Normal file
@@ -0,0 +1,40 @@
|
||||
{
|
||||
"name": "sum-up",
|
||||
"version": "1.0.3",
|
||||
"description": "Summarize package information",
|
||||
"repository": "shinnn/sum-up",
|
||||
"homepage": "https://github.com/shinnn/sum-up",
|
||||
"author": "Shinnosuke Watanabe (https://github.com/shinnn)",
|
||||
"scripts": {
|
||||
"pretest": "eslint --config @shinnn/node-legacy index.js test.js",
|
||||
"test": "node --strong_mode test.js --color && node test.js --no-color",
|
||||
"coverage": "node --strong_mode node_modules/.bin/istanbul cover test.js -- --color",
|
||||
"coveralls": "${npm_package_scripts_coverage} && istanbul-coveralls"
|
||||
},
|
||||
"license": "MIT",
|
||||
"files": [
|
||||
"index.js"
|
||||
],
|
||||
"keywords": [
|
||||
"summerize",
|
||||
"summary",
|
||||
"brief",
|
||||
"outline",
|
||||
"info",
|
||||
"information",
|
||||
"description",
|
||||
"data",
|
||||
"package",
|
||||
"color",
|
||||
"cli-friendly"
|
||||
],
|
||||
"dependencies": {
|
||||
"chalk": "^1.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@shinnn/eslint-config-node-legacy": "^2.0.0",
|
||||
"eslint": "^2.4.0",
|
||||
"istanbul": "^0.4.2",
|
||||
"tape": "^4.5.1"
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user