--- /dev/null
+The MIT License (MIT)
+
+Copyright (c) 2015, Jon Schlinkert.
+
+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.
--- /dev/null
+# align-text [![NPM version](https://badge.fury.io/js/align-text.svg)](http://badge.fury.io/js/align-text) [![Build Status](https://travis-ci.org/jonschlinkert/align-text.svg)](https://travis-ci.org/jonschlinkert/align-text)
+
+> Align the text in a string.
+
+**Examples**
+
+Align text values in an array:
+
+```js
+align([1, 2, 3, 100]);
+//=> [' 1', ' 2', ' 3', '100']
+```
+
+Or [do stuff like this](./example.js):
+
+[![screen shot 2015-06-09 at 2 08 34 am](https://cloud.githubusercontent.com/assets/383994/8051597/7b716fbc-0e4c-11e5-9aef-4493fd22db58.png)](./example.js)
+
+Visit [the example](./example.js) to see how this works.
+
+## Install
+
+Install with [npm](https://www.npmjs.com/)
+
+```sh
+$ npm i align-text --save
+```
+
+## Usage
+
+```js
+var align = require('align-text');
+align(text, callback_function_or_integer);
+```
+
+**Params**
+
+* `text` can be a **string or array**. If a string is passed, a string will be returned. If an array is passed, an array will be returned.
+* `callback|integer`: if an integer, the text will be indented by that amount. If a function, it must return an integer representing the amount of leading indentation to use as `align` loops over each line.
+
+**Example**
+
+```js
+align(text, 4);
+```
+
+Would align:
+
+```
+abc
+abc
+abc
+```
+
+To:
+
+```
+ abc
+ abc
+ abc
+```
+
+## callback
+
+### params
+
+The callback is used to determine the indentation of each line and gets the following params:
+
+* `len` the length of the "current" line
+* `longest` the length of the longest line
+* `line` the current line (string) being aligned
+* `lines` the array of all lines
+
+### return
+
+The callback may return:
+
+* an integer that represents the number of spaces to use for padding,
+* or an object with the following properties:
+ - `indent`: **{Number}** the amount of indentation to use. Default is `0` when an object is returned.
+ - `character`: **{String}** the character to use for indentation. Default is `''` (empty string) when an object is returned.
+ - `prefix`: **{String}** leading characters to use at the beginning of each line. `''` (empty string) when an object is returned.
+
+**Integer example:**
+
+```js
+// calculate half the difference between the length
+// of the current line and the longest line
+function centerAlign(len, longest, line, lines) {
+ return Math.floor((longest - len) / 2);
+}
+```
+
+**Object example:**
+
+```js
+function centerAlign(len, longest, line, lines) {
+ return {
+ character: '\t',
+ indent: Math.floor((longest - len) / 2),
+ prefix: '~ ',
+ }
+}
+```
+
+## Usage examples
+
+### Center align
+
+Using the `centerAlign` function from above:
+
+```js
+align(text, centerAlign);
+```
+
+Would align this text:
+
+```js
+Lorem ipsum dolor sit amet
+consectetur adipiscin
+elit, sed do eiusmod tempor incididun
+ut labore et dolor
+magna aliqua. Ut enim ad mini
+veniam, quis
+```
+
+Resulting in this:
+
+```
+ Lorem ipsum dolor sit amet,
+ consectetur adipiscing
+elit, sed do eiusmod tempor incididunt
+ ut labore et dolore
+ magna aliqua. Ut enim ad minim
+ veniam, quis
+```
+
+**Customize**
+
+If you wanted to add more padding on the left, just pass the number in the callback.
+
+For example, to add 4 spaces before every line:
+
+```js
+function centerAlign(len, longest, line, lines) {
+ return 4 + Math.floor((longest - len) / 2);
+}
+```
+
+Would result in:
+
+```
+ Lorem ipsum dolor sit amet,
+ consectetur adipiscing
+ elit, sed do eiusmod tempor incididunt
+ ut labore et dolore
+ magna aliqua. Ut enim ad minim
+ veniam, quis
+```
+
+### Bullets
+
+```js
+align(text, function (len, max, line, lines) {
+ return {prefix: ' - '};
+});
+```
+
+Would return:
+
+```
+- Lorem ipsum dolor sit amet,
+- consectetur adipiscing
+- elit, sed do eiusmod tempor incididunt
+- ut labore et dolore
+- magna aliqua. Ut enim ad minim
+- veniam, quis
+```
+
+### Different indent character
+
+```js
+align(text, function (len, max, line, lines) {
+ return {
+ indent: Math.floor((max - len) / 2),
+ character: '~',
+ };
+});
+```
+
+Would return
+
+```
+~~~~~Lorem ipsum dolor sit amet,
+~~~~~~~~consectetur adipiscing
+elit, sed do eiusmod tempor incididunt
+~~~~~~~~~ut labore et dolore
+~~~~magna aliqua. Ut enim ad minim
+~~~~~~~~~~~~~veniam, quis
+```
+
+## Related projects
+
+* [center-align](https://github.com/jonschlinkert/center-align): Center-align the text in a string.
+* [justify](https://github.com/bahamas10/node-justify): Left or right (or both) justify text using a custom width and character
+* [longest](https://github.com/jonschlinkert/longest): Get the longest item in an array.
+* [right-align](https://github.com/jonschlinkert/right-align): Right-align the text in a string.
+* [repeat-string](https://github.com/jonschlinkert/repeat-string): Repeat the given string n times. Fastest implementation for repeating a string.
+* [word-wrap](https://github.com/jonschlinkert/word-wrap): Wrap words to a specified length.
+
+## Running tests
+
+Install dev dependencies:
+
+```sh
+$ npm i -d && npm test
+```
+
+## Contributing
+
+Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](https://github.com/jonschlinkert/align-text/issues/new)
+
+## Author
+
+**Jon Schlinkert**
+
++ [github/jonschlinkert](https://github.com/jonschlinkert)
++ [twitter/jonschlinkert](http://twitter.com/jonschlinkert)
+
+## License
+
+Copyright © 2015 [Jon Schlinkert](https://github.com/jonschlinkert)
+Released under the MIT license.
+
+***
+
+_This file was generated by [verb-cli](https://github.com/assemble/verb-cli) on June 09, 2015._
--- /dev/null
+/*!
+ * align-text <https://github.com/jonschlinkert/align-text>
+ *
+ * Copyright (c) 2015, Jon Schlinkert.
+ * Licensed under the MIT License.
+ */
+
+'use strict';
+
+var typeOf = require('kind-of');
+var repeat = require('repeat-string');
+var longest = require('longest');
+
+module.exports = function alignText(val, fn) {
+ var lines, type = typeOf(val);
+
+ if (type === 'array') {
+ lines = val;
+ } else if (type === 'string') {
+ lines = val.split(/(?:\r\n|\n)/);
+ } else {
+ throw new TypeError('align-text expects a string or array.');
+ }
+
+ var fnType = typeOf(fn);
+ var len = lines.length;
+ var max = longest(lines);
+ var res = [], i = 0;
+
+ while (len--) {
+ var line = String(lines[i++]);
+ var diff;
+
+ if (fnType === 'function') {
+ diff = fn(line.length, max.length, line, lines, i);
+ } else if (fnType === 'number') {
+ diff = fn;
+ } else {
+ diff = max.length - line.length;
+ }
+
+ if (typeOf(diff) === 'number') {
+ res.push(repeat(' ', diff) + line);
+ } else if (typeOf(diff) === 'object') {
+ var result = repeat(diff.character || ' ', diff.indent || 0);
+ res.push((diff.prefix || '') + result + line);
+ }
+ }
+
+ if (type === 'array') return res;
+ return res.join('\n');
+};
--- /dev/null
+{
+ "_args": [
+ [
+ {
+ "raw": "align-text@^0.1.3",
+ "scope": null,
+ "escapedName": "align-text",
+ "name": "align-text",
+ "rawSpec": "^0.1.3",
+ "spec": ">=0.1.3 <0.2.0",
+ "type": "range"
+ },
+ "/home/sources/5.0/crosswalk-tizen/wrt/node_modules/center-align"
+ ]
+ ],
+ "_from": "align-text@>=0.1.3 <0.2.0",
+ "_id": "align-text@0.1.4",
+ "_inCache": true,
+ "_location": "/align-text",
+ "_nodeVersion": "5.5.0",
+ "_npmOperationalInternal": {
+ "host": "packages-9-west.internal.npmjs.com",
+ "tmp": "tmp/align-text-0.1.4.tgz_1454377856920_0.9624228512402624"
+ },
+ "_npmUser": {
+ "name": "shinnn",
+ "email": "snnskwtnb@gmail.com"
+ },
+ "_npmVersion": "3.6.0",
+ "_phantomChildren": {},
+ "_requested": {
+ "raw": "align-text@^0.1.3",
+ "scope": null,
+ "escapedName": "align-text",
+ "name": "align-text",
+ "rawSpec": "^0.1.3",
+ "spec": ">=0.1.3 <0.2.0",
+ "type": "range"
+ },
+ "_requiredBy": [
+ "/center-align",
+ "/right-align"
+ ],
+ "_resolved": "https://registry.npmjs.org/align-text/-/align-text-0.1.4.tgz",
+ "_shasum": "0cd90a561093f35d0a99256c22b7069433fad117",
+ "_shrinkwrap": null,
+ "_spec": "align-text@^0.1.3",
+ "_where": "/home/sources/5.0/crosswalk-tizen/wrt/node_modules/center-align",
+ "author": {
+ "name": "Jon Schlinkert",
+ "url": "https://github.com/jonschlinkert"
+ },
+ "bugs": {
+ "url": "https://github.com/jonschlinkert/align-text/issues"
+ },
+ "dependencies": {
+ "kind-of": "^3.0.2",
+ "longest": "^1.0.1",
+ "repeat-string": "^1.5.2"
+ },
+ "description": "Align the text in a string.",
+ "devDependencies": {
+ "mocha": "*",
+ "should": "*",
+ "word-wrap": "^1.0.3"
+ },
+ "directories": {},
+ "dist": {
+ "shasum": "0cd90a561093f35d0a99256c22b7069433fad117",
+ "tarball": "https://registry.npmjs.org/align-text/-/align-text-0.1.4.tgz"
+ },
+ "engines": {
+ "node": ">=0.10.0"
+ },
+ "files": [
+ "index.js"
+ ],
+ "gitHead": "7f08e823a54c6bda319d875895813537a66a4c5e",
+ "homepage": "https://github.com/jonschlinkert/align-text",
+ "keywords": [
+ "align",
+ "align-center",
+ "alignment",
+ "center",
+ "center-align",
+ "indent",
+ "pad",
+ "padding",
+ "right",
+ "right-align",
+ "text",
+ "typography"
+ ],
+ "license": "MIT",
+ "main": "index.js",
+ "maintainers": [
+ {
+ "name": "jonschlinkert",
+ "email": "github@sellside.com"
+ },
+ {
+ "name": "shinnn",
+ "email": "snnskwtnb@gmail.com"
+ }
+ ],
+ "name": "align-text",
+ "optionalDependencies": {},
+ "readme": "ERROR: No README data found!",
+ "repository": {
+ "type": "git",
+ "url": "git://github.com/jonschlinkert/align-text.git"
+ },
+ "scripts": {
+ "test": "mocha"
+ },
+ "version": "0.1.4"
+}
--- /dev/null
+'use strict';
+module.exports = function () {
+ var str = [].map.call(arguments, function (str) {
+ return str.trim();
+ }).filter(function (str) {
+ return str.length;
+ }).join('-');
+
+ if (!str.length) {
+ return '';
+ }
+
+ if (str.length === 1 || !(/[_.\- ]+/).test(str) ) {
+ if (str[0] === str[0].toLowerCase() && str.slice(1) !== str.slice(1).toLowerCase()) {
+ return str;
+ }
+
+ return str.toLowerCase();
+ }
+
+ return str
+ .replace(/^[_.\- ]+/, '')
+ .toLowerCase()
+ .replace(/[_.\- ]+(\w|$)/g, function (m, p1) {
+ return p1.toUpperCase();
+ });
+};
--- /dev/null
+The MIT License (MIT)
+
+Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
+
+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.
--- /dev/null
+{
+ "_args": [
+ [
+ {
+ "raw": "camelcase@^1.0.2",
+ "scope": null,
+ "escapedName": "camelcase",
+ "name": "camelcase",
+ "rawSpec": "^1.0.2",
+ "spec": ">=1.0.2 <2.0.0",
+ "type": "range"
+ },
+ "/home/sources/5.0/crosswalk-tizen/wrt/node_modules/yargs"
+ ]
+ ],
+ "_from": "camelcase@>=1.0.2 <2.0.0",
+ "_id": "camelcase@1.2.1",
+ "_inCache": true,
+ "_location": "/camelcase",
+ "_nodeVersion": "0.12.5",
+ "_npmUser": {
+ "name": "sindresorhus",
+ "email": "sindresorhus@gmail.com"
+ },
+ "_npmVersion": "2.11.2",
+ "_phantomChildren": {},
+ "_requested": {
+ "raw": "camelcase@^1.0.2",
+ "scope": null,
+ "escapedName": "camelcase",
+ "name": "camelcase",
+ "rawSpec": "^1.0.2",
+ "spec": ">=1.0.2 <2.0.0",
+ "type": "range"
+ },
+ "_requiredBy": [
+ "/yargs"
+ ],
+ "_resolved": "https://registry.npmjs.org/camelcase/-/camelcase-1.2.1.tgz",
+ "_shasum": "9bb5304d2e0b56698b2c758b08a3eaa9daa58a39",
+ "_shrinkwrap": null,
+ "_spec": "camelcase@^1.0.2",
+ "_where": "/home/sources/5.0/crosswalk-tizen/wrt/node_modules/yargs",
+ "author": {
+ "name": "Sindre Sorhus",
+ "email": "sindresorhus@gmail.com",
+ "url": "http://sindresorhus.com"
+ },
+ "bugs": {
+ "url": "https://github.com/sindresorhus/camelcase/issues"
+ },
+ "dependencies": {},
+ "description": "Convert a dash/dot/underscore/space separated string to camelCase: foo-bar → fooBar",
+ "devDependencies": {
+ "ava": "0.0.4"
+ },
+ "directories": {},
+ "dist": {
+ "shasum": "9bb5304d2e0b56698b2c758b08a3eaa9daa58a39",
+ "tarball": "https://registry.npmjs.org/camelcase/-/camelcase-1.2.1.tgz"
+ },
+ "engines": {
+ "node": ">=0.10.0"
+ },
+ "files": [
+ "index.js"
+ ],
+ "gitHead": "185ba12da723be9c1ee986cc2956bdc4c517a141",
+ "homepage": "https://github.com/sindresorhus/camelcase",
+ "keywords": [
+ "camelcase",
+ "camel-case",
+ "camel",
+ "case",
+ "dash",
+ "hyphen",
+ "dot",
+ "underscore",
+ "separator",
+ "string",
+ "text",
+ "convert"
+ ],
+ "license": "MIT",
+ "maintainers": [
+ {
+ "name": "sindresorhus",
+ "email": "sindresorhus@gmail.com"
+ }
+ ],
+ "name": "camelcase",
+ "optionalDependencies": {},
+ "readme": "ERROR: No README data found!",
+ "repository": {
+ "type": "git",
+ "url": "git+https://github.com/sindresorhus/camelcase.git"
+ },
+ "scripts": {
+ "test": "node test.js"
+ },
+ "version": "1.2.1"
+}
--- /dev/null
+# camelcase [![Build Status](https://travis-ci.org/sindresorhus/camelcase.svg?branch=master)](https://travis-ci.org/sindresorhus/camelcase)
+
+> Convert a dash/dot/underscore/space separated string to camelCase: `foo-bar` → `fooBar`
+
+
+## Install
+
+```sh
+$ npm install --save camelcase
+```
+
+
+## Usage
+
+```js
+var camelCase = require('camelcase');
+
+camelCase('foo-bar');
+//=> fooBar
+
+camelCase('foo_bar');
+//=> fooBar
+
+camelCase('Foo-Bar');
+//=> fooBar
+
+camelCase('--foo.bar');
+//=> fooBar
+
+camelCase('__foo__bar__');
+//=> fooBar
+
+camelCase('foo bar');
+//=> fooBar
+
+console.log(process.argv[3]);
+//=> --foo-bar
+camelCase(process.argv[3]);
+//=> fooBar
+
+camelCase('foo', 'bar');
+//=> fooBar
+
+camelCase('__foo__', '--bar');
+//=> fooBar
+```
+
+
+## Related
+
+See [`decamelize`](https://github.com/sindresorhus/decamelize) for the inverse.
+
+
+## License
+
+MIT © [Sindre Sorhus](http://sindresorhus.com)
--- /dev/null
+The MIT License (MIT)
+
+Copyright (c) 2015, Jon Schlinkert.
+
+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.
--- /dev/null
+# center-align [![NPM version](https://badge.fury.io/js/center-align.svg)](http://badge.fury.io/js/center-align)
+
+> Center-align the text in a string.
+
+Install with [npm](https://www.npmjs.com/)
+
+```sh
+$ npm i center-align --save
+```
+
+## Usage
+
+```js
+var centerAlign = require('center-align');
+```
+
+**Example**
+
+If used on the following:
+
+```
+Lorem ipsum dolor sit amet,
+consectetur adipiscing
+elit, sed do eiusmod tempor incididunt
+ut labore et dolore
+magna aliqua. Ut enim ad minim
+veniam, quis
+```
+
+The result would be:
+
+```
+ Lorem ipsum dolor sit amet,
+ consectetur adipiscing
+elit, sed do eiusmod tempor incididunt
+ ut labore et dolore
+ magna aliqua. Ut enim ad minim
+ veniam, quis
+```
+
+## Related projects
+
+* [align-text](https://www.npmjs.com/package/align-text): Align the text in a string. | [homepage](https://github.com/jonschlinkert/align-text)
+* [justified](https://www.npmjs.com/package/justified): Wrap words to a specified length and justified the text. | [homepage](https://github.com/jonschlinkert/justified)
+* [right-align](https://www.npmjs.com/package/right-align): Right-align the text in a string. | [homepage](https://github.com/jonschlinkert/right-align)
+* [word-wrap](https://www.npmjs.com/package/word-wrap): Wrap words to a specified length. | [homepage](https://github.com/jonschlinkert/word-wrap)
+
+## Running tests
+
+Install dev dependencies:
+
+```sh
+$ npm i -d && npm test
+```
+
+## Contributing
+
+Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](https://github.com/jonschlinkert/center-align/issues/new).
+
+## Author
+
+**Jon Schlinkert**
+
++ [github/jonschlinkert](https://github.com/jonschlinkert)
++ [twitter/jonschlinkert](http://twitter.com/jonschlinkert)
+
+## License
+
+Copyright © 2015 Jon Schlinkert
+Released under the MIT license.
+
+***
+
+_This file was generated by [verb-cli](https://github.com/assemble/verb-cli) on October 27, 2015._
\ No newline at end of file
--- /dev/null
+/*!
+ * center-align <https://github.com/jonschlinkert/center-align>
+ *
+ * Copycenter (c) 2015, Jon Schlinkert.
+ * Licensed under the MIT License.
+ */
+
+'use strict';
+
+var utils = require('./utils');
+
+module.exports = function centerAlign(val) {
+ return utils.align(val, function (len, longest) {
+ return Math.floor((longest - len) / 2);
+ });
+};
--- /dev/null
+{
+ "_args": [
+ [
+ {
+ "raw": "center-align@^0.1.1",
+ "scope": null,
+ "escapedName": "center-align",
+ "name": "center-align",
+ "rawSpec": "^0.1.1",
+ "spec": ">=0.1.1 <0.2.0",
+ "type": "range"
+ },
+ "/home/sources/5.0/crosswalk-tizen/wrt/node_modules/cliui"
+ ]
+ ],
+ "_from": "center-align@>=0.1.1 <0.2.0",
+ "_id": "center-align@0.1.3",
+ "_inCache": true,
+ "_location": "/center-align",
+ "_nodeVersion": "5.3.0",
+ "_npmOperationalInternal": {
+ "host": "packages-9-west.internal.npmjs.com",
+ "tmp": "tmp/center-align-0.1.3.tgz_1454366538829_0.9471865000668913"
+ },
+ "_npmUser": {
+ "name": "jonschlinkert",
+ "email": "github@sellside.com"
+ },
+ "_npmVersion": "3.3.12",
+ "_phantomChildren": {},
+ "_requested": {
+ "raw": "center-align@^0.1.1",
+ "scope": null,
+ "escapedName": "center-align",
+ "name": "center-align",
+ "rawSpec": "^0.1.1",
+ "spec": ">=0.1.1 <0.2.0",
+ "type": "range"
+ },
+ "_requiredBy": [
+ "/cliui"
+ ],
+ "_resolved": "https://registry.npmjs.org/center-align/-/center-align-0.1.3.tgz",
+ "_shasum": "aa0d32629b6ee972200411cbd4461c907bc2b7ad",
+ "_shrinkwrap": null,
+ "_spec": "center-align@^0.1.1",
+ "_where": "/home/sources/5.0/crosswalk-tizen/wrt/node_modules/cliui",
+ "author": {
+ "name": "Jon Schlinkert",
+ "url": "https://github.com/jonschlinkert"
+ },
+ "bugs": {
+ "url": "https://github.com/jonschlinkert/center-align/issues"
+ },
+ "dependencies": {
+ "align-text": "^0.1.3",
+ "lazy-cache": "^1.0.3"
+ },
+ "description": "Center-align the text in a string.",
+ "devDependencies": {
+ "mocha": "^2.2.0"
+ },
+ "directories": {},
+ "dist": {
+ "shasum": "aa0d32629b6ee972200411cbd4461c907bc2b7ad",
+ "tarball": "https://registry.npmjs.org/center-align/-/center-align-0.1.3.tgz"
+ },
+ "engines": {
+ "node": ">=0.10.0"
+ },
+ "files": [
+ "index.js",
+ "utils.js"
+ ],
+ "gitHead": "5c5fab5012fceaa3e21a00162958c0ed11109419",
+ "homepage": "https://github.com/jonschlinkert/center-align",
+ "keywords": [
+ "align",
+ "align-center",
+ "center",
+ "center-align",
+ "right",
+ "right-align",
+ "text",
+ "typography"
+ ],
+ "license": "MIT",
+ "main": "index.js",
+ "maintainers": [
+ {
+ "name": "doowb",
+ "email": "brian.woodward@gmail.com"
+ },
+ {
+ "name": "jonschlinkert",
+ "email": "github@sellside.com"
+ }
+ ],
+ "name": "center-align",
+ "optionalDependencies": {},
+ "readme": "ERROR: No README data found!",
+ "repository": {
+ "type": "git",
+ "url": "git+https://github.com/jonschlinkert/center-align.git"
+ },
+ "scripts": {
+ "test": "mocha"
+ },
+ "verb": {
+ "related": {
+ "description": "",
+ "list": [
+ "align-text",
+ "right-align",
+ "justified",
+ "word-wrap"
+ ]
+ }
+ },
+ "version": "0.1.3"
+}
--- /dev/null
+'use strict';
+
+/**
+ * Lazily-required module dependencies (makes the application
+ * faster)
+ */
+
+var utils = require('lazy-cache')(require);
+
+/**
+ * Temporarily re-assign `require` to trick browserify and
+ * webpack into reconizing lazy dependencies.
+ *
+ * This tiny bit of ugliness has the huge dual advantage of
+ * only loading modules that are actually called at some
+ * point in the lifecycle of the application, whilst also
+ * allowing browserify and webpack to find modules that
+ * are depended on but never actually called.
+ */
+
+var fn = require;
+require = utils;
+
+/**
+ * Lazily required module dependencies
+ */
+
+require('align-text', 'align');
+
+/**
+ * Restore `require`
+ */
+
+require = fn;
+
+/**
+ * Expose `utils` modules
+ */
+
+module.exports = utils;
--- /dev/null
+repo_token: NiRhyj91Z2vtgob6XdEAqs83rzNnbMZUu
--- /dev/null
+.DS_Store
+node_modules
--- /dev/null
+language: node_js
+node_js:
+ - "0.10"
+ - "0.11"
+ - "0.12"
+ - "iojs"
+after_script: "NODE_ENV=test YOURPACKAGE_COVERAGE=1 ./node_modules/.bin/mocha --require patched-blanket --reporter mocha-lcov-reporter | ./node_modules/coveralls/bin/coveralls.js"
--- /dev/null
+Copyright (c) 2015, Contributors
+
+Permission to use, copy, modify, and/or distribute this software
+for any purpose with or without fee is hereby granted, provided
+that the above copyright notice and this permission notice
+appear in all copies.
+
+THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
+OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE
+LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES
+OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
+ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
--- /dev/null
+# cliui
+
+[![Build Status](https://travis-ci.org/bcoe/cliui.png)](https://travis-ci.org/bcoe/cliui)
+[![Coverage Status](https://coveralls.io/repos/bcoe/cliui/badge.svg?branch=)](https://coveralls.io/r/bcoe/cliui?branch=)
+[![NPM version](https://img.shields.io/npm/v/cliui.svg)](https://www.npmjs.com/package/cliui)
+
+easily create complex multi-column command-line-interfaces.
+
+## Example
+
+```js
+var ui = require('cliui')({
+ width: 80
+})
+
+ui.div('Usage: $0 [command] [options]')
+
+ui.div({
+ text: 'Options:',
+ padding: [2, 0, 2, 0]
+})
+
+ui.div(
+ {
+ text: "-f, --file",
+ width: 40,
+ padding: [0, 4, 0, 4]
+ },
+ {
+ text: "the file to load",
+ width: 25
+ },
+ {
+ text: "[required]",
+ align: 'right'
+ }
+)
+
+console.log(ui.toString())
+```
+
+## Layout DSL
+
+cliui exposes a simple layout DSL:
+
+If you create a single `ui.row`, passing a string rather than an
+object:
+
+* `\n`: characters will be interpreted as new rows.
+* `\t`: characters will be interpreted as new columns.
+* ` `: characters will be interpreted as padding.
+
+**as an example...**
+
+```js
+var ui = require('./')({
+ width: 60
+})
+
+ui.div(
+ 'Usage: node ./bin/foo.js\n' +
+ ' <regex>\t provide a regex\n' +
+ ' <glob>\t provide a glob\t [required]'
+)
+
+console.log(ui.toString())
+```
+
+**will output:**
+
+```shell
+Usage: node ./bin/foo.js
+ <regex> provide a regex
+ <glob> provide a glob [required]
+```
+
+## Methods
+
+```js
+cliui = require('cliui')
+```
+
+### cliui({width: integer})
+
+Specify the maximum width of the UI being generated.
+
+### cliui({wrap: boolean})
+
+Enable or disable the wrapping of text in a column.
+
+### cliui.div(column, column, column)
+
+Create a row with any number of columns, a column
+can either be a string, or an object with the following
+options:
+
+* **width:** the width of a column.
+* **align:** alignment, `right` or `center`.
+* **padding:** `[top, right, bottom, left]`.
+
+### cliui.span(column, column, column)
+
+Similar to `div`, except the next row will be appended without
+a new line being created.
--- /dev/null
+var wrap = require('wordwrap'),
+ align = {
+ right: require('right-align'),
+ center: require('center-align')
+ },
+ top = 0,
+ right = 1,
+ bottom = 2,
+ left = 3
+
+function UI (opts) {
+ this.width = opts.width
+ this.wrap = opts.wrap
+ this.rows = []
+}
+
+UI.prototype.span = function () {
+ var cols = this.div.apply(this, arguments)
+ cols.span = true
+}
+
+UI.prototype.div = function () {
+ if (arguments.length === 0) this.div('')
+ if (this.wrap && this._shouldApplyLayoutDSL.apply(this, arguments)) {
+ return this._applyLayoutDSL(arguments[0])
+ }
+
+ var cols = []
+
+ for (var i = 0, arg; (arg = arguments[i]) !== undefined; i++) {
+ if (typeof arg === 'string') cols.push(this._colFromString(arg))
+ else cols.push(arg)
+ }
+
+ this.rows.push(cols)
+ return cols
+}
+
+UI.prototype._shouldApplyLayoutDSL = function () {
+ return arguments.length === 1 && typeof arguments[0] === 'string' &&
+ /[\t\n]/.test(arguments[0])
+}
+
+UI.prototype._applyLayoutDSL = function (str) {
+ var _this = this,
+ rows = str.split('\n'),
+ leftColumnWidth = 0
+
+ // simple heuristic for layout, make sure the
+ // second column lines up along the left-hand.
+ // don't allow the first column to take up more
+ // than 50% of the screen.
+ rows.forEach(function (row) {
+ var columns = row.split('\t')
+ if (columns.length > 1 && columns[0].length > leftColumnWidth) {
+ leftColumnWidth = Math.min(
+ Math.floor(_this.width * 0.5),
+ columns[0].length
+ )
+ }
+ })
+
+ // generate a table:
+ // replacing ' ' with padding calculations.
+ // using the algorithmically generated width.
+ rows.forEach(function (row) {
+ var columns = row.split('\t')
+ _this.div.apply(_this, columns.map(function (r, i) {
+ return {
+ text: r.trim(),
+ padding: [0, r.match(/\s*$/)[0].length, 0, r.match(/^\s*/)[0].length],
+ width: (i === 0 && columns.length > 1) ? leftColumnWidth : undefined
+ }
+ }))
+ })
+
+ return this.rows[this.rows.length - 1]
+}
+
+UI.prototype._colFromString = function (str) {
+ return {
+ text: str
+ }
+}
+
+UI.prototype.toString = function () {
+ var _this = this,
+ lines = []
+
+ _this.rows.forEach(function (row, i) {
+ _this.rowToString(row, lines)
+ })
+
+ // don't display any lines with the
+ // hidden flag set.
+ lines = lines.filter(function (line) {
+ return !line.hidden
+ })
+
+ return lines.map(function (line) {
+ return line.text
+ }).join('\n')
+}
+
+UI.prototype.rowToString = function (row, lines) {
+ var _this = this,
+ paddingLeft,
+ rrows = this._rasterize(row),
+ str = '',
+ ts,
+ width,
+ wrapWidth
+
+ rrows.forEach(function (rrow, r) {
+ str = ''
+ rrow.forEach(function (col, c) {
+ ts = '' // temporary string used during alignment/padding.
+ width = row[c].width // the width with padding.
+ wrapWidth = _this._negatePadding(row[c]) // the width without padding.
+
+ for (var i = 0; i < Math.max(wrapWidth, col.length); i++) {
+ ts += col.charAt(i) || ' '
+ }
+
+ // align the string within its column.
+ if (row[c].align && row[c].align !== 'left' && _this.wrap) {
+ ts = align[row[c].align](ts.trim() + '\n' + new Array(wrapWidth + 1).join(' '))
+ .split('\n')[0]
+ if (ts.length < wrapWidth) ts += new Array(width - ts.length).join(' ')
+ }
+
+ // add left/right padding and print string.
+ paddingLeft = (row[c].padding || [0, 0, 0, 0])[left]
+ if (paddingLeft) str += new Array(row[c].padding[left] + 1).join(' ')
+ str += ts
+ if (row[c].padding && row[c].padding[right]) str += new Array(row[c].padding[right] + 1).join(' ')
+
+ // if prior row is span, try to render the
+ // current row on the prior line.
+ if (r === 0 && lines.length > 0) {
+ str = _this._renderInline(str, lines[lines.length - 1], paddingLeft)
+ }
+ })
+
+ // remove trailing whitespace.
+ lines.push({
+ text: str.replace(/ +$/, ''),
+ span: row.span
+ })
+ })
+
+ return lines
+}
+
+// if the full 'source' can render in
+// the target line, do so.
+UI.prototype._renderInline = function (source, previousLine, paddingLeft) {
+ var target = previousLine.text,
+ str = ''
+
+ if (!previousLine.span) return source
+
+ // if we're not applying wrapping logic,
+ // just always append to the span.
+ if (!this.wrap) {
+ previousLine.hidden = true
+ return target + source
+ }
+
+ for (var i = 0, tc, sc; i < Math.max(source.length, target.length); i++) {
+ tc = target.charAt(i) || ' '
+ sc = source.charAt(i) || ' '
+ // we tried to overwrite a character in the other string.
+ if (tc !== ' ' && sc !== ' ') return source
+ // there is not enough whitespace to maintain padding.
+ if (sc !== ' ' && i < paddingLeft + target.length) return source
+ // :thumbsup:
+ if (tc === ' ') str += sc
+ else str += tc
+ }
+
+ previousLine.hidden = true
+
+ return str
+}
+
+UI.prototype._rasterize = function (row) {
+ var _this = this,
+ i,
+ rrow,
+ rrows = [],
+ widths = this._columnWidths(row),
+ wrapped
+
+ // word wrap all columns, and create
+ // a data-structure that is easy to rasterize.
+ row.forEach(function (col, c) {
+ // leave room for left and right padding.
+ col.width = widths[c]
+ if (_this.wrap) wrapped = wrap.hard(_this._negatePadding(col))(col.text).split('\n')
+ else wrapped = col.text.split('\n')
+
+ // add top and bottom padding.
+ if (col.padding) {
+ for (i = 0; i < (col.padding[top] || 0); i++) wrapped.unshift('')
+ for (i = 0; i < (col.padding[bottom] || 0); i++) wrapped.push('')
+ }
+
+ wrapped.forEach(function (str, r) {
+ if (!rrows[r]) rrows.push([])
+
+ rrow = rrows[r]
+
+ for (var i = 0; i < c; i++) {
+ if (rrow[i] === undefined) rrow.push('')
+ }
+ rrow.push(str)
+ })
+ })
+
+ return rrows
+}
+
+UI.prototype._negatePadding = function (col) {
+ var wrapWidth = col.width
+ if (col.padding) wrapWidth -= (col.padding[left] || 0) + (col.padding[right] || 0)
+ return wrapWidth
+}
+
+UI.prototype._columnWidths = function (row) {
+ var _this = this,
+ widths = [],
+ unset = row.length,
+ unsetWidth,
+ remainingWidth = this.width
+
+ // column widths can be set in config.
+ row.forEach(function (col, i) {
+ if (col.width) {
+ unset--
+ widths[i] = col.width
+ remainingWidth -= col.width
+ } else {
+ widths[i] = undefined
+ }
+ })
+
+ // any unset widths should be calculated.
+ if (unset) unsetWidth = Math.floor(remainingWidth / unset)
+ widths.forEach(function (w, i) {
+ if (!_this.wrap) widths[i] = row[i].width || row[i].text.length
+ else if (w === undefined) widths[i] = Math.max(unsetWidth, _minWidth(row[i]))
+ })
+
+ return widths
+}
+
+// calculates the minimum width of
+// a column, based on padding preferences.
+function _minWidth (col) {
+ var padding = col.padding || []
+
+ return 1 + (padding[left] || 0) + (padding[right] || 0)
+}
+
+module.exports = function (opts) {
+ opts = opts || {}
+
+ return new UI({
+ width: (opts || {}).width || 80,
+ wrap: typeof opts.wrap === 'boolean' ? opts.wrap : true
+ })
+}
--- /dev/null
+{
+ "_args": [
+ [
+ {
+ "raw": "cliui@^2.1.0",
+ "scope": null,
+ "escapedName": "cliui",
+ "name": "cliui",
+ "rawSpec": "^2.1.0",
+ "spec": ">=2.1.0 <3.0.0",
+ "type": "range"
+ },
+ "/home/sources/5.0/crosswalk-tizen/wrt/node_modules/yargs"
+ ]
+ ],
+ "_from": "cliui@>=2.1.0 <3.0.0",
+ "_id": "cliui@2.1.0",
+ "_inCache": true,
+ "_location": "/cliui",
+ "_nodeVersion": "0.10.36",
+ "_npmUser": {
+ "name": "bcoe",
+ "email": "ben@npmjs.com"
+ },
+ "_npmVersion": "2.7.5",
+ "_phantomChildren": {},
+ "_requested": {
+ "raw": "cliui@^2.1.0",
+ "scope": null,
+ "escapedName": "cliui",
+ "name": "cliui",
+ "rawSpec": "^2.1.0",
+ "spec": ">=2.1.0 <3.0.0",
+ "type": "range"
+ },
+ "_requiredBy": [
+ "/yargs"
+ ],
+ "_resolved": "https://registry.npmjs.org/cliui/-/cliui-2.1.0.tgz",
+ "_shasum": "4b475760ff80264c762c3a1719032e91c7fea0d1",
+ "_shrinkwrap": null,
+ "_spec": "cliui@^2.1.0",
+ "_where": "/home/sources/5.0/crosswalk-tizen/wrt/node_modules/yargs",
+ "author": {
+ "name": "Ben Coe",
+ "email": "ben@npmjs.com"
+ },
+ "bugs": {
+ "url": "https://github.com/bcoe/cliui/issues"
+ },
+ "config": {
+ "blanket": {
+ "pattern": [
+ "index.js"
+ ],
+ "data-cover-never": [
+ "node_modules",
+ "test"
+ ],
+ "output-reporter": "spec"
+ }
+ },
+ "dependencies": {
+ "center-align": "^0.1.1",
+ "right-align": "^0.1.1",
+ "wordwrap": "0.0.2"
+ },
+ "description": "easily create complex multi-column command-line-interfaces",
+ "devDependencies": {
+ "blanket": "^1.1.6",
+ "chai": "^2.2.0",
+ "coveralls": "^2.11.2",
+ "mocha": "^2.2.4",
+ "mocha-lcov-reporter": "0.0.2",
+ "mocoverage": "^1.0.0",
+ "patched-blanket": "^1.0.1",
+ "standard": "^3.6.1"
+ },
+ "directories": {},
+ "dist": {
+ "shasum": "4b475760ff80264c762c3a1719032e91c7fea0d1",
+ "tarball": "https://registry.npmjs.org/cliui/-/cliui-2.1.0.tgz"
+ },
+ "gitHead": "5d6ce466b144db62abefc4b2252c8aa70a741695",
+ "homepage": "https://github.com/bcoe/cliui",
+ "keywords": [
+ "cli",
+ "command-line",
+ "layout",
+ "design",
+ "console",
+ "wrap",
+ "table"
+ ],
+ "license": "ISC",
+ "main": "index.js",
+ "maintainers": [
+ {
+ "name": "bcoe",
+ "email": "ben@npmjs.com"
+ }
+ ],
+ "name": "cliui",
+ "optionalDependencies": {},
+ "readme": "ERROR: No README data found!",
+ "repository": {
+ "type": "git",
+ "url": "git+ssh://git@github.com/bcoe/cliui.git"
+ },
+ "scripts": {
+ "test": "standard && mocha --check-leaks --ui exports --require patched-blanket -R mocoverage"
+ },
+ "standard": {
+ "ignore": [
+ "**/example/**"
+ ],
+ "globals": [
+ "it"
+ ]
+ },
+ "version": "2.1.0"
+}
--- /dev/null
+/* global describe, it */
+
+require('chai').should()
+
+var cliui = require('../')
+
+describe('cliui', function () {
+ describe('div', function () {
+ it("wraps text at 'width' if a single column is given", function () {
+ var ui = cliui({
+ width: 10
+ })
+
+ ui.div('i am a string that should be wrapped')
+
+ ui.toString().split('\n').forEach(function (row) {
+ row.length.should.be.lte(10)
+ })
+ })
+
+ it('evenly divides text across columns if multiple columns are given', function () {
+ var ui = cliui({
+ width: 40
+ })
+
+ ui.div(
+ {text: 'i am a string that should be wrapped', width: 15},
+ 'i am a second string that should be wrapped',
+ 'i am a third string that should be wrapped'
+ )
+
+ // total width of all columns is <=
+ // the width cliui is initialized with.
+ ui.toString().split('\n').forEach(function (row) {
+ row.length.should.be.lte(40)
+ })
+
+ // it should wrap each column appropriately.
+ var expected = [
+ 'i am a string i am a i am a third',
+ 'that should be second string that',
+ 'wrapped string that should be',
+ ' should be wrapped',
+ ' wrapped'
+ ]
+
+ ui.toString().split('\n').should.eql(expected)
+ })
+
+ it('allows for a blank row to be appended', function () {
+ var ui = cliui({
+ width: 40
+ })
+
+ ui.div()
+
+ // it should wrap each column appropriately.
+ var expected = ['']
+
+ ui.toString().split('\n').should.eql(expected)
+ })
+ })
+
+ describe('_columnWidths', function () {
+ it('uses same width for each column by default', function () {
+ var ui = cliui({
+ width: 40
+ }),
+ widths = ui._columnWidths([{}, {}, {}])
+
+ widths[0].should.equal(13)
+ widths[1].should.equal(13)
+ widths[2].should.equal(13)
+ })
+
+ it('divides width over remaining columns if first column has width specified', function () {
+ var ui = cliui({
+ width: 40
+ }),
+ widths = ui._columnWidths([{width: 20}, {}, {}])
+
+ widths[0].should.equal(20)
+ widths[1].should.equal(10)
+ widths[2].should.equal(10)
+ })
+
+ it('divides width over remaining columns if middle column has width specified', function () {
+ var ui = cliui({
+ width: 40
+ }),
+ widths = ui._columnWidths([{}, {width: 10}, {}])
+
+ widths[0].should.equal(15)
+ widths[1].should.equal(10)
+ widths[2].should.equal(15)
+ })
+
+ it('keeps track of remaining width if multiple columns have width specified', function () {
+ var ui = cliui({
+ width: 40
+ }),
+ widths = ui._columnWidths([{width: 20}, {width: 12}, {}])
+
+ widths[0].should.equal(20)
+ widths[1].should.equal(12)
+ widths[2].should.equal(8)
+ })
+
+ it('uses a sane default if impossible widths are specified', function () {
+ var ui = cliui({
+ width: 40
+ }),
+ widths = ui._columnWidths([{width: 30}, {width: 30}, {padding: [0, 2, 0, 1]}])
+
+ widths[0].should.equal(30)
+ widths[1].should.equal(30)
+ widths[2].should.equal(4)
+ })
+ })
+
+ describe('alignment', function () {
+ it('allows a column to be right aligned', function () {
+ var ui = cliui({
+ width: 40
+ })
+
+ ui.div(
+ 'i am a string',
+ {text: 'i am a second string', align: 'right'},
+ 'i am a third string that should be wrapped'
+ )
+
+ // it should right-align the second column.
+ var expected = [
+ 'i am a stringi am a secondi am a third',
+ ' stringstring that',
+ ' should be',
+ ' wrapped'
+ ]
+
+ ui.toString().split('\n').should.eql(expected)
+ })
+
+ it('allows a column to be center aligned', function () {
+ var ui = cliui({
+ width: 60
+ })
+
+ ui.div(
+ 'i am a string',
+ {text: 'i am a second string', align: 'center', padding: [0, 2, 0, 2]},
+ 'i am a third string that should be wrapped'
+ )
+
+ // it should right-align the second column.
+ var expected = [
+ 'i am a string i am a second i am a third string',
+ ' string that should be',
+ ' wrapped'
+ ]
+
+ ui.toString().split('\n').should.eql(expected)
+ })
+ })
+
+ describe('padding', function () {
+ it('handles left/right padding', function () {
+ var ui = cliui({
+ width: 40
+ })
+
+ ui.div(
+ {text: 'i have padding on my left', padding: [0, 0, 0, 4]},
+ {text: 'i have padding on my right', padding: [0, 2, 0, 0], align: 'center'},
+ {text: 'i have no padding', padding: [0, 0, 0, 0]}
+ )
+
+ // it should add left/right padding to columns.
+ var expected = [
+ ' i have i have i have no',
+ ' padding padding on padding',
+ ' on my my right',
+ ' left'
+ ]
+
+ ui.toString().split('\n').should.eql(expected)
+ })
+
+ it('handles top/bottom padding', function () {
+ var ui = cliui({
+ width: 40
+ })
+
+ ui.div(
+ 'i am a string',
+ {text: 'i am a second string', padding: [2, 0, 0, 0]},
+ {text: 'i am a third string that should be wrapped', padding: [0, 0, 1, 0]}
+ )
+
+ // it should add top/bottom padding to second
+ // and third columns.
+ var expected = [
+ 'i am a string i am a third',
+ ' string that',
+ ' i am a secondshould be',
+ ' string wrapped',
+ ''
+ ]
+
+ ui.toString().split('\n').should.eql(expected)
+ })
+ })
+
+ describe('wrap', function () {
+ it('allows wordwrap to be disabled', function () {
+ var ui = cliui({
+ wrap: false
+ })
+
+ ui.div(
+ {text: 'i am a string', padding: [0, 1, 0, 0]},
+ {text: 'i am a second string', padding: [0, 2, 0, 0]},
+ {text: 'i am a third string that should not be wrapped', padding: [0, 0, 0, 2]}
+ )
+
+ ui.toString().should.equal('i am a string i am a second string i am a third string that should not be wrapped')
+ })
+ })
+
+ describe('span', function () {
+ it('appends the next row to the end of the prior row if it fits', function () {
+ var ui = cliui({
+ width: 40
+ })
+
+ ui.span(
+ {text: 'i am a string that will be wrapped', width: 30}
+ )
+
+ ui.div(
+ {text: ' [required] [default: 99]', align: 'right'}
+ )
+
+ var expected = [
+ 'i am a string that will be',
+ 'wrapped [required] [default: 99]'
+ ]
+
+ ui.toString().split('\n').should.eql(expected)
+ })
+
+ it('does not append the string if it does not fit on the prior row', function () {
+ var ui = cliui({
+ width: 40
+ })
+
+ ui.span(
+ {text: 'i am a string that will be wrapped', width: 30}
+ )
+
+ ui.div(
+ {text: 'i am a second row', align: 'left'}
+ )
+
+ var expected = [
+ 'i am a string that will be',
+ 'wrapped',
+ 'i am a second row'
+ ]
+
+ ui.toString().split('\n').should.eql(expected)
+ })
+
+ it('always appends text to prior span if wrap is disabled', function () {
+ var ui = cliui({
+ wrap: false,
+ width: 40
+ })
+
+ ui.span(
+ {text: 'i am a string that will be wrapped', width: 30}
+ )
+
+ ui.div(
+ {text: 'i am a second row', align: 'left', padding: [0, 0, 0, 3]}
+ )
+
+ ui.div('a third line')
+
+ var expected = [
+ 'i am a string that will be wrapped i am a second row',
+ 'a third line'
+ ]
+
+ ui.toString().split('\n').should.eql(expected)
+ })
+ })
+
+ describe('layoutDSL', function () {
+ it('turns tab into multiple columns', function () {
+ var ui = cliui({
+ width: 60
+ })
+
+ ui.div(
+ ' <regex> \tmy awesome regex\n <my second thing> \tanother row\t a third column'
+ )
+
+ var expected = [
+ ' <regex> my awesome regex',
+ ' <my second thing> another row a third column'
+ ]
+
+ ui.toString().split('\n').should.eql(expected)
+ })
+
+ it('turns newline into multiple rows', function () {
+ var ui = cliui({
+ width: 40
+ })
+
+ ui.div(
+ 'Usage: $0\n <regex>\t my awesome regex\n <glob>\t my awesome glob\t [required]'
+ )
+ var expected = [
+ 'Usage: $0',
+ ' <regex> my awesome regex',
+ ' <glob> my awesome [required]',
+ ' glob'
+ ]
+
+ ui.toString().split('\n').should.eql(expected)
+ })
+
+ it('does not apply DSL if wrap is false', function () {
+ var ui = cliui({
+ width: 40,
+ wrap: false
+ })
+
+ ui.div(
+ 'Usage: $0\ttwo\tthree'
+ )
+
+ ui.toString().should.eql('Usage: $0\ttwo\tthree')
+ })
+
+ })
+})
--- /dev/null
+repo_token: SIAeZjKYlHK74rbcFvNHMUzjRiMpflxve
--- /dev/null
+{
+ "env": {
+ "browser": true,
+ "node": true
+ },
+ "globals": {
+ "chrome": true
+ },
+ "rules": {
+ "no-console": 0,
+ "no-empty": [1, { "allowEmptyCatch": true }]
+ },
+ "extends": "eslint:recommended"
+}
--- /dev/null
+support
+test
+examples
+example
+*.sock
+dist
+yarn.lock
+coverage
+bower.json
--- /dev/null
+sudo: false
+
+language: node_js
+
+node_js:
+ - "4"
+ - "6"
+ - "8"
+
+install:
+ - make install
+
+script:
+ - make lint
+ - make test
+
+matrix:
+ include:
+ - node_js: '8'
+ env: BROWSER=1
--- /dev/null
+
+3.0.1 / 2017-08-24
+==================
+
+ * Fix: Disable colors in Edge and Internet Explorer (#489)
+
+3.0.0 / 2017-08-08
+==================
+
+ * Breaking: Remove DEBUG_FD (#406)
+ * Breaking: Use `Date#toISOString()` instead to `Date#toUTCString()` when output is not a TTY (#418)
+ * Breaking: Make millisecond timer namespace specific and allow 'always enabled' output (#408)
+ * Addition: document `enabled` flag (#465)
+ * Addition: add 256 colors mode (#481)
+ * Addition: `enabled()` updates existing debug instances, add `destroy()` function (#440)
+ * Update: component: update "ms" to v2.0.0
+ * Update: separate the Node and Browser tests in Travis-CI
+ * Update: refactor Readme, fixed documentation, added "Namespace Colors" section, redid screenshots
+ * Update: separate Node.js and web browser examples for organization
+ * Update: update "browserify" to v14.4.0
+ * Fix: fix Readme typo (#473)
+
+2.6.8 / 2017-05-18
+==================
+
+ * Fix: Check for undefined on browser globals (#462, @marbemac)
+
+2.6.7 / 2017-05-16
+==================
+
+ * Fix: Update ms to 2.0.0 to fix regular expression denial of service vulnerability (#458, @hubdotcom)
+ * Fix: Inline extend function in node implementation (#452, @dougwilson)
+ * Docs: Fix typo (#455, @msasad)
+
+2.6.5 / 2017-04-27
+==================
+
+ * Fix: null reference check on window.documentElement.style.WebkitAppearance (#447, @thebigredgeek)
+ * Misc: clean up browser reference checks (#447, @thebigredgeek)
+ * Misc: add npm-debug.log to .gitignore (@thebigredgeek)
+
+
+2.6.4 / 2017-04-20
+==================
+
+ * Fix: bug that would occure if process.env.DEBUG is a non-string value. (#444, @LucianBuzzo)
+ * Chore: ignore bower.json in npm installations. (#437, @joaovieira)
+ * Misc: update "ms" to v0.7.3 (@tootallnate)
+
+2.6.3 / 2017-03-13
+==================
+
+ * Fix: Electron reference to `process.env.DEBUG` (#431, @paulcbetts)
+ * Docs: Changelog fix (@thebigredgeek)
+
+2.6.2 / 2017-03-10
+==================
+
+ * Fix: DEBUG_MAX_ARRAY_LENGTH (#420, @slavaGanzin)
+ * Docs: Add backers and sponsors from Open Collective (#422, @piamancini)
+ * Docs: Add Slackin invite badge (@tootallnate)
+
+2.6.1 / 2017-02-10
+==================
+
+ * Fix: Module's `export default` syntax fix for IE8 `Expected identifier` error
+ * Fix: Whitelist DEBUG_FD for values 1 and 2 only (#415, @pi0)
+ * Fix: IE8 "Expected identifier" error (#414, @vgoma)
+ * Fix: Namespaces would not disable once enabled (#409, @musikov)
+
+2.6.0 / 2016-12-28
+==================
+
+ * Fix: added better null pointer checks for browser useColors (@thebigredgeek)
+ * Improvement: removed explicit `window.debug` export (#404, @tootallnate)
+ * Improvement: deprecated `DEBUG_FD` environment variable (#405, @tootallnate)
+
+2.5.2 / 2016-12-25
+==================
+
+ * Fix: reference error on window within webworkers (#393, @KlausTrainer)
+ * Docs: fixed README typo (#391, @lurch)
+ * Docs: added notice about v3 api discussion (@thebigredgeek)
+
+2.5.1 / 2016-12-20
+==================
+
+ * Fix: babel-core compatibility
+
+2.5.0 / 2016-12-20
+==================
+
+ * Fix: wrong reference in bower file (@thebigredgeek)
+ * Fix: webworker compatibility (@thebigredgeek)
+ * Fix: output formatting issue (#388, @kribblo)
+ * Fix: babel-loader compatibility (#383, @escwald)
+ * Misc: removed built asset from repo and publications (@thebigredgeek)
+ * Misc: moved source files to /src (#378, @yamikuronue)
+ * Test: added karma integration and replaced babel with browserify for browser tests (#378, @yamikuronue)
+ * Test: coveralls integration (#378, @yamikuronue)
+ * Docs: simplified language in the opening paragraph (#373, @yamikuronue)
+
+2.4.5 / 2016-12-17
+==================
+
+ * Fix: `navigator` undefined in Rhino (#376, @jochenberger)
+ * Fix: custom log function (#379, @hsiliev)
+ * Improvement: bit of cleanup + linting fixes (@thebigredgeek)
+ * Improvement: rm non-maintainted `dist/` dir (#375, @freewil)
+ * Docs: simplified language in the opening paragraph. (#373, @yamikuronue)
+
+2.4.4 / 2016-12-14
+==================
+
+ * Fix: work around debug being loaded in preload scripts for electron (#368, @paulcbetts)
+
+2.4.3 / 2016-12-14
+==================
+
+ * Fix: navigation.userAgent error for react native (#364, @escwald)
+
+2.4.2 / 2016-12-14
+==================
+
+ * Fix: browser colors (#367, @tootallnate)
+ * Misc: travis ci integration (@thebigredgeek)
+ * Misc: added linting and testing boilerplate with sanity check (@thebigredgeek)
+
+2.4.1 / 2016-12-13
+==================
+
+ * Fix: typo that broke the package (#356)
+
+2.4.0 / 2016-12-13
+==================
+
+ * Fix: bower.json references unbuilt src entry point (#342, @justmatt)
+ * Fix: revert "handle regex special characters" (@tootallnate)
+ * Feature: configurable util.inspect()`options for NodeJS (#327, @tootallnate)
+ * Feature: %O`(big O) pretty-prints objects (#322, @tootallnate)
+ * Improvement: allow colors in workers (#335, @botverse)
+ * Improvement: use same color for same namespace. (#338, @lchenay)
+
+2.3.3 / 2016-11-09
+==================
+
+ * Fix: Catch `JSON.stringify()` errors (#195, Jovan Alleyne)
+ * Fix: Returning `localStorage` saved values (#331, Levi Thomason)
+ * Improvement: Don't create an empty object when no `process` (Nathan Rajlich)
+
+2.3.2 / 2016-11-09
+==================
+
+ * Fix: be super-safe in index.js as well (@TooTallNate)
+ * Fix: should check whether process exists (Tom Newby)
+
+2.3.1 / 2016-11-09
+==================
+
+ * Fix: Added electron compatibility (#324, @paulcbetts)
+ * Improvement: Added performance optimizations (@tootallnate)
+ * Readme: Corrected PowerShell environment variable example (#252, @gimre)
+ * Misc: Removed yarn lock file from source control (#321, @fengmk2)
+
+2.3.0 / 2016-11-07
+==================
+
+ * Fix: Consistent placement of ms diff at end of output (#215, @gorangajic)
+ * Fix: Escaping of regex special characters in namespace strings (#250, @zacronos)
+ * Fix: Fixed bug causing crash on react-native (#282, @vkarpov15)
+ * Feature: Enabled ES6+ compatible import via default export (#212 @bucaran)
+ * Feature: Added %O formatter to reflect Chrome's console.log capability (#279, @oncletom)
+ * Package: Update "ms" to 0.7.2 (#315, @DevSide)
+ * Package: removed superfluous version property from bower.json (#207 @kkirsche)
+ * Readme: fix USE_COLORS to DEBUG_COLORS
+ * Readme: Doc fixes for format string sugar (#269, @mlucool)
+ * Readme: Updated docs for DEBUG_FD and DEBUG_COLORS environment variables (#232, @mattlyons0)
+ * Readme: doc fixes for PowerShell (#271 #243, @exoticknight @unreadable)
+ * Readme: better docs for browser support (#224, @matthewmueller)
+ * Tooling: Added yarn integration for development (#317, @thebigredgeek)
+ * Misc: Renamed History.md to CHANGELOG.md (@thebigredgeek)
+ * Misc: Added license file (#226 #274, @CantemoInternal @sdaitzman)
+ * Misc: Updated contributors (@thebigredgeek)
+
+2.2.0 / 2015-05-09
+==================
+
+ * package: update "ms" to v0.7.1 (#202, @dougwilson)
+ * README: add logging to file example (#193, @DanielOchoa)
+ * README: fixed a typo (#191, @amir-s)
+ * browser: expose `storage` (#190, @stephenmathieson)
+ * Makefile: add a `distclean` target (#189, @stephenmathieson)
+
+2.1.3 / 2015-03-13
+==================
+
+ * Updated stdout/stderr example (#186)
+ * Updated example/stdout.js to match debug current behaviour
+ * Renamed example/stderr.js to stdout.js
+ * Update Readme.md (#184)
+ * replace high intensity foreground color for bold (#182, #183)
+
+2.1.2 / 2015-03-01
+==================
+
+ * dist: recompile
+ * update "ms" to v0.7.0
+ * package: update "browserify" to v9.0.3
+ * component: fix "ms.js" repo location
+ * changed bower package name
+ * updated documentation about using debug in a browser
+ * fix: security error on safari (#167, #168, @yields)
+
+2.1.1 / 2014-12-29
+==================
+
+ * browser: use `typeof` to check for `console` existence
+ * browser: check for `console.log` truthiness (fix IE 8/9)
+ * browser: add support for Chrome apps
+ * Readme: added Windows usage remarks
+ * Add `bower.json` to properly support bower install
+
+2.1.0 / 2014-10-15
+==================
+
+ * node: implement `DEBUG_FD` env variable support
+ * package: update "browserify" to v6.1.0
+ * package: add "license" field to package.json (#135, @panuhorsmalahti)
+
+2.0.0 / 2014-09-01
+==================
+
+ * package: update "browserify" to v5.11.0
+ * node: use stderr rather than stdout for logging (#29, @stephenmathieson)
+
+1.0.4 / 2014-07-15
+==================
+
+ * dist: recompile
+ * example: remove `console.info()` log usage
+ * example: add "Content-Type" UTF-8 header to browser example
+ * browser: place %c marker after the space character
+ * browser: reset the "content" color via `color: inherit`
+ * browser: add colors support for Firefox >= v31
+ * debug: prefer an instance `log()` function over the global one (#119)
+ * Readme: update documentation about styled console logs for FF v31 (#116, @wryk)
+
+1.0.3 / 2014-07-09
+==================
+
+ * Add support for multiple wildcards in namespaces (#122, @seegno)
+ * browser: fix lint
+
+1.0.2 / 2014-06-10
+==================
+
+ * browser: update color palette (#113, @gscottolson)
+ * common: make console logging function configurable (#108, @timoxley)
+ * node: fix %o colors on old node <= 0.8.x
+ * Makefile: find node path using shell/which (#109, @timoxley)
+
+1.0.1 / 2014-06-06
+==================
+
+ * browser: use `removeItem()` to clear localStorage
+ * browser, node: don't set DEBUG if namespaces is undefined (#107, @leedm777)
+ * package: add "contributors" section
+ * node: fix comment typo
+ * README: list authors
+
+1.0.0 / 2014-06-04
+==================
+
+ * make ms diff be global, not be scope
+ * debug: ignore empty strings in enable()
+ * node: make DEBUG_COLORS able to disable coloring
+ * *: export the `colors` array
+ * npmignore: don't publish the `dist` dir
+ * Makefile: refactor to use browserify
+ * package: add "browserify" as a dev dependency
+ * Readme: add Web Inspector Colors section
+ * node: reset terminal color for the debug content
+ * node: map "%o" to `util.inspect()`
+ * browser: map "%j" to `JSON.stringify()`
+ * debug: add custom "formatters"
+ * debug: use "ms" module for humanizing the diff
+ * Readme: add "bash" syntax highlighting
+ * browser: add Firebug color support
+ * browser: add colors for WebKit browsers
+ * node: apply log to `console`
+ * rewrite: abstract common logic for Node & browsers
+ * add .jshintrc file
+
+0.8.1 / 2014-04-14
+==================
+
+ * package: re-add the "component" section
+
+0.8.0 / 2014-03-30
+==================
+
+ * add `enable()` method for nodejs. Closes #27
+ * change from stderr to stdout
+ * remove unnecessary index.js file
+
+0.7.4 / 2013-11-13
+==================
+
+ * remove "browserify" key from package.json (fixes something in browserify)
+
+0.7.3 / 2013-10-30
+==================
+
+ * fix: catch localStorage security error when cookies are blocked (Chrome)
+ * add debug(err) support. Closes #46
+ * add .browser prop to package.json. Closes #42
+
+0.7.2 / 2013-02-06
+==================
+
+ * fix package.json
+ * fix: Mobile Safari (private mode) is broken with debug
+ * fix: Use unicode to send escape character to shell instead of octal to work with strict mode javascript
+
+0.7.1 / 2013-02-05
+==================
+
+ * add repository URL to package.json
+ * add DEBUG_COLORED to force colored output
+ * add browserify support
+ * fix component. Closes #24
+
+0.7.0 / 2012-05-04
+==================
+
+ * Added .component to package.json
+ * Added debug.component.js build
+
+0.6.0 / 2012-03-16
+==================
+
+ * Added support for "-" prefix in DEBUG [Vinay Pulim]
+ * Added `.enabled` flag to the node version [TooTallNate]
+
+0.5.0 / 2012-02-02
+==================
+
+ * Added: humanize diffs. Closes #8
+ * Added `debug.disable()` to the CS variant
+ * Removed padding. Closes #10
+ * Fixed: persist client-side variant again. Closes #9
+
+0.4.0 / 2012-02-01
+==================
+
+ * Added browser variant support for older browsers [TooTallNate]
+ * Added `debug.enable('project:*')` to browser variant [TooTallNate]
+ * Added padding to diff (moved it to the right)
+
+0.3.0 / 2012-01-26
+==================
+
+ * Added millisecond diff when isatty, otherwise UTC string
+
+0.2.0 / 2012-01-22
+==================
+
+ * Added wildcard support
+
+0.1.0 / 2011-12-02
+==================
+
+ * Added: remove colors unless stderr isatty [TooTallNate]
+
+0.0.1 / 2010-01-03
+==================
+
+ * Initial release
--- /dev/null
+(The MIT License)
+
+Copyright (c) 2014 TJ Holowaychuk <tj@vision-media.ca>
+
+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.
+
--- /dev/null
+# get Makefile directory name: http://stackoverflow.com/a/5982798/376773
+THIS_MAKEFILE_PATH:=$(word $(words $(MAKEFILE_LIST)),$(MAKEFILE_LIST))
+THIS_DIR:=$(shell cd $(dir $(THIS_MAKEFILE_PATH));pwd)
+
+# BIN directory
+BIN := $(THIS_DIR)/node_modules/.bin
+
+# Path
+PATH := node_modules/.bin:$(PATH)
+SHELL := /bin/bash
+
+# applications
+NODE ?= $(shell which node)
+YARN ?= $(shell which yarn)
+PKG ?= $(if $(YARN),$(YARN),$(NODE) $(shell which npm))
+BROWSERIFY ?= $(NODE) $(BIN)/browserify
+
+install: node_modules
+
+browser: dist/debug.js
+
+node_modules: package.json
+ @NODE_ENV= $(PKG) install
+ @touch node_modules
+
+dist/debug.js: src/*.js node_modules
+ @mkdir -p dist
+ @$(BROWSERIFY) \
+ --standalone debug \
+ . > dist/debug.js
+
+lint:
+ @eslint *.js src/*.js
+
+test-node:
+ @istanbul cover node_modules/mocha/bin/_mocha -- test/**.js
+ @cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js
+
+test-browser:
+ @$(MAKE) browser
+ @karma start --single-run
+
+test-all:
+ @concurrently \
+ "make test-node" \
+ "make test-browser"
+
+test:
+ @if [ "x$(BROWSER)" = "x" ]; then \
+ $(MAKE) test-node; \
+ else \
+ $(MAKE) test-browser; \
+ fi
+
+clean:
+ rimraf dist coverage
+
+.PHONY: browser install clean lint test test-all test-node test-browser
--- /dev/null
+# debug
+[![Build Status](https://travis-ci.org/visionmedia/debug.svg?branch=master)](https://travis-ci.org/visionmedia/debug) [![Coverage Status](https://coveralls.io/repos/github/visionmedia/debug/badge.svg?branch=master)](https://coveralls.io/github/visionmedia/debug?branch=master) [![Slack](https://visionmedia-community-slackin.now.sh/badge.svg)](https://visionmedia-community-slackin.now.sh/) [![OpenCollective](https://opencollective.com/debug/backers/badge.svg)](#backers)
+[![OpenCollective](https://opencollective.com/debug/sponsors/badge.svg)](#sponsors)
+
+<img width="647" src="https://user-images.githubusercontent.com/71256/29091486-fa38524c-7c37-11e7-895f-e7ec8e1039b6.png">
+
+A tiny JavaScript debugging utility modelled after Node.js core's debugging
+technique. Works in Node.js and web browsers.
+
+## Installation
+
+```bash
+$ npm install debug
+```
+
+## Usage
+
+`debug` exposes a function; simply pass this function the name of your module, and it will return a decorated version of `console.error` for you to pass debug statements to. This will allow you to toggle the debug output for different parts of your module as well as the module as a whole.
+
+Example [_app.js_](./examples/node/app.js):
+
+```js
+var debug = require('debug')('http')
+ , http = require('http')
+ , name = 'My App';
+
+// fake app
+
+debug('booting %o', name);
+
+http.createServer(function(req, res){
+ debug(req.method + ' ' + req.url);
+ res.end('hello\n');
+}).listen(3000, function(){
+ debug('listening');
+});
+
+// fake worker of some kind
+
+require('./worker');
+```
+
+Example [_worker.js_](./examples/node/worker.js):
+
+```js
+var a = require('debug')('worker:a')
+ , b = require('debug')('worker:b');
+
+function work() {
+ a('doing lots of uninteresting work');
+ setTimeout(work, Math.random() * 1000);
+}
+
+work();
+
+function workb() {
+ b('doing some work');
+ setTimeout(workb, Math.random() * 2000);
+}
+
+workb();
+```
+
+The `DEBUG` environment variable is then used to enable these based on space or
+comma-delimited names.
+
+Here are some examples:
+
+<img width="647" alt="screen shot 2017-08-08 at 12 53 04 pm" src="https://user-images.githubusercontent.com/71256/29091703-a6302cdc-7c38-11e7-8304-7c0b3bc600cd.png">
+<img width="647" alt="screen shot 2017-08-08 at 12 53 38 pm" src="https://user-images.githubusercontent.com/71256/29091700-a62a6888-7c38-11e7-800b-db911291ca2b.png">
+<img width="647" alt="screen shot 2017-08-08 at 12 53 25 pm" src="https://user-images.githubusercontent.com/71256/29091701-a62ea114-7c38-11e7-826a-2692bedca740.png">
+
+#### Windows note
+
+On Windows the environment variable is set using the `set` command.
+
+```cmd
+set DEBUG=*,-not_this
+```
+
+Note that PowerShell uses different syntax to set environment variables.
+
+```cmd
+$env:DEBUG = "*,-not_this"
+```
+
+Then, run the program to be debugged as usual.
+
+
+## Namespace Colors
+
+Every debug instance has a color generated for it based on its namespace name.
+This helps when visually parsing the debug output to identify which debug instance
+a debug line belongs to.
+
+#### Node.js
+
+In Node.js, colors are enabled when stderr is a TTY. You also _should_ install
+the [`supports-color`](https://npmjs.org/supports-color) module alongside debug,
+otherwise debug will only use a small handful of basic colors.
+
+<img width="521" src="https://user-images.githubusercontent.com/71256/29092181-47f6a9e6-7c3a-11e7-9a14-1928d8a711cd.png">
+
+#### Web Browser
+
+Colors are also enabled on "Web Inspectors" that understand the `%c` formatting
+option. These are WebKit web inspectors, Firefox ([since version
+31](https://hacks.mozilla.org/2014/05/editable-box-model-multiple-selection-sublime-text-keys-much-more-firefox-developer-tools-episode-31/))
+and the Firebug plugin for Firefox (any version).
+
+<img width="524" src="https://user-images.githubusercontent.com/71256/29092033-b65f9f2e-7c39-11e7-8e32-f6f0d8e865c1.png">
+
+
+## Millisecond diff
+
+When actively developing an application it can be useful to see when the time spent between one `debug()` call and the next. Suppose for example you invoke `debug()` before requesting a resource, and after as well, the "+NNNms" will show you how much time was spent between calls.
+
+<img width="647" src="https://user-images.githubusercontent.com/71256/29091486-fa38524c-7c37-11e7-895f-e7ec8e1039b6.png">
+
+When stdout is not a TTY, `Date#toISOString()` is used, making it more useful for logging the debug information as shown below:
+
+<img width="647" src="https://user-images.githubusercontent.com/71256/29091956-6bd78372-7c39-11e7-8c55-c948396d6edd.png">
+
+
+## Conventions
+
+If you're using this in one or more of your libraries, you _should_ use the name of your library so that developers may toggle debugging as desired without guessing names. If you have more than one debuggers you _should_ prefix them with your library name and use ":" to separate features. For example "bodyParser" from Connect would then be "connect:bodyParser". If you append a "*" to the end of your name, it will always be enabled regardless of the setting of the DEBUG environment variable. You can then use it for normal output as well as debug output.
+
+## Wildcards
+
+The `*` character may be used as a wildcard. Suppose for example your library has
+debuggers named "connect:bodyParser", "connect:compress", "connect:session",
+instead of listing all three with
+`DEBUG=connect:bodyParser,connect:compress,connect:session`, you may simply do
+`DEBUG=connect:*`, or to run everything using this module simply use `DEBUG=*`.
+
+You can also exclude specific debuggers by prefixing them with a "-" character.
+For example, `DEBUG=*,-connect:*` would include all debuggers except those
+starting with "connect:".
+
+## Environment Variables
+
+When running through Node.js, you can set a few environment variables that will
+change the behavior of the debug logging:
+
+| Name | Purpose |
+|-----------|-------------------------------------------------|
+| `DEBUG` | Enables/disables specific debugging namespaces. |
+| `DEBUG_COLORS`| Whether or not to use colors in the debug output. |
+| `DEBUG_DEPTH` | Object inspection depth. |
+| `DEBUG_SHOW_HIDDEN` | Shows hidden properties on inspected objects. |
+
+
+__Note:__ The environment variables beginning with `DEBUG_` end up being
+converted into an Options object that gets used with `%o`/`%O` formatters.
+See the Node.js documentation for
+[`util.inspect()`](https://nodejs.org/api/util.html#util_util_inspect_object_options)
+for the complete list.
+
+## Formatters
+
+Debug uses [printf-style](https://wikipedia.org/wiki/Printf_format_string) formatting.
+Below are the officially supported formatters:
+
+| Formatter | Representation |
+|-----------|----------------|
+| `%O` | Pretty-print an Object on multiple lines. |
+| `%o` | Pretty-print an Object all on a single line. |
+| `%s` | String. |
+| `%d` | Number (both integer and float). |
+| `%j` | JSON. Replaced with the string '[Circular]' if the argument contains circular references. |
+| `%%` | Single percent sign ('%'). This does not consume an argument. |
+
+
+### Custom formatters
+
+You can add custom formatters by extending the `debug.formatters` object.
+For example, if you wanted to add support for rendering a Buffer as hex with
+`%h`, you could do something like:
+
+```js
+const createDebug = require('debug')
+createDebug.formatters.h = (v) => {
+ return v.toString('hex')
+}
+
+// …elsewhere
+const debug = createDebug('foo')
+debug('this is hex: %h', new Buffer('hello world'))
+// foo this is hex: 68656c6c6f20776f726c6421 +0ms
+```
+
+
+## Browser Support
+
+You can build a browser-ready script using [browserify](https://github.com/substack/node-browserify),
+or just use the [browserify-as-a-service](https://wzrd.in/) [build](https://wzrd.in/standalone/debug@latest),
+if you don't want to build it yourself.
+
+Debug's enable state is currently persisted by `localStorage`.
+Consider the situation shown below where you have `worker:a` and `worker:b`,
+and wish to debug both. You can enable this using `localStorage.debug`:
+
+```js
+localStorage.debug = 'worker:*'
+```
+
+And then refresh the page.
+
+```js
+a = debug('worker:a');
+b = debug('worker:b');
+
+setInterval(function(){
+ a('doing some work');
+}, 1000);
+
+setInterval(function(){
+ b('doing some work');
+}, 1200);
+```
+
+
+## Output streams
+
+ By default `debug` will log to stderr, however this can be configured per-namespace by overriding the `log` method:
+
+Example [_stdout.js_](./examples/node/stdout.js):
+
+```js
+var debug = require('debug');
+var error = debug('app:error');
+
+// by default stderr is used
+error('goes to stderr!');
+
+var log = debug('app:log');
+// set this namespace to log via console.log
+log.log = console.log.bind(console); // don't forget to bind to console!
+log('goes to stdout');
+error('still goes to stderr!');
+
+// set all output to go via console.info
+// overrides all per-namespace log settings
+debug.log = console.info.bind(console);
+error('now goes to stdout via console.info');
+log('still goes to stdout, but via console.info now');
+```
+
+## Checking whether a debug target is enabled
+
+After you've created a debug instance, you can determine whether or not it is
+enabled by checking the `enabled` property:
+
+```javascript
+const debug = require('debug')('http');
+
+if (debug.enabled) {
+ // do stuff...
+}
+```
+
+You can also manually toggle this property to force the debug instance to be
+enabled or disabled.
+
+
+## Authors
+
+ - TJ Holowaychuk
+ - Nathan Rajlich
+ - Andrew Rhyne
+
+## Backers
+
+Support us with a monthly donation and help us continue our activities. [[Become a backer](https://opencollective.com/debug#backer)]
+
+<a href="https://opencollective.com/debug/backer/0/website" target="_blank"><img src="https://opencollective.com/debug/backer/0/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/1/website" target="_blank"><img src="https://opencollective.com/debug/backer/1/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/2/website" target="_blank"><img src="https://opencollective.com/debug/backer/2/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/3/website" target="_blank"><img src="https://opencollective.com/debug/backer/3/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/4/website" target="_blank"><img src="https://opencollective.com/debug/backer/4/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/5/website" target="_blank"><img src="https://opencollective.com/debug/backer/5/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/6/website" target="_blank"><img src="https://opencollective.com/debug/backer/6/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/7/website" target="_blank"><img src="https://opencollective.com/debug/backer/7/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/8/website" target="_blank"><img src="https://opencollective.com/debug/backer/8/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/9/website" target="_blank"><img src="https://opencollective.com/debug/backer/9/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/10/website" target="_blank"><img src="https://opencollective.com/debug/backer/10/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/11/website" target="_blank"><img src="https://opencollective.com/debug/backer/11/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/12/website" target="_blank"><img src="https://opencollective.com/debug/backer/12/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/13/website" target="_blank"><img src="https://opencollective.com/debug/backer/13/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/14/website" target="_blank"><img src="https://opencollective.com/debug/backer/14/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/15/website" target="_blank"><img src="https://opencollective.com/debug/backer/15/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/16/website" target="_blank"><img src="https://opencollective.com/debug/backer/16/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/17/website" target="_blank"><img src="https://opencollective.com/debug/backer/17/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/18/website" target="_blank"><img src="https://opencollective.com/debug/backer/18/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/19/website" target="_blank"><img src="https://opencollective.com/debug/backer/19/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/20/website" target="_blank"><img src="https://opencollective.com/debug/backer/20/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/21/website" target="_blank"><img src="https://opencollective.com/debug/backer/21/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/22/website" target="_blank"><img src="https://opencollective.com/debug/backer/22/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/23/website" target="_blank"><img src="https://opencollective.com/debug/backer/23/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/24/website" target="_blank"><img src="https://opencollective.com/debug/backer/24/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/25/website" target="_blank"><img src="https://opencollective.com/debug/backer/25/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/26/website" target="_blank"><img src="https://opencollective.com/debug/backer/26/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/27/website" target="_blank"><img src="https://opencollective.com/debug/backer/27/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/28/website" target="_blank"><img src="https://opencollective.com/debug/backer/28/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/29/website" target="_blank"><img src="https://opencollective.com/debug/backer/29/avatar.svg"></a>
+
+
+## Sponsors
+
+Become a sponsor and get your logo on our README on Github with a link to your site. [[Become a sponsor](https://opencollective.com/debug#sponsor)]
+
+<a href="https://opencollective.com/debug/sponsor/0/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/0/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/1/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/1/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/2/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/2/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/3/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/3/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/4/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/4/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/5/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/5/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/6/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/6/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/7/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/7/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/8/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/8/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/9/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/9/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/10/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/10/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/11/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/11/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/12/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/12/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/13/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/13/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/14/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/14/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/15/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/15/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/16/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/16/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/17/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/17/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/18/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/18/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/19/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/19/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/20/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/20/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/21/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/21/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/22/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/22/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/23/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/23/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/24/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/24/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/25/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/25/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/26/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/26/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/27/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/27/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/28/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/28/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/29/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/29/avatar.svg"></a>
+
+## License
+
+(The MIT License)
+
+Copyright (c) 2014-2017 TJ Holowaychuk <tj@vision-media.ca>
+
+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.
--- /dev/null
+{
+ "name": "debug",
+ "repo": "visionmedia/debug",
+ "description": "small debugging utility",
+ "version": "3.0.1",
+ "keywords": [
+ "debug",
+ "log",
+ "debugger"
+ ],
+ "main": "src/browser.js",
+ "scripts": [
+ "src/browser.js",
+ "src/debug.js"
+ ],
+ "dependencies": {
+ "rauchg/ms.js": "2.0.0"
+ }
+}
--- /dev/null
+// Karma configuration
+// Generated on Fri Dec 16 2016 13:09:51 GMT+0000 (UTC)
+
+module.exports = function(config) {
+ config.set({
+
+ // base path that will be used to resolve all patterns (eg. files, exclude)
+ basePath: '',
+
+
+ // frameworks to use
+ // available frameworks: https://npmjs.org/browse/keyword/karma-adapter
+ frameworks: ['mocha', 'chai', 'sinon'],
+
+
+ // list of files / patterns to load in the browser
+ files: [
+ 'dist/debug.js',
+ 'test/*spec.js'
+ ],
+
+
+ // list of files to exclude
+ exclude: [
+ 'src/node.js'
+ ],
+
+
+ // preprocess matching files before serving them to the browser
+ // available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor
+ preprocessors: {
+ },
+
+ // test results reporter to use
+ // possible values: 'dots', 'progress'
+ // available reporters: https://npmjs.org/browse/keyword/karma-reporter
+ reporters: ['progress'],
+
+
+ // web server port
+ port: 9876,
+
+
+ // enable / disable colors in the output (reporters and logs)
+ colors: true,
+
+
+ // level of logging
+ // possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG
+ logLevel: config.LOG_INFO,
+
+
+ // enable / disable watching file and executing tests whenever any file changes
+ autoWatch: true,
+
+
+ // start these browsers
+ // available browser launchers: https://npmjs.org/browse/keyword/karma-launcher
+ browsers: ['PhantomJS'],
+
+
+ // Continuous Integration mode
+ // if true, Karma captures browsers, runs the tests and exits
+ singleRun: false,
+
+ // Concurrency level
+ // how many browser should be started simultaneous
+ concurrency: Infinity
+ })
+}
--- /dev/null
+module.exports = require('./src/node');
--- /dev/null
+{
+ "_args": [
+ [
+ {
+ "raw": "debug@3.0.1",
+ "scope": null,
+ "escapedName": "debug",
+ "name": "debug",
+ "rawSpec": "3.0.1",
+ "spec": "3.0.1",
+ "type": "version"
+ },
+ "/home/sources/5.0/crosswalk-tizen/wrt"
+ ]
+ ],
+ "_from": "debug@3.0.1",
+ "_id": "debug@3.0.1",
+ "_inCache": true,
+ "_location": "/debug",
+ "_nodeVersion": "8.4.0",
+ "_npmOperationalInternal": {
+ "host": "s3://npm-registry-packages",
+ "tmp": "tmp/debug-3.0.1.tgz_1503603871771_0.21796362148597836"
+ },
+ "_npmUser": {
+ "name": "tootallnate",
+ "email": "nathan@tootallnate.net"
+ },
+ "_npmVersion": "5.3.0",
+ "_phantomChildren": {},
+ "_requested": {
+ "raw": "debug@3.0.1",
+ "scope": null,
+ "escapedName": "debug",
+ "name": "debug",
+ "rawSpec": "3.0.1",
+ "spec": "3.0.1",
+ "type": "version"
+ },
+ "_requiredBy": [
+ "#DEV:/"
+ ],
+ "_resolved": "https://registry.npmjs.org/debug/-/debug-3.0.1.tgz",
+ "_shasum": "0564c612b521dc92d9f2988f0549e34f9c98db64",
+ "_shrinkwrap": null,
+ "_spec": "debug@3.0.1",
+ "_where": "/home/sources/5.0/crosswalk-tizen/wrt",
+ "author": {
+ "name": "TJ Holowaychuk",
+ "email": "tj@vision-media.ca"
+ },
+ "browser": "./src/browser.js",
+ "bugs": {
+ "url": "https://github.com/visionmedia/debug/issues"
+ },
+ "component": {
+ "scripts": {
+ "debug/index.js": "browser.js",
+ "debug/debug.js": "debug.js"
+ }
+ },
+ "contributors": [
+ {
+ "name": "Nathan Rajlich",
+ "email": "nathan@tootallnate.net",
+ "url": "http://n8.io"
+ },
+ {
+ "name": "Andrew Rhyne",
+ "email": "rhyneandrew@gmail.com"
+ }
+ ],
+ "dependencies": {
+ "ms": "2.0.0"
+ },
+ "description": "small debugging utility",
+ "devDependencies": {
+ "browserify": "14.4.0",
+ "chai": "^3.5.0",
+ "concurrently": "^3.1.0",
+ "coveralls": "^2.11.15",
+ "eslint": "^3.12.1",
+ "istanbul": "^0.4.5",
+ "karma": "^1.3.0",
+ "karma-chai": "^0.1.0",
+ "karma-mocha": "^1.3.0",
+ "karma-phantomjs-launcher": "^1.0.2",
+ "karma-sinon": "^1.0.5",
+ "mocha": "^3.2.0",
+ "mocha-lcov-reporter": "^1.2.0",
+ "rimraf": "^2.5.4",
+ "sinon": "^1.17.6",
+ "sinon-chai": "^2.8.0"
+ },
+ "directories": {},
+ "dist": {
+ "integrity": "sha512-6nVc6S36qbt/mutyt+UGMnawAMrPDZUPQjRZI3FS9tCtDRhvxJbK79unYBLPi+z5SLXQ3ftoVBFCblQtNSls8w==",
+ "shasum": "0564c612b521dc92d9f2988f0549e34f9c98db64",
+ "tarball": "https://registry.npmjs.org/debug/-/debug-3.0.1.tgz"
+ },
+ "gitHead": "3e1849d3aaa1b9a325ad6d054acf695fddb4efe9",
+ "homepage": "https://github.com/visionmedia/debug#readme",
+ "keywords": [
+ "debug",
+ "log",
+ "debugger"
+ ],
+ "license": "MIT",
+ "main": "./src/index.js",
+ "maintainers": [
+ {
+ "name": "thebigredgeek",
+ "email": "rhyneandrew@gmail.com"
+ },
+ {
+ "name": "kolban",
+ "email": "kolban1@kolban.com"
+ },
+ {
+ "name": "tootallnate",
+ "email": "nathan@tootallnate.net"
+ },
+ {
+ "name": "tjholowaychuk",
+ "email": "tj@vision-media.ca"
+ }
+ ],
+ "name": "debug",
+ "optionalDependencies": {},
+ "readme": "ERROR: No README data found!",
+ "repository": {
+ "type": "git",
+ "url": "git://github.com/visionmedia/debug.git"
+ },
+ "version": "3.0.1"
+}
--- /dev/null
+/**
+ * This is the web browser implementation of `debug()`.
+ *
+ * Expose `debug()` as the module.
+ */
+
+exports = module.exports = require('./debug');
+exports.log = log;
+exports.formatArgs = formatArgs;
+exports.save = save;
+exports.load = load;
+exports.useColors = useColors;
+exports.storage = 'undefined' != typeof chrome
+ && 'undefined' != typeof chrome.storage
+ ? chrome.storage.local
+ : localstorage();
+
+/**
+ * Colors.
+ */
+
+exports.colors = [
+ '#0000CC', '#0000FF', '#0033CC', '#0033FF', '#0066CC', '#0066FF', '#0099CC',
+ '#0099FF', '#00CC00', '#00CC33', '#00CC66', '#00CC99', '#00CCCC', '#00CCFF',
+ '#3300CC', '#3300FF', '#3333CC', '#3333FF', '#3366CC', '#3366FF', '#3399CC',
+ '#3399FF', '#33CC00', '#33CC33', '#33CC66', '#33CC99', '#33CCCC', '#33CCFF',
+ '#6600CC', '#6600FF', '#6633CC', '#6633FF', '#66CC00', '#66CC33', '#9900CC',
+ '#9900FF', '#9933CC', '#9933FF', '#99CC00', '#99CC33', '#CC0000', '#CC0033',
+ '#CC0066', '#CC0099', '#CC00CC', '#CC00FF', '#CC3300', '#CC3333', '#CC3366',
+ '#CC3399', '#CC33CC', '#CC33FF', '#CC6600', '#CC6633', '#CC9900', '#CC9933',
+ '#CCCC00', '#CCCC33', '#FF0000', '#FF0033', '#FF0066', '#FF0099', '#FF00CC',
+ '#FF00FF', '#FF3300', '#FF3333', '#FF3366', '#FF3399', '#FF33CC', '#FF33FF',
+ '#FF6600', '#FF6633', '#FF9900', '#FF9933', '#FFCC00', '#FFCC33'
+];
+
+/**
+ * Currently only WebKit-based Web Inspectors, Firefox >= v31,
+ * and the Firebug extension (any Firefox version) are known
+ * to support "%c" CSS customizations.
+ *
+ * TODO: add a `localStorage` variable to explicitly enable/disable colors
+ */
+
+function useColors() {
+ // NB: In an Electron preload script, document will be defined but not fully
+ // initialized. Since we know we're in Chrome, we'll just detect this case
+ // explicitly
+ if (typeof window !== 'undefined' && window.process && window.process.type === 'renderer') {
+ return true;
+ }
+
+ // Internet Explorer and Edge do not support colors.
+ if (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) {
+ return false;
+ }
+
+ // is webkit? http://stackoverflow.com/a/16459606/376773
+ // document is undefined in react-native: https://github.com/facebook/react-native/pull/1632
+ return (typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance) ||
+ // is firebug? http://stackoverflow.com/a/398120/376773
+ (typeof window !== 'undefined' && window.console && (window.console.firebug || (window.console.exception && window.console.table))) ||
+ // is firefox >= v31?
+ // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages
+ (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(RegExp.$1, 10) >= 31) ||
+ // double check webkit in userAgent just in case we are in a worker
+ (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/));
+}
+
+/**
+ * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default.
+ */
+
+exports.formatters.j = function(v) {
+ try {
+ return JSON.stringify(v);
+ } catch (err) {
+ return '[UnexpectedJSONParseError]: ' + err.message;
+ }
+};
+
+
+/**
+ * Colorize log arguments if enabled.
+ *
+ * @api public
+ */
+
+function formatArgs(args) {
+ var useColors = this.useColors;
+
+ args[0] = (useColors ? '%c' : '')
+ + this.namespace
+ + (useColors ? ' %c' : ' ')
+ + args[0]
+ + (useColors ? '%c ' : ' ')
+ + '+' + exports.humanize(this.diff);
+
+ if (!useColors) return;
+
+ var c = 'color: ' + this.color;
+ args.splice(1, 0, c, 'color: inherit')
+
+ // the final "%c" is somewhat tricky, because there could be other
+ // arguments passed either before or after the %c, so we need to
+ // figure out the correct index to insert the CSS into
+ var index = 0;
+ var lastC = 0;
+ args[0].replace(/%[a-zA-Z%]/g, function(match) {
+ if ('%%' === match) return;
+ index++;
+ if ('%c' === match) {
+ // we only are interested in the *last* %c
+ // (the user may have provided their own)
+ lastC = index;
+ }
+ });
+
+ args.splice(lastC, 0, c);
+}
+
+/**
+ * Invokes `console.log()` when available.
+ * No-op when `console.log` is not a "function".
+ *
+ * @api public
+ */
+
+function log() {
+ // this hackery is required for IE8/9, where
+ // the `console.log` function doesn't have 'apply'
+ return 'object' === typeof console
+ && console.log
+ && Function.prototype.apply.call(console.log, console, arguments);
+}
+
+/**
+ * Save `namespaces`.
+ *
+ * @param {String} namespaces
+ * @api private
+ */
+
+function save(namespaces) {
+ try {
+ if (null == namespaces) {
+ exports.storage.removeItem('debug');
+ } else {
+ exports.storage.debug = namespaces;
+ }
+ } catch(e) {}
+}
+
+/**
+ * Load `namespaces`.
+ *
+ * @return {String} returns the previously persisted debug modes
+ * @api private
+ */
+
+function load() {
+ var r;
+ try {
+ r = exports.storage.debug;
+ } catch(e) {}
+
+ // If debug isn't set in LS, and we're in Electron, try to load $DEBUG
+ if (!r && typeof process !== 'undefined' && 'env' in process) {
+ r = process.env.DEBUG;
+ }
+
+ return r;
+}
+
+/**
+ * Enable namespaces listed in `localStorage.debug` initially.
+ */
+
+exports.enable(load());
+
+/**
+ * Localstorage attempts to return the localstorage.
+ *
+ * This is necessary because safari throws
+ * when a user disables cookies/localstorage
+ * and you attempt to access it.
+ *
+ * @return {LocalStorage}
+ * @api private
+ */
+
+function localstorage() {
+ try {
+ return window.localStorage;
+ } catch (e) {}
+}
--- /dev/null
+
+/**
+ * This is the common logic for both the Node.js and web browser
+ * implementations of `debug()`.
+ *
+ * Expose `debug()` as the module.
+ */
+
+exports = module.exports = createDebug.debug = createDebug['default'] = createDebug;
+exports.coerce = coerce;
+exports.disable = disable;
+exports.enable = enable;
+exports.enabled = enabled;
+exports.humanize = require('ms');
+
+/**
+ * Active `debug` instances.
+ */
+exports.instances = [];
+
+/**
+ * The currently active debug mode names, and names to skip.
+ */
+
+exports.names = [];
+exports.skips = [];
+
+/**
+ * Map of special "%n" handling functions, for the debug "format" argument.
+ *
+ * Valid key names are a single, lower or upper-case letter, i.e. "n" and "N".
+ */
+
+exports.formatters = {};
+
+/**
+ * Select a color.
+ * @param {String} namespace
+ * @return {Number}
+ * @api private
+ */
+
+function selectColor(namespace) {
+ var hash = 0, i;
+
+ for (i in namespace) {
+ hash = ((hash << 5) - hash) + namespace.charCodeAt(i);
+ hash |= 0; // Convert to 32bit integer
+ }
+
+ return exports.colors[Math.abs(hash) % exports.colors.length];
+}
+
+/**
+ * Create a debugger with the given `namespace`.
+ *
+ * @param {String} namespace
+ * @return {Function}
+ * @api public
+ */
+
+function createDebug(namespace) {
+
+ var prevTime;
+
+ function debug() {
+ // disabled?
+ if (!debug.enabled) return;
+
+ var self = debug;
+
+ // set `diff` timestamp
+ var curr = +new Date();
+ var ms = curr - (prevTime || curr);
+ self.diff = ms;
+ self.prev = prevTime;
+ self.curr = curr;
+ prevTime = curr;
+
+ // turn the `arguments` into a proper Array
+ var args = new Array(arguments.length);
+ for (var i = 0; i < args.length; i++) {
+ args[i] = arguments[i];
+ }
+
+ args[0] = exports.coerce(args[0]);
+
+ if ('string' !== typeof args[0]) {
+ // anything else let's inspect with %O
+ args.unshift('%O');
+ }
+
+ // apply any `formatters` transformations
+ var index = 0;
+ args[0] = args[0].replace(/%([a-zA-Z%])/g, function(match, format) {
+ // if we encounter an escaped % then don't increase the array index
+ if (match === '%%') return match;
+ index++;
+ var formatter = exports.formatters[format];
+ if ('function' === typeof formatter) {
+ var val = args[index];
+ match = formatter.call(self, val);
+
+ // now we need to remove `args[index]` since it's inlined in the `format`
+ args.splice(index, 1);
+ index--;
+ }
+ return match;
+ });
+
+ // apply env-specific formatting (colors, etc.)
+ exports.formatArgs.call(self, args);
+
+ var logFn = debug.log || exports.log || console.log.bind(console);
+ logFn.apply(self, args);
+ }
+
+ debug.namespace = namespace;
+ debug.enabled = exports.enabled(namespace);
+ debug.useColors = exports.useColors();
+ debug.color = selectColor(namespace);
+ debug.destroy = destroy;
+
+ // env-specific initialization logic for debug instances
+ if ('function' === typeof exports.init) {
+ exports.init(debug);
+ }
+
+ exports.instances.push(debug);
+
+ return debug;
+}
+
+function destroy () {
+ var index = exports.instances.indexOf(this);
+ if (index !== -1) {
+ exports.instances.splice(index, 1);
+ return true;
+ } else {
+ return false;
+ }
+}
+
+/**
+ * Enables a debug mode by namespaces. This can include modes
+ * separated by a colon and wildcards.
+ *
+ * @param {String} namespaces
+ * @api public
+ */
+
+function enable(namespaces) {
+ exports.save(namespaces);
+
+ exports.names = [];
+ exports.skips = [];
+
+ var i;
+ var split = (typeof namespaces === 'string' ? namespaces : '').split(/[\s,]+/);
+ var len = split.length;
+
+ for (i = 0; i < len; i++) {
+ if (!split[i]) continue; // ignore empty strings
+ namespaces = split[i].replace(/\*/g, '.*?');
+ if (namespaces[0] === '-') {
+ exports.skips.push(new RegExp('^' + namespaces.substr(1) + '$'));
+ } else {
+ exports.names.push(new RegExp('^' + namespaces + '$'));
+ }
+ }
+
+ for (i = 0; i < exports.instances.length; i++) {
+ var instance = exports.instances[i];
+ instance.enabled = exports.enabled(instance.namespace);
+ }
+}
+
+/**
+ * Disable debug output.
+ *
+ * @api public
+ */
+
+function disable() {
+ exports.enable('');
+}
+
+/**
+ * Returns true if the given mode name is enabled, false otherwise.
+ *
+ * @param {String} name
+ * @return {Boolean}
+ * @api public
+ */
+
+function enabled(name) {
+ if (name[name.length - 1] === '*') {
+ return true;
+ }
+ var i, len;
+ for (i = 0, len = exports.skips.length; i < len; i++) {
+ if (exports.skips[i].test(name)) {
+ return false;
+ }
+ }
+ for (i = 0, len = exports.names.length; i < len; i++) {
+ if (exports.names[i].test(name)) {
+ return true;
+ }
+ }
+ return false;
+}
+
+/**
+ * Coerce `val`.
+ *
+ * @param {Mixed} val
+ * @return {Mixed}
+ * @api private
+ */
+
+function coerce(val) {
+ if (val instanceof Error) return val.stack || val.message;
+ return val;
+}
--- /dev/null
+/**
+ * Detect Electron renderer process, which is node, but we should
+ * treat as a browser.
+ */
+
+if (typeof process !== 'undefined' && process.type === 'renderer') {
+ module.exports = require('./browser.js');
+} else {
+ module.exports = require('./node.js');
+}
--- /dev/null
+/**
+ * Module dependencies.
+ */
+
+var tty = require('tty');
+var util = require('util');
+
+/**
+ * This is the Node.js implementation of `debug()`.
+ *
+ * Expose `debug()` as the module.
+ */
+
+exports = module.exports = require('./debug');
+exports.init = init;
+exports.log = log;
+exports.formatArgs = formatArgs;
+exports.save = save;
+exports.load = load;
+exports.useColors = useColors;
+
+/**
+ * Colors.
+ */
+
+exports.colors = [ 6, 2, 3, 4, 5, 1 ];
+
+try {
+ var supportsColor = require('supports-color');
+ if (supportsColor && supportsColor.level >= 2) {
+ exports.colors = [
+ 20, 21, 26, 27, 32, 33, 38, 39, 40, 41, 42, 43, 44, 45, 56, 57, 62, 63, 68,
+ 69, 74, 75, 76, 77, 78, 79, 80, 81, 92, 93, 98, 99, 112, 113, 128, 129, 134,
+ 135, 148, 149, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171,
+ 172, 173, 178, 179, 184, 185, 196, 197, 198, 199, 200, 201, 202, 203, 204,
+ 205, 206, 207, 208, 209, 214, 215, 220, 221
+ ];
+ }
+} catch (err) {
+ // swallow - we only care if `supports-color` is available; it doesn't have to be.
+}
+
+/**
+ * Build up the default `inspectOpts` object from the environment variables.
+ *
+ * $ DEBUG_COLORS=no DEBUG_DEPTH=10 DEBUG_SHOW_HIDDEN=enabled node script.js
+ */
+
+exports.inspectOpts = Object.keys(process.env).filter(function (key) {
+ return /^debug_/i.test(key);
+}).reduce(function (obj, key) {
+ // camel-case
+ var prop = key
+ .substring(6)
+ .toLowerCase()
+ .replace(/_([a-z])/g, function (_, k) { return k.toUpperCase() });
+
+ // coerce string value into JS value
+ var val = process.env[key];
+ if (/^(yes|on|true|enabled)$/i.test(val)) val = true;
+ else if (/^(no|off|false|disabled)$/i.test(val)) val = false;
+ else if (val === 'null') val = null;
+ else val = Number(val);
+
+ obj[prop] = val;
+ return obj;
+}, {});
+
+/**
+ * Is stdout a TTY? Colored output is enabled when `true`.
+ */
+
+function useColors() {
+ return 'colors' in exports.inspectOpts
+ ? Boolean(exports.inspectOpts.colors)
+ : tty.isatty(process.stderr.fd);
+}
+
+/**
+ * Map %o to `util.inspect()`, all on a single line.
+ */
+
+exports.formatters.o = function(v) {
+ this.inspectOpts.colors = this.useColors;
+ return util.inspect(v, this.inspectOpts)
+ .replace(/\s*\n\s*/g, ' ');
+};
+
+/**
+ * Map %o to `util.inspect()`, allowing multiple lines if needed.
+ */
+
+exports.formatters.O = function(v) {
+ this.inspectOpts.colors = this.useColors;
+ return util.inspect(v, this.inspectOpts);
+};
+
+/**
+ * Adds ANSI color escape codes if enabled.
+ *
+ * @api public
+ */
+
+function formatArgs(args) {
+ var name = this.namespace;
+ var useColors = this.useColors;
+
+ if (useColors) {
+ var c = this.color;
+ var colorCode = '\u001b[3' + (c < 8 ? c : '8;5;' + c);
+ var prefix = ' ' + colorCode + ';1m' + name + ' ' + '\u001b[0m';
+
+ args[0] = prefix + args[0].split('\n').join('\n' + prefix);
+ args.push(colorCode + 'm+' + exports.humanize(this.diff) + '\u001b[0m');
+ } else {
+ args[0] = new Date().toISOString()
+ + ' ' + name + ' ' + args[0];
+ }
+}
+
+/**
+ * Invokes `util.format()` with the specified arguments and writes to stderr.
+ */
+
+function log() {
+ return process.stderr.write(util.format.apply(util, arguments) + '\n');
+}
+
+/**
+ * Save `namespaces`.
+ *
+ * @param {String} namespaces
+ * @api private
+ */
+
+function save(namespaces) {
+ if (null == namespaces) {
+ // If you set a process.env field to null or undefined, it gets cast to the
+ // string 'null' or 'undefined'. Just delete instead.
+ delete process.env.DEBUG;
+ } else {
+ process.env.DEBUG = namespaces;
+ }
+}
+
+/**
+ * Load `namespaces`.
+ *
+ * @return {String} returns the previously persisted debug modes
+ * @api private
+ */
+
+function load() {
+ return process.env.DEBUG;
+}
+
+/**
+ * Init logic for `debug` instances.
+ *
+ * Create a new `inspectOpts` object in case `useColors` is set
+ * differently for a particular `debug` instance.
+ */
+
+function init (debug) {
+ debug.inspectOpts = {};
+
+ var keys = Object.keys(exports.inspectOpts);
+ for (var i = 0; i < keys.length; i++) {
+ debug.inspectOpts[keys[i]] = exports.inspectOpts[keys[i]];
+ }
+}
+
+/**
+ * Enable namespaces listed in `process.env.DEBUG` initially.
+ */
+
+exports.enable(load());
--- /dev/null
+'use strict';
+module.exports = function (str, sep) {
+ if (typeof str !== 'string') {
+ throw new TypeError('Expected a string');
+ }
+
+ sep = typeof sep === 'undefined' ? '_' : sep;
+
+ return str
+ .replace(/([a-z\d])([A-Z])/g, '$1' + sep + '$2')
+ .replace(/([A-Z]+)([A-Z][a-z\d]+)/g, '$1' + sep + '$2')
+ .toLowerCase();
+};
--- /dev/null
+The MIT License (MIT)
+
+Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
+
+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.
--- /dev/null
+{
+ "_args": [
+ [
+ {
+ "raw": "decamelize@^1.0.0",
+ "scope": null,
+ "escapedName": "decamelize",
+ "name": "decamelize",
+ "rawSpec": "^1.0.0",
+ "spec": ">=1.0.0 <2.0.0",
+ "type": "range"
+ },
+ "/home/sources/5.0/crosswalk-tizen/wrt/node_modules/yargs"
+ ]
+ ],
+ "_from": "decamelize@>=1.0.0 <2.0.0",
+ "_id": "decamelize@1.2.0",
+ "_inCache": true,
+ "_location": "/decamelize",
+ "_nodeVersion": "4.3.0",
+ "_npmOperationalInternal": {
+ "host": "packages-12-west.internal.npmjs.com",
+ "tmp": "tmp/decamelize-1.2.0.tgz_1457167749082_0.9810893186368048"
+ },
+ "_npmUser": {
+ "name": "sindresorhus",
+ "email": "sindresorhus@gmail.com"
+ },
+ "_npmVersion": "3.8.0",
+ "_phantomChildren": {},
+ "_requested": {
+ "raw": "decamelize@^1.0.0",
+ "scope": null,
+ "escapedName": "decamelize",
+ "name": "decamelize",
+ "rawSpec": "^1.0.0",
+ "spec": ">=1.0.0 <2.0.0",
+ "type": "range"
+ },
+ "_requiredBy": [
+ "/yargs"
+ ],
+ "_resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz",
+ "_shasum": "f6534d15148269b20352e7bee26f501f9a191290",
+ "_shrinkwrap": null,
+ "_spec": "decamelize@^1.0.0",
+ "_where": "/home/sources/5.0/crosswalk-tizen/wrt/node_modules/yargs",
+ "author": {
+ "name": "Sindre Sorhus",
+ "email": "sindresorhus@gmail.com",
+ "url": "sindresorhus.com"
+ },
+ "bugs": {
+ "url": "https://github.com/sindresorhus/decamelize/issues"
+ },
+ "dependencies": {},
+ "description": "Convert a camelized string into a lowercased one with a custom separator: unicornRainbow → unicorn_rainbow",
+ "devDependencies": {
+ "ava": "*",
+ "xo": "*"
+ },
+ "directories": {},
+ "dist": {
+ "shasum": "f6534d15148269b20352e7bee26f501f9a191290",
+ "tarball": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz"
+ },
+ "engines": {
+ "node": ">=0.10.0"
+ },
+ "files": [
+ "index.js"
+ ],
+ "gitHead": "95980ab6fb44c40eaca7792bdf93aff7c210c805",
+ "homepage": "https://github.com/sindresorhus/decamelize#readme",
+ "keywords": [
+ "decamelize",
+ "decamelcase",
+ "camelcase",
+ "lowercase",
+ "case",
+ "dash",
+ "hyphen",
+ "string",
+ "str",
+ "text",
+ "convert"
+ ],
+ "license": "MIT",
+ "maintainers": [
+ {
+ "name": "sindresorhus",
+ "email": "sindresorhus@gmail.com"
+ }
+ ],
+ "name": "decamelize",
+ "optionalDependencies": {},
+ "readme": "ERROR: No README data found!",
+ "repository": {
+ "type": "git",
+ "url": "git+https://github.com/sindresorhus/decamelize.git"
+ },
+ "scripts": {
+ "test": "xo && ava"
+ },
+ "version": "1.2.0"
+}
--- /dev/null
+# decamelize [![Build Status](https://travis-ci.org/sindresorhus/decamelize.svg?branch=master)](https://travis-ci.org/sindresorhus/decamelize)
+
+> Convert a camelized string into a lowercased one with a custom separator<br>
+> Example: `unicornRainbow` → `unicorn_rainbow`
+
+
+## Install
+
+```
+$ npm install --save decamelize
+```
+
+
+## Usage
+
+```js
+const decamelize = require('decamelize');
+
+decamelize('unicornRainbow');
+//=> 'unicorn_rainbow'
+
+decamelize('unicornRainbow', '-');
+//=> 'unicorn-rainbow'
+```
+
+
+## API
+
+### decamelize(input, [separator])
+
+#### input
+
+Type: `string`
+
+#### separator
+
+Type: `string`<br>
+Default: `_`
+
+
+## Related
+
+See [`camelcase`](https://github.com/sindresorhus/camelcase) for the inverse.
+
+
+## License
+
+MIT © [Sindre Sorhus](https://sindresorhus.com)
--- /dev/null
+The MIT License (MIT)
+
+Copyright (c) Feross Aboukhadijeh
+
+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.
--- /dev/null
+# is-buffer [![travis][travis-image]][travis-url] [![npm][npm-image]][npm-url] [![downloads][downloads-image]][downloads-url] [![javascript style guide][standard-image]][standard-url]
+
+[travis-image]: https://img.shields.io/travis/feross/is-buffer/master.svg
+[travis-url]: https://travis-ci.org/feross/is-buffer
+[npm-image]: https://img.shields.io/npm/v/is-buffer.svg
+[npm-url]: https://npmjs.org/package/is-buffer
+[downloads-image]: https://img.shields.io/npm/dm/is-buffer.svg
+[downloads-url]: https://npmjs.org/package/is-buffer
+[standard-image]: https://img.shields.io/badge/code_style-standard-brightgreen.svg
+[standard-url]: https://standardjs.com
+
+#### Determine if an object is a [`Buffer`](http://nodejs.org/api/buffer.html) (including the [browserify Buffer](https://github.com/feross/buffer))
+
+[![saucelabs][saucelabs-image]][saucelabs-url]
+
+[saucelabs-image]: https://saucelabs.com/browser-matrix/is-buffer.svg
+[saucelabs-url]: https://saucelabs.com/u/is-buffer
+
+## Why not use `Buffer.isBuffer`?
+
+This module lets you check if an object is a `Buffer` without using `Buffer.isBuffer` (which includes the whole [buffer](https://github.com/feross/buffer) module in [browserify](http://browserify.org/)).
+
+It's future-proof and works in node too!
+
+## install
+
+```bash
+npm install is-buffer
+```
+
+## usage
+
+```js
+var isBuffer = require('is-buffer')
+
+isBuffer(new Buffer(4)) // true
+
+isBuffer(undefined) // false
+isBuffer(null) // false
+isBuffer('') // false
+isBuffer(true) // false
+isBuffer(false) // false
+isBuffer(0) // false
+isBuffer(1) // false
+isBuffer(1.0) // false
+isBuffer('string') // false
+isBuffer({}) // false
+isBuffer(function foo () {}) // false
+```
+
+## license
+
+MIT. Copyright (C) [Feross Aboukhadijeh](http://feross.org).
--- /dev/null
+/*!
+ * Determine if an object is a Buffer
+ *
+ * @author Feross Aboukhadijeh <https://feross.org>
+ * @license MIT
+ */
+
+// The _isBuffer check is for Safari 5-7 support, because it's missing
+// Object.prototype.constructor. Remove this eventually
+module.exports = function (obj) {
+ return obj != null && (isBuffer(obj) || isSlowBuffer(obj) || !!obj._isBuffer)
+}
+
+function isBuffer (obj) {
+ return !!obj.constructor && typeof obj.constructor.isBuffer === 'function' && obj.constructor.isBuffer(obj)
+}
+
+// For Node v0.10 support. Remove this eventually.
+function isSlowBuffer (obj) {
+ return typeof obj.readFloatLE === 'function' && typeof obj.slice === 'function' && isBuffer(obj.slice(0, 0))
+}
--- /dev/null
+{
+ "_args": [
+ [
+ {
+ "raw": "is-buffer@^1.1.5",
+ "scope": null,
+ "escapedName": "is-buffer",
+ "name": "is-buffer",
+ "rawSpec": "^1.1.5",
+ "spec": ">=1.1.5 <2.0.0",
+ "type": "range"
+ },
+ "/home/sources/5.0/crosswalk-tizen/wrt/node_modules/kind-of"
+ ]
+ ],
+ "_from": "is-buffer@>=1.1.5 <2.0.0",
+ "_id": "is-buffer@1.1.6",
+ "_inCache": true,
+ "_location": "/is-buffer",
+ "_nodeVersion": "8.6.0",
+ "_npmOperationalInternal": {
+ "host": "s3://npm-registry-packages",
+ "tmp": "tmp/is-buffer-1.1.6.tgz_1508967388794_0.03916449216194451"
+ },
+ "_npmUser": {
+ "name": "feross",
+ "email": "feross@feross.org"
+ },
+ "_npmVersion": "5.5.1",
+ "_phantomChildren": {},
+ "_requested": {
+ "raw": "is-buffer@^1.1.5",
+ "scope": null,
+ "escapedName": "is-buffer",
+ "name": "is-buffer",
+ "rawSpec": "^1.1.5",
+ "spec": ">=1.1.5 <2.0.0",
+ "type": "range"
+ },
+ "_requiredBy": [
+ "/kind-of"
+ ],
+ "_resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz",
+ "_shasum": "efaa2ea9daa0d7ab2ea13a97b2b8ad51fefbe8be",
+ "_shrinkwrap": null,
+ "_spec": "is-buffer@^1.1.5",
+ "_where": "/home/sources/5.0/crosswalk-tizen/wrt/node_modules/kind-of",
+ "author": {
+ "name": "Feross Aboukhadijeh",
+ "email": "feross@feross.org",
+ "url": "http://feross.org/"
+ },
+ "bugs": {
+ "url": "https://github.com/feross/is-buffer/issues"
+ },
+ "dependencies": {},
+ "description": "Determine if an object is a Buffer",
+ "devDependencies": {
+ "standard": "*",
+ "tape": "^4.0.0",
+ "zuul": "^3.0.0"
+ },
+ "directories": {},
+ "dist": {
+ "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==",
+ "shasum": "efaa2ea9daa0d7ab2ea13a97b2b8ad51fefbe8be",
+ "tarball": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz"
+ },
+ "gitHead": "1e84e7ee31cf6b660b12500f3111a05501da387f",
+ "homepage": "https://github.com/feross/is-buffer#readme",
+ "keywords": [
+ "buffer",
+ "buffers",
+ "type",
+ "core buffer",
+ "browser buffer",
+ "browserify",
+ "typed array",
+ "uint32array",
+ "int16array",
+ "int32array",
+ "float32array",
+ "float64array",
+ "browser",
+ "arraybuffer",
+ "dataview"
+ ],
+ "license": "MIT",
+ "main": "index.js",
+ "maintainers": [
+ {
+ "name": "feross",
+ "email": "feross@feross.org"
+ }
+ ],
+ "name": "is-buffer",
+ "optionalDependencies": {},
+ "readme": "ERROR: No README data found!",
+ "repository": {
+ "type": "git",
+ "url": "git://github.com/feross/is-buffer.git"
+ },
+ "scripts": {
+ "test": "standard && npm run test-node && npm run test-browser",
+ "test-browser": "zuul -- test/*.js",
+ "test-browser-local": "zuul --local -- test/*.js",
+ "test-node": "tape test/*.js"
+ },
+ "testling": {
+ "files": "test/*.js"
+ },
+ "version": "1.1.6"
+}
--- /dev/null
+var isBuffer = require('../')
+var test = require('tape')
+
+test('is-buffer', function (t) {
+ t.equal(isBuffer(Buffer.alloc(4)), true, 'new Buffer(4)')
+ t.equal(isBuffer(Buffer.allocUnsafeSlow(100)), true, 'SlowBuffer(100)')
+
+ t.equal(isBuffer(undefined), false, 'undefined')
+ t.equal(isBuffer(null), false, 'null')
+ t.equal(isBuffer(''), false, 'empty string')
+ t.equal(isBuffer(true), false, 'true')
+ t.equal(isBuffer(false), false, 'false')
+ t.equal(isBuffer(0), false, '0')
+ t.equal(isBuffer(1), false, '1')
+ t.equal(isBuffer(1.0), false, '1.0')
+ t.equal(isBuffer('string'), false, 'string')
+ t.equal(isBuffer({}), false, '{}')
+ t.equal(isBuffer([]), false, '[]')
+ t.equal(isBuffer(function foo () {}), false, 'function foo () {}')
+ t.equal(isBuffer({ isBuffer: null }), false, '{ isBuffer: null }')
+ t.equal(isBuffer({ isBuffer: function () { throw new Error() } }), false, '{ isBuffer: function () { throw new Error() } }')
+
+ t.end()
+})
--- /dev/null
+The MIT License (MIT)
+
+Copyright (c) 2014-2017, Jon Schlinkert
+
+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.
--- /dev/null
+# kind-of [![NPM version](https://img.shields.io/npm/v/kind-of.svg?style=flat)](https://www.npmjs.com/package/kind-of) [![NPM monthly downloads](https://img.shields.io/npm/dm/kind-of.svg?style=flat)](https://npmjs.org/package/kind-of) [![NPM total downloads](https://img.shields.io/npm/dt/kind-of.svg?style=flat)](https://npmjs.org/package/kind-of) [![Linux Build Status](https://img.shields.io/travis/jonschlinkert/kind-of.svg?style=flat&label=Travis)](https://travis-ci.org/jonschlinkert/kind-of)
+
+> Get the native type of a value.
+
+## Install
+
+Install with [npm](https://www.npmjs.com/):
+
+```sh
+$ npm install --save kind-of
+```
+
+## Install
+
+Install with [bower](https://bower.io/)
+
+```sh
+$ bower install kind-of --save
+```
+
+## Usage
+
+> es5, browser and es6 ready
+
+```js
+var kindOf = require('kind-of');
+
+kindOf(undefined);
+//=> 'undefined'
+
+kindOf(null);
+//=> 'null'
+
+kindOf(true);
+//=> 'boolean'
+
+kindOf(false);
+//=> 'boolean'
+
+kindOf(new Boolean(true));
+//=> 'boolean'
+
+kindOf(new Buffer(''));
+//=> 'buffer'
+
+kindOf(42);
+//=> 'number'
+
+kindOf(new Number(42));
+//=> 'number'
+
+kindOf('str');
+//=> 'string'
+
+kindOf(new String('str'));
+//=> 'string'
+
+kindOf(arguments);
+//=> 'arguments'
+
+kindOf({});
+//=> 'object'
+
+kindOf(Object.create(null));
+//=> 'object'
+
+kindOf(new Test());
+//=> 'object'
+
+kindOf(new Date());
+//=> 'date'
+
+kindOf([]);
+//=> 'array'
+
+kindOf([1, 2, 3]);
+//=> 'array'
+
+kindOf(new Array());
+//=> 'array'
+
+kindOf(/foo/);
+//=> 'regexp'
+
+kindOf(new RegExp('foo'));
+//=> 'regexp'
+
+kindOf(function () {});
+//=> 'function'
+
+kindOf(function * () {});
+//=> 'function'
+
+kindOf(new Function());
+//=> 'function'
+
+kindOf(new Map());
+//=> 'map'
+
+kindOf(new WeakMap());
+//=> 'weakmap'
+
+kindOf(new Set());
+//=> 'set'
+
+kindOf(new WeakSet());
+//=> 'weakset'
+
+kindOf(Symbol('str'));
+//=> 'symbol'
+
+kindOf(new Int8Array());
+//=> 'int8array'
+
+kindOf(new Uint8Array());
+//=> 'uint8array'
+
+kindOf(new Uint8ClampedArray());
+//=> 'uint8clampedarray'
+
+kindOf(new Int16Array());
+//=> 'int16array'
+
+kindOf(new Uint16Array());
+//=> 'uint16array'
+
+kindOf(new Int32Array());
+//=> 'int32array'
+
+kindOf(new Uint32Array());
+//=> 'uint32array'
+
+kindOf(new Float32Array());
+//=> 'float32array'
+
+kindOf(new Float64Array());
+//=> 'float64array'
+```
+
+## Benchmarks
+
+Benchmarked against [typeof](http://github.com/CodingFu/typeof) and [type-of](https://github.com/ForbesLindesay/type-of).
+Note that performaces is slower for es6 features `Map`, `WeakMap`, `Set` and `WeakSet`.
+
+```bash
+#1: array
+ current x 23,329,397 ops/sec ±0.82% (94 runs sampled)
+ lib-type-of x 4,170,273 ops/sec ±0.55% (94 runs sampled)
+ lib-typeof x 9,686,935 ops/sec ±0.59% (98 runs sampled)
+
+#2: boolean
+ current x 27,197,115 ops/sec ±0.85% (94 runs sampled)
+ lib-type-of x 3,145,791 ops/sec ±0.73% (97 runs sampled)
+ lib-typeof x 9,199,562 ops/sec ±0.44% (99 runs sampled)
+
+#3: date
+ current x 20,190,117 ops/sec ±0.86% (92 runs sampled)
+ lib-type-of x 5,166,970 ops/sec ±0.74% (94 runs sampled)
+ lib-typeof x 9,610,821 ops/sec ±0.50% (96 runs sampled)
+
+#4: function
+ current x 23,855,460 ops/sec ±0.60% (97 runs sampled)
+ lib-type-of x 5,667,740 ops/sec ±0.54% (100 runs sampled)
+ lib-typeof x 10,010,644 ops/sec ±0.44% (100 runs sampled)
+
+#5: null
+ current x 27,061,047 ops/sec ±0.97% (96 runs sampled)
+ lib-type-of x 13,965,573 ops/sec ±0.62% (97 runs sampled)
+ lib-typeof x 8,460,194 ops/sec ±0.61% (97 runs sampled)
+
+#6: number
+ current x 25,075,682 ops/sec ±0.53% (99 runs sampled)
+ lib-type-of x 2,266,405 ops/sec ±0.41% (98 runs sampled)
+ lib-typeof x 9,821,481 ops/sec ±0.45% (99 runs sampled)
+
+#7: object
+ current x 3,348,980 ops/sec ±0.49% (99 runs sampled)
+ lib-type-of x 3,245,138 ops/sec ±0.60% (94 runs sampled)
+ lib-typeof x 9,262,952 ops/sec ±0.59% (99 runs sampled)
+
+#8: regex
+ current x 21,284,827 ops/sec ±0.72% (96 runs sampled)
+ lib-type-of x 4,689,241 ops/sec ±0.43% (100 runs sampled)
+ lib-typeof x 8,957,593 ops/sec ±0.62% (98 runs sampled)
+
+#9: string
+ current x 25,379,234 ops/sec ±0.58% (96 runs sampled)
+ lib-type-of x 3,635,148 ops/sec ±0.76% (93 runs sampled)
+ lib-typeof x 9,494,134 ops/sec ±0.49% (98 runs sampled)
+
+#10: undef
+ current x 27,459,221 ops/sec ±1.01% (93 runs sampled)
+ lib-type-of x 14,360,433 ops/sec ±0.52% (99 runs sampled)
+ lib-typeof x 23,202,868 ops/sec ±0.59% (94 runs sampled)
+
+```
+
+## Optimizations
+
+In 7 out of 8 cases, this library is 2x-10x faster than other top libraries included in the benchmarks. There are a few things that lead to this performance advantage, none of them hard and fast rules, but all of them simple and repeatable in almost any code library:
+
+1. Optimize around the fastest and most common use cases first. Of course, this will change from project-to-project, but I took some time to understand how and why `typeof` checks were being used in my own libraries and other libraries I use a lot.
+2. Optimize around bottlenecks - In other words, the order in which conditionals are implemented is significant, because each check is only as fast as the failing checks that came before it. Here, the biggest bottleneck by far is checking for plain objects (an object that was created by the `Object` constructor). I opted to make this check happen by process of elimination rather than brute force up front (e.g. by using something like `val.constructor.name`), so that every other type check would not be penalized it.
+3. Don't do uneccessary processing - why do `.slice(8, -1).toLowerCase();` just to get the word `regex`? It's much faster to do `if (type === '[object RegExp]') return 'regex'`
+
+## About
+
+### Related projects
+
+* [is-glob](https://www.npmjs.com/package/is-glob): Returns `true` if the given string looks like a glob pattern or an extglob pattern… [more](https://github.com/jonschlinkert/is-glob) | [homepage](https://github.com/jonschlinkert/is-glob "Returns `true` if the given string looks like a glob pattern or an extglob pattern. This makes it easy to create code that only uses external modules like node-glob when necessary, resulting in much faster code execution and initialization time, and a bet")
+* [is-number](https://www.npmjs.com/package/is-number): Returns true if the value is a number. comprehensive tests. | [homepage](https://github.com/jonschlinkert/is-number "Returns true if the value is a number. comprehensive tests.")
+* [is-primitive](https://www.npmjs.com/package/is-primitive): Returns `true` if the value is a primitive. | [homepage](https://github.com/jonschlinkert/is-primitive "Returns `true` if the value is a primitive. ")
+
+### Contributing
+
+Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new).
+
+### Contributors
+
+| **Commits** | **Contributor** |
+| --- | --- |
+| 59 | [jonschlinkert](https://github.com/jonschlinkert) |
+| 2 | [miguelmota](https://github.com/miguelmota) |
+| 1 | [dtothefp](https://github.com/dtothefp) |
+| 1 | [ksheedlo](https://github.com/ksheedlo) |
+| 1 | [pdehaan](https://github.com/pdehaan) |
+| 1 | [laggingreflex](https://github.com/laggingreflex) |
+
+### Building docs
+
+_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_
+
+To generate the readme, run the following command:
+
+```sh
+$ npm install -g verbose/verb#dev verb-generate-readme && verb
+```
+
+### Running tests
+
+Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command:
+
+```sh
+$ npm install && npm test
+```
+
+### Author
+
+**Jon Schlinkert**
+
+* [github/jonschlinkert](https://github.com/jonschlinkert)
+* [twitter/jonschlinkert](https://twitter.com/jonschlinkert)
+
+### License
+
+Copyright © 2017, [Jon Schlinkert](https://github.com/jonschlinkert).
+Released under the [MIT License](LICENSE).
+
+***
+
+_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.6.0, on May 16, 2017._
\ No newline at end of file
--- /dev/null
+var isBuffer = require('is-buffer');
+var toString = Object.prototype.toString;
+
+/**
+ * Get the native `typeof` a value.
+ *
+ * @param {*} `val`
+ * @return {*} Native javascript type
+ */
+
+module.exports = function kindOf(val) {
+ // primitivies
+ if (typeof val === 'undefined') {
+ return 'undefined';
+ }
+ if (val === null) {
+ return 'null';
+ }
+ if (val === true || val === false || val instanceof Boolean) {
+ return 'boolean';
+ }
+ if (typeof val === 'string' || val instanceof String) {
+ return 'string';
+ }
+ if (typeof val === 'number' || val instanceof Number) {
+ return 'number';
+ }
+
+ // functions
+ if (typeof val === 'function' || val instanceof Function) {
+ return 'function';
+ }
+
+ // array
+ if (typeof Array.isArray !== 'undefined' && Array.isArray(val)) {
+ return 'array';
+ }
+
+ // check for instances of RegExp and Date before calling `toString`
+ if (val instanceof RegExp) {
+ return 'regexp';
+ }
+ if (val instanceof Date) {
+ return 'date';
+ }
+
+ // other objects
+ var type = toString.call(val);
+
+ if (type === '[object RegExp]') {
+ return 'regexp';
+ }
+ if (type === '[object Date]') {
+ return 'date';
+ }
+ if (type === '[object Arguments]') {
+ return 'arguments';
+ }
+ if (type === '[object Error]') {
+ return 'error';
+ }
+
+ // buffer
+ if (isBuffer(val)) {
+ return 'buffer';
+ }
+
+ // es6: Map, WeakMap, Set, WeakSet
+ if (type === '[object Set]') {
+ return 'set';
+ }
+ if (type === '[object WeakSet]') {
+ return 'weakset';
+ }
+ if (type === '[object Map]') {
+ return 'map';
+ }
+ if (type === '[object WeakMap]') {
+ return 'weakmap';
+ }
+ if (type === '[object Symbol]') {
+ return 'symbol';
+ }
+
+ // typed arrays
+ if (type === '[object Int8Array]') {
+ return 'int8array';
+ }
+ if (type === '[object Uint8Array]') {
+ return 'uint8array';
+ }
+ if (type === '[object Uint8ClampedArray]') {
+ return 'uint8clampedarray';
+ }
+ if (type === '[object Int16Array]') {
+ return 'int16array';
+ }
+ if (type === '[object Uint16Array]') {
+ return 'uint16array';
+ }
+ if (type === '[object Int32Array]') {
+ return 'int32array';
+ }
+ if (type === '[object Uint32Array]') {
+ return 'uint32array';
+ }
+ if (type === '[object Float32Array]') {
+ return 'float32array';
+ }
+ if (type === '[object Float64Array]') {
+ return 'float64array';
+ }
+
+ // must be a plain object
+ return 'object';
+};
--- /dev/null
+{
+ "_args": [
+ [
+ {
+ "raw": "kind-of@^3.0.2",
+ "scope": null,
+ "escapedName": "kind-of",
+ "name": "kind-of",
+ "rawSpec": "^3.0.2",
+ "spec": ">=3.0.2 <4.0.0",
+ "type": "range"
+ },
+ "/home/sources/5.0/crosswalk-tizen/wrt/node_modules/align-text"
+ ]
+ ],
+ "_from": "kind-of@>=3.0.2 <4.0.0",
+ "_id": "kind-of@3.2.2",
+ "_inCache": true,
+ "_location": "/kind-of",
+ "_nodeVersion": "7.7.3",
+ "_npmOperationalInternal": {
+ "host": "packages-18-east.internal.npmjs.com",
+ "tmp": "tmp/kind-of-3.2.2.tgz_1494958899918_0.23780996026471257"
+ },
+ "_npmUser": {
+ "name": "jonschlinkert",
+ "email": "github@sellside.com"
+ },
+ "_npmVersion": "4.5.0",
+ "_phantomChildren": {},
+ "_requested": {
+ "raw": "kind-of@^3.0.2",
+ "scope": null,
+ "escapedName": "kind-of",
+ "name": "kind-of",
+ "rawSpec": "^3.0.2",
+ "spec": ">=3.0.2 <4.0.0",
+ "type": "range"
+ },
+ "_requiredBy": [
+ "/align-text"
+ ],
+ "_resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz",
+ "_shasum": "31ea21a734bab9bbb0f32466d893aea51e4a3c64",
+ "_shrinkwrap": null,
+ "_spec": "kind-of@^3.0.2",
+ "_where": "/home/sources/5.0/crosswalk-tizen/wrt/node_modules/align-text",
+ "author": {
+ "name": "Jon Schlinkert",
+ "url": "https://github.com/jonschlinkert"
+ },
+ "bugs": {
+ "url": "https://github.com/jonschlinkert/kind-of/issues"
+ },
+ "contributors": [
+ {
+ "name": "David Fox-Powell",
+ "url": "https://dtothefp.github.io/me"
+ },
+ {
+ "name": "Jon Schlinkert",
+ "url": "http://twitter.com/jonschlinkert"
+ },
+ {
+ "name": "Ken Sheedlo",
+ "url": "kensheedlo.com"
+ },
+ {
+ "name": "laggingreflex",
+ "url": "https://github.com/laggingreflex"
+ },
+ {
+ "name": "Miguel Mota",
+ "url": "https://miguelmota.com"
+ },
+ {
+ "name": "Peter deHaan",
+ "url": "http://about.me/peterdehaan"
+ }
+ ],
+ "dependencies": {
+ "is-buffer": "^1.1.5"
+ },
+ "description": "Get the native type of a value.",
+ "devDependencies": {
+ "ansi-bold": "^0.1.1",
+ "benchmarked": "^1.0.0",
+ "browserify": "^14.3.0",
+ "glob": "^7.1.1",
+ "gulp-format-md": "^0.1.12",
+ "mocha": "^3.3.0",
+ "type-of": "^2.0.1",
+ "typeof": "^1.0.0"
+ },
+ "directories": {},
+ "dist": {
+ "shasum": "31ea21a734bab9bbb0f32466d893aea51e4a3c64",
+ "tarball": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz"
+ },
+ "engines": {
+ "node": ">=0.10.0"
+ },
+ "files": [
+ "index.js"
+ ],
+ "gitHead": "0ffe67cf12f5396047c1bacf04232b7deeb24063",
+ "homepage": "https://github.com/jonschlinkert/kind-of",
+ "keywords": [
+ "arguments",
+ "array",
+ "boolean",
+ "check",
+ "date",
+ "function",
+ "is",
+ "is-type",
+ "is-type-of",
+ "kind",
+ "kind-of",
+ "number",
+ "object",
+ "of",
+ "regexp",
+ "string",
+ "test",
+ "type",
+ "type-of",
+ "typeof",
+ "types"
+ ],
+ "license": "MIT",
+ "main": "index.js",
+ "maintainers": [
+ {
+ "name": "jonschlinkert",
+ "email": "github@sellside.com"
+ },
+ {
+ "name": "doowb",
+ "email": "brian.woodward@gmail.com"
+ }
+ ],
+ "name": "kind-of",
+ "optionalDependencies": {},
+ "readme": "ERROR: No README data found!",
+ "repository": {
+ "type": "git",
+ "url": "git+https://github.com/jonschlinkert/kind-of.git"
+ },
+ "scripts": {
+ "prepublish": "browserify -o browser.js -e index.js -s index --bare",
+ "test": "mocha"
+ },
+ "verb": {
+ "related": {
+ "list": [
+ "is-glob",
+ "is-number",
+ "is-primitive"
+ ]
+ },
+ "toc": false,
+ "layout": "default",
+ "tasks": [
+ "readme"
+ ],
+ "plugins": [
+ "gulp-format-md"
+ ],
+ "lint": {
+ "reflinks": true
+ },
+ "reflinks": [
+ "verb"
+ ]
+ },
+ "version": "3.2.2"
+}
--- /dev/null
+The MIT License (MIT)
+
+Copyright (c) 2015-2016, Jon Schlinkert.
+
+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.
--- /dev/null
+# lazy-cache [![NPM version](https://img.shields.io/npm/v/lazy-cache.svg?style=flat)](https://www.npmjs.com/package/lazy-cache) [![NPM downloads](https://img.shields.io/npm/dm/lazy-cache.svg?style=flat)](https://npmjs.org/package/lazy-cache) [![Build Status](https://img.shields.io/travis/jonschlinkert/lazy-cache.svg?style=flat)](https://travis-ci.org/jonschlinkert/lazy-cache)
+
+> Cache requires to be lazy-loaded when needed.
+
+## Install
+
+Install with [npm](https://www.npmjs.com/):
+
+```sh
+$ npm install lazy-cache --save
+```
+
+If you use webpack and are experiencing issues, try using [unlazy-loader](https://github.com/doowb/unlazy-loader), a webpack loader that fixes the bug that prevents webpack from working with native javascript getters.
+
+## Usage
+
+```js
+var utils = require('lazy-cache')(require);
+```
+
+**Use as a property on `lazy`**
+
+The module is also added as a property to the `lazy` function
+so it can be called without having to call a function first.
+
+```js
+var utils = require('lazy-cache')(require);
+
+// `npm install glob`
+utils('glob');
+
+// glob sync
+console.log(utils.glob.sync('*.js'));
+
+// glob async
+utils.glob('*.js', function (err, files) {
+ console.log(files);
+});
+```
+
+**Use as a function**
+
+```js
+var utils = require('lazy-cache')(require);
+var glob = utils('glob');
+
+// `glob` is a now a function that may be called when needed
+glob().sync('foo/*.js');
+```
+
+## Aliases
+
+An alias may be passed as the second argument if you don't want to use the automatically camel-cased variable name.
+
+**Example**
+
+```js
+var utils = require('lazy-cache')(require);
+
+// alias `ansi-yellow` as `yellow`
+utils('ansi-yellow', 'yellow');
+console.log(utils.yellow('foo'));
+```
+
+## Browserify usage
+
+**Example**
+
+```js
+var utils = require('lazy-cache')(require);
+// temporarily re-assign `require` to trick browserify
+var fn = require;
+require = utils;
+// list module dependencies (here, `require` is actually `lazy-cache`)
+require('glob');
+require = fn; // restore the native `require` function
+
+/**
+ * Now you can use glob with the `utils.glob` variable
+ */
+
+// sync
+console.log(utils.glob.sync('*.js'));
+
+// async
+utils.glob('*.js', function (err, files) {
+ console.log(files.join('\n'));
+});
+```
+
+## Kill switch
+
+In certain rare edge cases it may be necessary to unlazy all lazy-cached dependencies (5 reported cases after ~30 million downloads).
+
+To force lazy-cache to immediately invoke all dependencies, do:
+
+```js
+process.env.UNLAZY = true;
+```
+
+## Related projects
+
+You might also be interested in these projects:
+
+[lint-deps](https://www.npmjs.com/package/lint-deps): CLI tool that tells you when dependencies are missing from package.json and offers you a… [more](https://www.npmjs.com/package/lint-deps) | [homepage](https://github.com/jonschlinkert/lint-deps)
+
+## Contributing
+
+Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](https://github.com/jonschlinkert/lazy-cache/issues/new).
+
+## Building docs
+
+Generate readme and API documentation with [verb](https://github.com/verbose/verb):
+
+```sh
+$ npm install verb && npm run docs
+```
+
+Or, if [verb](https://github.com/verbose/verb) is installed globally:
+
+```sh
+$ verb
+```
+
+## Running tests
+
+Install dev dependencies:
+
+```sh
+$ npm install -d && npm test
+```
+
+## Author
+
+**Jon Schlinkert**
+
+* [github/jonschlinkert](https://github.com/jonschlinkert)
+* [twitter/jonschlinkert](http://twitter.com/jonschlinkert)
+
+## License
+
+Copyright © 2016, [Jon Schlinkert](https://github.com/jonschlinkert).
+Released under the [MIT license](https://github.com/jonschlinkert/lazy-cache/blob/master/LICENSE).
+
+***
+
+_This file was generated by [verb](https://github.com/verbose/verb), v0.9.0, on April 22, 2016._
\ No newline at end of file
--- /dev/null
+'use strict';
+
+/**
+ * Cache results of the first function call to ensure only calling once.
+ *
+ * ```js
+ * var utils = require('lazy-cache')(require);
+ * // cache the call to `require('ansi-yellow')`
+ * utils('ansi-yellow', 'yellow');
+ * // use `ansi-yellow`
+ * console.log(utils.yellow('this is yellow'));
+ * ```
+ *
+ * @param {Function} `fn` Function that will be called only once.
+ * @return {Function} Function that can be called to get the cached function
+ * @api public
+ */
+
+function lazyCache(fn) {
+ var cache = {};
+ var proxy = function(mod, name) {
+ name = name || camelcase(mod);
+
+ // check both boolean and string in case `process.env` cases to string
+ if (process.env.UNLAZY === 'true' || process.env.UNLAZY === true || process.env.TRAVIS) {
+ cache[name] = fn(mod);
+ }
+
+ Object.defineProperty(proxy, name, {
+ enumerable: true,
+ configurable: true,
+ get: getter
+ });
+
+ function getter() {
+ if (cache.hasOwnProperty(name)) {
+ return cache[name];
+ }
+ return (cache[name] = fn(mod));
+ }
+ return getter;
+ };
+ return proxy;
+}
+
+/**
+ * Used to camelcase the name to be stored on the `lazy` object.
+ *
+ * @param {String} `str` String containing `_`, `.`, `-` or whitespace that will be camelcased.
+ * @return {String} camelcased string.
+ */
+
+function camelcase(str) {
+ if (str.length === 1) {
+ return str.toLowerCase();
+ }
+ str = str.replace(/^[\W_]+|[\W_]+$/g, '').toLowerCase();
+ return str.replace(/[\W_]+(\w|$)/g, function(_, ch) {
+ return ch.toUpperCase();
+ });
+}
+
+/**
+ * Expose `lazyCache`
+ */
+
+module.exports = lazyCache;
--- /dev/null
+{
+ "_args": [
+ [
+ {
+ "raw": "lazy-cache@^1.0.3",
+ "scope": null,
+ "escapedName": "lazy-cache",
+ "name": "lazy-cache",
+ "rawSpec": "^1.0.3",
+ "spec": ">=1.0.3 <2.0.0",
+ "type": "range"
+ },
+ "/home/sources/5.0/crosswalk-tizen/wrt/node_modules/center-align"
+ ]
+ ],
+ "_from": "lazy-cache@>=1.0.3 <2.0.0",
+ "_id": "lazy-cache@1.0.4",
+ "_inCache": true,
+ "_location": "/lazy-cache",
+ "_nodeVersion": "5.5.0",
+ "_npmOperationalInternal": {
+ "host": "packages-12-west.internal.npmjs.com",
+ "tmp": "tmp/lazy-cache-1.0.4.tgz_1461378859142_0.0996799839194864"
+ },
+ "_npmUser": {
+ "name": "jonschlinkert",
+ "email": "github@sellside.com"
+ },
+ "_npmVersion": "3.6.0",
+ "_phantomChildren": {},
+ "_requested": {
+ "raw": "lazy-cache@^1.0.3",
+ "scope": null,
+ "escapedName": "lazy-cache",
+ "name": "lazy-cache",
+ "rawSpec": "^1.0.3",
+ "spec": ">=1.0.3 <2.0.0",
+ "type": "range"
+ },
+ "_requiredBy": [
+ "/center-align"
+ ],
+ "_resolved": "https://registry.npmjs.org/lazy-cache/-/lazy-cache-1.0.4.tgz",
+ "_shasum": "a1d78fc3a50474cb80845d3b3b6e1da49a446e8e",
+ "_shrinkwrap": null,
+ "_spec": "lazy-cache@^1.0.3",
+ "_where": "/home/sources/5.0/crosswalk-tizen/wrt/node_modules/center-align",
+ "author": {
+ "name": "Jon Schlinkert",
+ "url": "https://github.com/jonschlinkert"
+ },
+ "bugs": {
+ "url": "https://github.com/jonschlinkert/lazy-cache/issues"
+ },
+ "dependencies": {},
+ "description": "Cache requires to be lazy-loaded when needed.",
+ "devDependencies": {
+ "ansi-yellow": "^0.1.1",
+ "glob": "^7.0.3",
+ "gulp-format-md": "^0.1.8",
+ "mocha": "^2.4.5"
+ },
+ "directories": {},
+ "dist": {
+ "shasum": "a1d78fc3a50474cb80845d3b3b6e1da49a446e8e",
+ "tarball": "https://registry.npmjs.org/lazy-cache/-/lazy-cache-1.0.4.tgz"
+ },
+ "engines": {
+ "node": ">=0.10.0"
+ },
+ "files": [
+ "index.js"
+ ],
+ "gitHead": "d081ffbda147391083a6856fafb1c5d82308f80c",
+ "homepage": "https://github.com/jonschlinkert/lazy-cache",
+ "keywords": [
+ "cache",
+ "caching",
+ "dependencies",
+ "dependency",
+ "lazy",
+ "require",
+ "requires"
+ ],
+ "license": "MIT",
+ "main": "index.js",
+ "maintainers": [
+ {
+ "name": "jonschlinkert",
+ "email": "github@sellside.com"
+ },
+ {
+ "name": "doowb",
+ "email": "brian.woodward@gmail.com"
+ }
+ ],
+ "name": "lazy-cache",
+ "optionalDependencies": {},
+ "readme": "ERROR: No README data found!",
+ "repository": {
+ "type": "git",
+ "url": "git+https://github.com/jonschlinkert/lazy-cache.git"
+ },
+ "scripts": {
+ "test": "mocha"
+ },
+ "verb": {
+ "related": {
+ "list": [
+ "lint-deps"
+ ]
+ },
+ "plugins": [
+ "gulp-format-md"
+ ],
+ "toc": false,
+ "layout": "default",
+ "tasks": [
+ "readme"
+ ],
+ "lint": {
+ "reflinks": true
+ },
+ "reflinks": [
+ "verb"
+ ]
+ },
+ "version": "1.0.4"
+}
--- /dev/null
+The MIT License (MIT)
+
+Copyright (c) 2014-2015, Jon Schlinkert.
+
+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.
--- /dev/null
+# longest [![NPM version](https://badge.fury.io/js/longest.svg)](http://badge.fury.io/js/longest) [![Build Status](https://travis-ci.org/jonschlinkert/longest.svg)](https://travis-ci.org/jonschlinkert/longest)
+
+> Get the longest item in an array.
+
+## Install with [npm](npmjs.org)
+
+```bash
+npm i longest --save
+```
+### Install with [bower](https://github.com/bower/bower)
+
+```bash
+bower install longest --save
+```
+
+## Running tests
+Install dev dependencies.
+
+```bash
+npm i -d && npm test
+```
+
+## Usage
+
+```js
+var longest = require('longest');
+longest(['a', 'abcde', 'abc']);
+//=> 'abcde'
+
+longest(['a', 'abcde', 'abc']).length;
+//=> 5
+```
+
+## Related projects
+* [longest-value](https://github.com/jonschlinkert/longest-value): Get the longest value for the given property from an array of objects. Useful for aligning values.
+* [right-align-values](https://github.com/jonschlinkert/right-align-values): Right align the values of a given property for each object in an array. Useful for creating text columns or tables.
+* [right-pad-values](https://github.com/jonschlinkert/right-pad-values): Right pad the values of a given property for each object in an array. Useful for creating text columns or tables.
+* [repeat-string](https://github.com/jonschlinkert/repeat-string): Repeat the given string n times. Fastest implementation for repeating a string.
+* [pad-right](https://github.com/jonschlinkert/pad-right): Right pad a string with zeros or a specified string. Fastest implementation.
+* [pad-left](https://github.com/jonschlinkert/pad-left): Left pad a string with zeros or a specified string. Fastest implementation.
+
+## Running tests
+Install dev dependencies.
+
+```bash
+npm i -d && npm test
+```
+
+## Contributing
+Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](https://github.com/jonschlinkert/longest/issues)
+
+## Author
+
+**Jon Schlinkert**
+
++ [github/jonschlinkert](https://github.com/jonschlinkert)
++ [twitter/jonschlinkert](http://twitter.com/jonschlinkert)
+
+## License
+Copyright (c) 2015 Jon Schlinkert
+Released under the MIT license
+
+***
+
+_This file was generated by [verb-cli](https://github.com/assemble/verb-cli) on March 31, 2015._
\ No newline at end of file
--- /dev/null
+/*!
+ * longest <https://github.com/jonschlinkert/longest>
+ *
+ * Copyright (c) 2014-2015, Jon Schlinkert.
+ * Licensed under the MIT License.
+ */
+
+'use strict';
+
+module.exports = function(arr) {
+ if (!arr) {
+ return null;
+ }
+
+ var len = arr.length;
+ if (!len) {
+ return null;
+ }
+
+ var c = 0;
+ var i = 0;
+ var ele;
+ var elen;
+ var res;
+
+ for (; i < len; i++) {
+ ele = arr[i].toString();
+ elen = ele.length;
+
+ if (elen > c) {
+ res = ele;
+ c = elen;
+ }
+ }
+
+ return res;
+};
--- /dev/null
+{
+ "_args": [
+ [
+ {
+ "raw": "longest@^1.0.1",
+ "scope": null,
+ "escapedName": "longest",
+ "name": "longest",
+ "rawSpec": "^1.0.1",
+ "spec": ">=1.0.1 <2.0.0",
+ "type": "range"
+ },
+ "/home/sources/5.0/crosswalk-tizen/wrt/node_modules/align-text"
+ ]
+ ],
+ "_from": "longest@>=1.0.1 <2.0.0",
+ "_id": "longest@1.0.1",
+ "_inCache": true,
+ "_location": "/longest",
+ "_nodeVersion": "0.12.0",
+ "_npmUser": {
+ "name": "jonschlinkert",
+ "email": "github@sellside.com"
+ },
+ "_npmVersion": "2.5.1",
+ "_phantomChildren": {},
+ "_requested": {
+ "raw": "longest@^1.0.1",
+ "scope": null,
+ "escapedName": "longest",
+ "name": "longest",
+ "rawSpec": "^1.0.1",
+ "spec": ">=1.0.1 <2.0.0",
+ "type": "range"
+ },
+ "_requiredBy": [
+ "/align-text"
+ ],
+ "_resolved": "https://registry.npmjs.org/longest/-/longest-1.0.1.tgz",
+ "_shasum": "30a0b2da38f73770e8294a0d22e6625ed77d0097",
+ "_shrinkwrap": null,
+ "_spec": "longest@^1.0.1",
+ "_where": "/home/sources/5.0/crosswalk-tizen/wrt/node_modules/align-text",
+ "author": {
+ "name": "Jon Schlinkert",
+ "url": "https://github.com/jonschlinkert"
+ },
+ "bugs": {
+ "url": "https://github.com/jonschlinkert/longest/issues"
+ },
+ "dependencies": {},
+ "description": "Get the longest item in an array.",
+ "devDependencies": {
+ "fill-range": "^2.1.0",
+ "mocha": "*"
+ },
+ "directories": {},
+ "dist": {
+ "shasum": "30a0b2da38f73770e8294a0d22e6625ed77d0097",
+ "tarball": "https://registry.npmjs.org/longest/-/longest-1.0.1.tgz"
+ },
+ "engines": {
+ "node": ">=0.10.0"
+ },
+ "files": [
+ "index.js"
+ ],
+ "gitHead": "99d9d8257584500aedaea54427a828197c452b0a",
+ "homepage": "https://github.com/jonschlinkert/longest",
+ "keywords": [
+ "array",
+ "element",
+ "item",
+ "long",
+ "length",
+ "longest"
+ ],
+ "license": {
+ "type": "MIT",
+ "url": "https://github.com/jonschlinkert/longest/blob/master/LICENSE"
+ },
+ "main": "index.js",
+ "maintainers": [
+ {
+ "name": "jonschlinkert",
+ "email": "github@sellside.com"
+ },
+ {
+ "name": "shinnn",
+ "email": "snnskwtnb@gmail.com"
+ }
+ ],
+ "name": "longest",
+ "optionalDependencies": {},
+ "readme": "ERROR: No README data found!",
+ "repository": {
+ "type": "git",
+ "url": "git+https://github.com/jonschlinkert/longest.git"
+ },
+ "scripts": {
+ "test": "mocha"
+ },
+ "version": "1.0.1"
+}
--- /dev/null
+/**
+ * Helpers.
+ */
+
+var s = 1000;
+var m = s * 60;
+var h = m * 60;
+var d = h * 24;
+var y = d * 365.25;
+
+/**
+ * Parse or format the given `val`.
+ *
+ * Options:
+ *
+ * - `long` verbose formatting [false]
+ *
+ * @param {String|Number} val
+ * @param {Object} [options]
+ * @throws {Error} throw an error if val is not a non-empty string or a number
+ * @return {String|Number}
+ * @api public
+ */
+
+module.exports = function(val, options) {
+ options = options || {};
+ var type = typeof val;
+ if (type === 'string' && val.length > 0) {
+ return parse(val);
+ } else if (type === 'number' && isNaN(val) === false) {
+ return options.long ? fmtLong(val) : fmtShort(val);
+ }
+ throw new Error(
+ 'val is not a non-empty string or a valid number. val=' +
+ JSON.stringify(val)
+ );
+};
+
+/**
+ * Parse the given `str` and return milliseconds.
+ *
+ * @param {String} str
+ * @return {Number}
+ * @api private
+ */
+
+function parse(str) {
+ str = String(str);
+ if (str.length > 100) {
+ return;
+ }
+ var match = /^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(
+ str
+ );
+ if (!match) {
+ return;
+ }
+ var n = parseFloat(match[1]);
+ var type = (match[2] || 'ms').toLowerCase();
+ switch (type) {
+ case 'years':
+ case 'year':
+ case 'yrs':
+ case 'yr':
+ case 'y':
+ return n * y;
+ case 'days':
+ case 'day':
+ case 'd':
+ return n * d;
+ case 'hours':
+ case 'hour':
+ case 'hrs':
+ case 'hr':
+ case 'h':
+ return n * h;
+ case 'minutes':
+ case 'minute':
+ case 'mins':
+ case 'min':
+ case 'm':
+ return n * m;
+ case 'seconds':
+ case 'second':
+ case 'secs':
+ case 'sec':
+ case 's':
+ return n * s;
+ case 'milliseconds':
+ case 'millisecond':
+ case 'msecs':
+ case 'msec':
+ case 'ms':
+ return n;
+ default:
+ return undefined;
+ }
+}
+
+/**
+ * Short format for `ms`.
+ *
+ * @param {Number} ms
+ * @return {String}
+ * @api private
+ */
+
+function fmtShort(ms) {
+ if (ms >= d) {
+ return Math.round(ms / d) + 'd';
+ }
+ if (ms >= h) {
+ return Math.round(ms / h) + 'h';
+ }
+ if (ms >= m) {
+ return Math.round(ms / m) + 'm';
+ }
+ if (ms >= s) {
+ return Math.round(ms / s) + 's';
+ }
+ return ms + 'ms';
+}
+
+/**
+ * Long format for `ms`.
+ *
+ * @param {Number} ms
+ * @return {String}
+ * @api private
+ */
+
+function fmtLong(ms) {
+ return plural(ms, d, 'day') ||
+ plural(ms, h, 'hour') ||
+ plural(ms, m, 'minute') ||
+ plural(ms, s, 'second') ||
+ ms + ' ms';
+}
+
+/**
+ * Pluralization helper.
+ */
+
+function plural(ms, n, name) {
+ if (ms < n) {
+ return;
+ }
+ if (ms < n * 1.5) {
+ return Math.floor(ms / n) + ' ' + name;
+ }
+ return Math.ceil(ms / n) + ' ' + name + 's';
+}
--- /dev/null
+The MIT License (MIT)
+
+Copyright (c) 2016 Zeit, Inc.
+
+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.
--- /dev/null
+{
+ "_args": [
+ [
+ {
+ "raw": "ms@2.0.0",
+ "scope": null,
+ "escapedName": "ms",
+ "name": "ms",
+ "rawSpec": "2.0.0",
+ "spec": "2.0.0",
+ "type": "version"
+ },
+ "/home/sources/5.0/crosswalk-tizen/wrt/node_modules/debug"
+ ]
+ ],
+ "_from": "ms@2.0.0",
+ "_id": "ms@2.0.0",
+ "_inCache": true,
+ "_location": "/ms",
+ "_nodeVersion": "7.8.0",
+ "_npmOperationalInternal": {
+ "host": "packages-18-east.internal.npmjs.com",
+ "tmp": "tmp/ms-2.0.0.tgz_1494937565215_0.34005374647676945"
+ },
+ "_npmUser": {
+ "name": "leo",
+ "email": "leo@zeit.co"
+ },
+ "_npmVersion": "4.2.0",
+ "_phantomChildren": {},
+ "_requested": {
+ "raw": "ms@2.0.0",
+ "scope": null,
+ "escapedName": "ms",
+ "name": "ms",
+ "rawSpec": "2.0.0",
+ "spec": "2.0.0",
+ "type": "version"
+ },
+ "_requiredBy": [
+ "/debug"
+ ],
+ "_resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz",
+ "_shasum": "5608aeadfc00be6c2901df5f9861788de0d597c8",
+ "_shrinkwrap": null,
+ "_spec": "ms@2.0.0",
+ "_where": "/home/sources/5.0/crosswalk-tizen/wrt/node_modules/debug",
+ "bugs": {
+ "url": "https://github.com/zeit/ms/issues"
+ },
+ "dependencies": {},
+ "description": "Tiny milisecond conversion utility",
+ "devDependencies": {
+ "eslint": "3.19.0",
+ "expect.js": "0.3.1",
+ "husky": "0.13.3",
+ "lint-staged": "3.4.1",
+ "mocha": "3.4.1"
+ },
+ "directories": {},
+ "dist": {
+ "shasum": "5608aeadfc00be6c2901df5f9861788de0d597c8",
+ "tarball": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz"
+ },
+ "eslintConfig": {
+ "extends": "eslint:recommended",
+ "env": {
+ "node": true,
+ "es6": true
+ }
+ },
+ "files": [
+ "index.js"
+ ],
+ "gitHead": "9b88d1568a52ec9bb67ecc8d2aa224fa38fd41f4",
+ "homepage": "https://github.com/zeit/ms#readme",
+ "license": "MIT",
+ "lint-staged": {
+ "*.js": [
+ "npm run lint",
+ "prettier --single-quote --write",
+ "git add"
+ ]
+ },
+ "main": "./index",
+ "maintainers": [
+ {
+ "name": "leo",
+ "email": "leo@zeit.co"
+ },
+ {
+ "name": "rauchg",
+ "email": "rauchg@gmail.com"
+ }
+ ],
+ "name": "ms",
+ "optionalDependencies": {},
+ "readme": "ERROR: No README data found!",
+ "repository": {
+ "type": "git",
+ "url": "git+https://github.com/zeit/ms.git"
+ },
+ "scripts": {
+ "lint": "eslint lib/* bin/*",
+ "precommit": "lint-staged",
+ "test": "mocha tests.js"
+ },
+ "version": "2.0.0"
+}
--- /dev/null
+# ms
+
+[![Build Status](https://travis-ci.org/zeit/ms.svg?branch=master)](https://travis-ci.org/zeit/ms)
+[![Slack Channel](http://zeit-slackin.now.sh/badge.svg)](https://zeit.chat/)
+
+Use this package to easily convert various time formats to milliseconds.
+
+## Examples
+
+```js
+ms('2 days') // 172800000
+ms('1d') // 86400000
+ms('10h') // 36000000
+ms('2.5 hrs') // 9000000
+ms('2h') // 7200000
+ms('1m') // 60000
+ms('5s') // 5000
+ms('1y') // 31557600000
+ms('100') // 100
+```
+
+### Convert from milliseconds
+
+```js
+ms(60000) // "1m"
+ms(2 * 60000) // "2m"
+ms(ms('10 hours')) // "10h"
+```
+
+### Time format written-out
+
+```js
+ms(60000, { long: true }) // "1 minute"
+ms(2 * 60000, { long: true }) // "2 minutes"
+ms(ms('10 hours'), { long: true }) // "10 hours"
+```
+
+## Features
+
+- Works both in [node](https://nodejs.org) and in the browser.
+- If a number is supplied to `ms`, a string with a unit is returned.
+- If a string that contains the number is supplied, it returns it as a number (e.g.: it returns `100` for `'100'`).
+- If you pass a string with a number and a valid unit, the number of equivalent ms is returned.
+
+## Caught a bug?
+
+1. [Fork](https://help.github.com/articles/fork-a-repo/) this repository to your own GitHub account and then [clone](https://help.github.com/articles/cloning-a-repository/) it to your local device
+2. Link the package to the global module directory: `npm link`
+3. Within the module you want to test your local development instance of ms, just link it to the dependencies: `npm link ms`. Instead of the default one from npm, node will now use your clone of ms!
+
+As always, you can run the tests using: `npm test`
--- /dev/null
+node_modules
+npm-debug.log
--- /dev/null
+This software is released under the MIT license:
+
+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.
--- /dev/null
+# node-constants
+
+A small library for defining module-level constants.
+
+Check for further examples in the `examples` folder.
+Also, the source code is really small and well documented.
+
+**NOTE:** newer versions of node use the name
+["constants"](https://github.com/joyent/node/blob/master/lib/constants.js)
+internally, which clobbers any attempt to use this library. As a result,
+I've had to rename to the more verbose,
+["node-constants"](https://www.npmjs.org/package/node-constants).
+
+## Basic Usage
+
+ var define = require("node-constants")(exports);
+ // define is a function that binds "constants" to an object (commonly exports)
+
+ // a single constant
+ define("PI", 3.14);
+
+ // or multiple
+ define({
+ DAYS_IN_WEEK: 7,
+ SECONDS_IN_MINUTE: 60
+ });
+
+## Installation
+
+ npm install --save node-constants
--- /dev/null
+/**
+ * This is the most verbose of the methods to use this module,
+ * and also the most flexible in case you have multiple objects
+ * you want to define constants on (particularly if there is a
+ * hierarchy of constants)
+ */
+
+var constants = require("../");
+
+// constants.define() takes 2-3 params
+// the first is the object to bind a new "constant" to
+
+// then you can either specify a single key/value pair as 2 params
+constants.define(exports, "DAYS_IN_WEEK", 7);
+constants.define(exports, "SECONDS_IN_MINUTE", 60);
+constants.define(exports, "HOURS_IN_DAY", 24);
+
+// or
+
+// you can specify an entire group with a shallow hash of key/value pairs
+constants.define(exports, {
+ DAYS_IN_WEEK: 7,
+ SECONDS_IN_MINUTE: 60,
+ HOURS_IN_DAY: 24
+});
+
+console.log(exports);
--- /dev/null
+/**
+ * constants.definer() creates a new function that is bound
+ * to the input object. Although I'm using exports directly here,
+ * that is not what you are limited to each call to define will
+ * return the object that was operated on
+ */
+
+var constants = require("../"),
+ // bind to exports (ie. module.exports)
+ define = constants.definer(exports);
+
+// the newly created function only needs 1-2 params
+
+// either a single key/value pair as 2 params
+define("DAYS_IN_WEEK", 7);
+define("SECONDS_IN_MINUTE", 60);
+define("HOURS_IN_DAY", 24);
+
+// or
+
+// a hash of key/value pairs
+define({
+ DAYS_IN_WEEK: 7,
+ SECONDS_IN_MINUTE: 60,
+ HOURS_IN_DAY: 24
+});
+
+console.log(exports);
--- /dev/null
+/**
+ * Although definer can accept an object parameter, if none is entered
+ * a new empty object will be created via Object.create(null) and used
+ * instead. You can retrieve that object from any calls to the returned
+ * definer.
+ */
+
+var constants = require("../"),
+ define = constants.definer(); // defaults to a new empty object
+
+// since define (as well as any created definer) return the object
+// that was operated on, you can store your constants module without
+// ever explicitly creating it
+var my_constants = define("MEANING_OF_LIFE", 42);
+
+console.log(my_constants);
--- /dev/null
+/**
+ * The module itself is actually a function object that takes a single
+ * param and passes it along to constants.definer(). This enables you
+ * to quickly get a definer() in as little code as possible
+ */
+
+// the returned function will be bound to exports (module.exports)
+var define = require("../")(exports);
+
+define("PI", 3.14);
+define("ZERO", 0);
+
+// or
+
+define({
+ PI: 3.14,
+ ZERO: 0
+});
+
+console.log(exports);
--- /dev/null
+module.exports = require("./lib");
--- /dev/null
+/**
+ * Provides short-hand for creating a definer right away
+ *
+ * @param {object} [object] The object to bind the constants to
+ *
+ * @returns {function} @see exports.definer
+ */
+module.exports = function (object) {
+ return module.exports.definer(object);
+};
+
+/**
+ * Binds a new "constant" property to an input object
+ *
+ * @param {object} object
+ * @param {string} name
+ * @param {mixed} value
+ *
+ * @return {object} The input object
+ */
+module.exports.define = function (object, name, value) {
+ var key;
+
+ // if an object, loop the properties for the definitions
+ if (typeof name === "object") {
+ for (key in name) {
+ if (name.hasOwnProperty(key)) {
+ module.exports.define(object, key, name[key]);
+ }
+ }
+ // otherwise, just operate on a single property
+ } else {
+ Object.defineProperty(object, name, {
+ value: value,
+ enumerable: true,
+ writable: false,
+ configurable: false
+ });
+ }
+
+ return object;
+};
+
+/**
+ * Creates a "definer" function that is bound to an input object (or a new empty object)
+ *
+ * @param {object} [object]
+ *
+ * @return {function}
+ */
+module.exports.definer = function (object) {
+ object = object || Object.create(null);
+ return function (name, value) {
+ return module.exports.define(object, name, value);
+ };
+};
--- /dev/null
+{
+ "_args": [
+ [
+ {
+ "raw": "node-constants@0.0.2",
+ "scope": null,
+ "escapedName": "node-constants",
+ "name": "node-constants",
+ "rawSpec": "0.0.2",
+ "spec": "0.0.2",
+ "type": "version"
+ },
+ "/home/sources/5.0/crosswalk-tizen/wrt"
+ ]
+ ],
+ "_from": "node-constants@0.0.2",
+ "_id": "node-constants@0.0.2",
+ "_inCache": true,
+ "_location": "/node-constants",
+ "_npmUser": {
+ "name": "dominicbarnes",
+ "email": "contact@dominicbarnes.us"
+ },
+ "_npmVersion": "1.4.3",
+ "_phantomChildren": {},
+ "_requested": {
+ "raw": "node-constants@0.0.2",
+ "scope": null,
+ "escapedName": "node-constants",
+ "name": "node-constants",
+ "rawSpec": "0.0.2",
+ "spec": "0.0.2",
+ "type": "version"
+ },
+ "_requiredBy": [
+ "#DEV:/"
+ ],
+ "_resolved": "https://registry.npmjs.org/node-constants/-/node-constants-0.0.2.tgz",
+ "_shasum": "db676f714082c1a233fe19f57c0243d0077c38bd",
+ "_shrinkwrap": null,
+ "_spec": "node-constants@0.0.2",
+ "_where": "/home/sources/5.0/crosswalk-tizen/wrt",
+ "author": {
+ "name": "Dominic Barnes",
+ "email": "dominic@dbarnes.info"
+ },
+ "bugs": {
+ "url": "https://github.com/dominicbarnes/node-constants/issues"
+ },
+ "dependencies": {},
+ "description": "Small library for defining constants for your modules",
+ "devDependencies": {
+ "mocha": "~1.9.0"
+ },
+ "directories": {},
+ "dist": {
+ "shasum": "db676f714082c1a233fe19f57c0243d0077c38bd",
+ "tarball": "https://registry.npmjs.org/node-constants/-/node-constants-0.0.2.tgz"
+ },
+ "engines": {
+ "node": ">= 0.4"
+ },
+ "homepage": "http://github.com/dominicbarnes/node-constants",
+ "keywords": [
+ "constants",
+ "modules"
+ ],
+ "license": "MIT",
+ "main": "index",
+ "maintainers": [
+ {
+ "name": "dominicbarnes",
+ "email": "contact@dominicbarnes.us"
+ }
+ ],
+ "name": "node-constants",
+ "optionalDependencies": {},
+ "readme": "ERROR: No README data found!",
+ "repository": {
+ "type": "git",
+ "url": "git://github.com/dominicbarnes/node-constants.git"
+ },
+ "scripts": {
+ "test": "mocha"
+ },
+ "version": "0.0.2"
+}
--- /dev/null
+var test = require("assert"),
+ constants = require("../");
+
+module.exports = {
+ define: function (done) {
+ var o = {},
+ ret = constants.define(o, "PI", 3.14);
+
+ // make sure it is not writable
+ test.equal(o.PI, 3.14);
+ o.PI = 5;
+ test.equal(o.PI, 3.14);
+
+ // test a collection
+ constants.define(o, {
+ MEANING_OF_LIFE: 42,
+ SECONDS_IN_MINUTE: 60
+ });
+
+ // make sure it's not writable
+ test.equal(o.MEANING_OF_LIFE, 42);
+ o.MEANING_OF_LIFE = 100;
+ test.equal(o.MEANING_OF_LIFE, 42);
+
+ test.strictEqual(o, ret);
+ done();
+ },
+ definer: function (done) {
+ var define = constants.definer(),
+ a, b;
+
+ a = define("QUARTS_IN_GALLON", 4);
+ b = define("LETTERS_IN_ALPHABET", 24);
+
+ // make sure the same object is returned
+ test.strictEqual(a, b);
+
+ // test constants
+ test.equal(a.QUARTS_IN_GALLON, 4);
+ test.equal(b.LETTERS_IN_ALPHABET, 24);
+
+ done();
+ },
+ quick: function (done) {
+ var define = constants(),
+ o = define("ZERO", 0);
+
+ test.ok(o);
+ test.strictEqual(o.ZERO, 0);
+
+ done();
+ }
+};
--- /dev/null
+--reporter list
+--ui exports
--- /dev/null
+The MIT License (MIT)
+
+Copyright (c) 2014-2016, Jon Schlinkert.
+
+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.
--- /dev/null
+# repeat-string [![NPM version](https://img.shields.io/npm/v/repeat-string.svg?style=flat)](https://www.npmjs.com/package/repeat-string) [![NPM monthly downloads](https://img.shields.io/npm/dm/repeat-string.svg?style=flat)](https://npmjs.org/package/repeat-string) [![NPM total downloads](https://img.shields.io/npm/dt/repeat-string.svg?style=flat)](https://npmjs.org/package/repeat-string) [![Linux Build Status](https://img.shields.io/travis/jonschlinkert/repeat-string.svg?style=flat&label=Travis)](https://travis-ci.org/jonschlinkert/repeat-string)
+
+> Repeat the given string n times. Fastest implementation for repeating a string.
+
+## Install
+
+Install with [npm](https://www.npmjs.com/):
+
+```sh
+$ npm install --save repeat-string
+```
+
+## Usage
+
+### [repeat](index.js#L41)
+
+Repeat the given `string` the specified `number` of times.
+
+**Example:**
+
+**Example**
+
+```js
+var repeat = require('repeat-string');
+repeat('A', 5);
+//=> AAAAA
+```
+
+**Params**
+
+* `string` **{String}**: The string to repeat
+* `number` **{Number}**: The number of times to repeat the string
+* `returns` **{String}**: Repeated string
+
+## Benchmarks
+
+Repeat string is significantly faster than the native method (which is itself faster than [repeating](https://github.com/sindresorhus/repeating)):
+
+```sh
+# 2x
+repeat-string █████████████████████████ (26,953,977 ops/sec)
+repeating █████████ (9,855,695 ops/sec)
+native ██████████████████ (19,453,895 ops/sec)
+
+# 3x
+repeat-string █████████████████████████ (19,445,252 ops/sec)
+repeating ███████████ (8,661,565 ops/sec)
+native ████████████████████ (16,020,598 ops/sec)
+
+# 10x
+repeat-string █████████████████████████ (23,792,521 ops/sec)
+repeating █████████ (8,571,332 ops/sec)
+native ███████████████ (14,582,955 ops/sec)
+
+# 50x
+repeat-string █████████████████████████ (23,640,179 ops/sec)
+repeating █████ (5,505,509 ops/sec)
+native ██████████ (10,085,557 ops/sec)
+
+# 250x
+repeat-string █████████████████████████ (23,489,618 ops/sec)
+repeating ████ (3,962,937 ops/sec)
+native ████████ (7,724,892 ops/sec)
+
+# 2000x
+repeat-string █████████████████████████ (20,315,172 ops/sec)
+repeating ████ (3,297,079 ops/sec)
+native ███████ (6,203,331 ops/sec)
+
+# 20000x
+repeat-string █████████████████████████ (23,382,915 ops/sec)
+repeating ███ (2,980,058 ops/sec)
+native █████ (5,578,808 ops/sec)
+```
+
+**Run the benchmarks**
+
+Install dev dependencies:
+
+```sh
+npm i -d && node benchmark
+```
+
+## About
+
+### Related projects
+
+[repeat-element](https://www.npmjs.com/package/repeat-element): Create an array by repeating the given value n times. | [homepage](https://github.com/jonschlinkert/repeat-element "Create an array by repeating the given value n times.")
+
+### Contributing
+
+Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new).
+
+### Contributors
+
+| **Commits** | **Contributor**<br/> |
+| --- | --- |
+| 51 | [jonschlinkert](https://github.com/jonschlinkert) |
+| 2 | [LinusU](https://github.com/LinusU) |
+| 2 | [tbusser](https://github.com/tbusser) |
+| 1 | [doowb](https://github.com/doowb) |
+| 1 | [wooorm](https://github.com/wooorm) |
+
+### Building docs
+
+_(This document was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme) (a [verb](https://github.com/verbose/verb) generator), please don't edit the readme directly. Any changes to the readme must be made in [.verb.md](.verb.md).)_
+
+To generate the readme and API documentation with [verb](https://github.com/verbose/verb):
+
+```sh
+$ npm install -g verb verb-generate-readme && verb
+```
+
+### Running tests
+
+Install dev dependencies:
+
+```sh
+$ npm install -d && npm test
+```
+
+### Author
+
+**Jon Schlinkert**
+
+* [github/jonschlinkert](https://github.com/jonschlinkert)
+* [twitter/jonschlinkert](http://twitter.com/jonschlinkert)
+
+### License
+
+Copyright © 2016, [Jon Schlinkert](http://github.com/jonschlinkert).
+Released under the [MIT license](https://github.com/jonschlinkert/repeat-string/blob/master/LICENSE).
+
+***
+
+_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.2.0, on October 23, 2016._
\ No newline at end of file
--- /dev/null
+/*!
+ * repeat-string <https://github.com/jonschlinkert/repeat-string>
+ *
+ * Copyright (c) 2014-2015, Jon Schlinkert.
+ * Licensed under the MIT License.
+ */
+
+'use strict';
+
+/**
+ * Results cache
+ */
+
+var res = '';
+var cache;
+
+/**
+ * Expose `repeat`
+ */
+
+module.exports = repeat;
+
+/**
+ * Repeat the given `string` the specified `number`
+ * of times.
+ *
+ * **Example:**
+ *
+ * ```js
+ * var repeat = require('repeat-string');
+ * repeat('A', 5);
+ * //=> AAAAA
+ * ```
+ *
+ * @param {String} `string` The string to repeat
+ * @param {Number} `number` The number of times to repeat the string
+ * @return {String} Repeated string
+ * @api public
+ */
+
+function repeat(str, num) {
+ if (typeof str !== 'string') {
+ throw new TypeError('expected a string');
+ }
+
+ // cover common, quick use cases
+ if (num === 1) return str;
+ if (num === 2) return str + str;
+
+ var max = str.length * num;
+ if (cache !== str || typeof cache === 'undefined') {
+ cache = str;
+ res = '';
+ } else if (res.length >= max) {
+ return res.substr(0, max);
+ }
+
+ while (max > res.length && num > 1) {
+ if (num & 1) {
+ res += str;
+ }
+
+ num >>= 1;
+ str += str;
+ }
+
+ res += str;
+ res = res.substr(0, max);
+ return res;
+}
--- /dev/null
+{
+ "_args": [
+ [
+ {
+ "raw": "repeat-string@^1.5.2",
+ "scope": null,
+ "escapedName": "repeat-string",
+ "name": "repeat-string",
+ "rawSpec": "^1.5.2",
+ "spec": ">=1.5.2 <2.0.0",
+ "type": "range"
+ },
+ "/home/sources/5.0/crosswalk-tizen/wrt/node_modules/align-text"
+ ]
+ ],
+ "_from": "repeat-string@>=1.5.2 <2.0.0",
+ "_id": "repeat-string@1.6.1",
+ "_inCache": true,
+ "_location": "/repeat-string",
+ "_nodeVersion": "6.7.0",
+ "_npmOperationalInternal": {
+ "host": "packages-12-west.internal.npmjs.com",
+ "tmp": "tmp/repeat-string-1.6.1.tgz_1477241638674_0.3764322670176625"
+ },
+ "_npmUser": {
+ "name": "jonschlinkert",
+ "email": "github@sellside.com"
+ },
+ "_npmVersion": "3.10.3",
+ "_phantomChildren": {},
+ "_requested": {
+ "raw": "repeat-string@^1.5.2",
+ "scope": null,
+ "escapedName": "repeat-string",
+ "name": "repeat-string",
+ "rawSpec": "^1.5.2",
+ "spec": ">=1.5.2 <2.0.0",
+ "type": "range"
+ },
+ "_requiredBy": [
+ "/align-text"
+ ],
+ "_resolved": "https://registry.npmjs.org/repeat-string/-/repeat-string-1.6.1.tgz",
+ "_shasum": "8dcae470e1c88abc2d600fff4a776286da75e637",
+ "_shrinkwrap": null,
+ "_spec": "repeat-string@^1.5.2",
+ "_where": "/home/sources/5.0/crosswalk-tizen/wrt/node_modules/align-text",
+ "author": {
+ "name": "Jon Schlinkert",
+ "url": "http://github.com/jonschlinkert"
+ },
+ "bugs": {
+ "url": "https://github.com/jonschlinkert/repeat-string/issues"
+ },
+ "contributors": [
+ {
+ "name": "Brian Woodward",
+ "email": "brian.woodward@gmail.com",
+ "url": "https://github.com/doowb"
+ },
+ {
+ "name": "Jon Schlinkert",
+ "email": "jon.schlinkert@sellside.com",
+ "url": "http://twitter.com/jonschlinkert"
+ },
+ {
+ "name": "Linus Unnebäck",
+ "email": "linus@folkdatorn.se",
+ "url": "http://linus.unnebäck.se"
+ },
+ {
+ "name": "Thijs Busser",
+ "email": "tbusser@gmail.com",
+ "url": "http://tbusser.net"
+ },
+ {
+ "name": "Titus",
+ "email": "tituswormer@gmail.com",
+ "url": "wooorm.com"
+ }
+ ],
+ "dependencies": {},
+ "description": "Repeat the given string n times. Fastest implementation for repeating a string.",
+ "devDependencies": {
+ "ansi-cyan": "^0.1.1",
+ "benchmarked": "^0.2.5",
+ "gulp-format-md": "^0.1.11",
+ "isobject": "^2.1.0",
+ "mocha": "^3.1.2",
+ "repeating": "^3.0.0",
+ "text-table": "^0.2.0",
+ "yargs-parser": "^4.0.2"
+ },
+ "directories": {},
+ "dist": {
+ "shasum": "8dcae470e1c88abc2d600fff4a776286da75e637",
+ "tarball": "https://registry.npmjs.org/repeat-string/-/repeat-string-1.6.1.tgz"
+ },
+ "engines": {
+ "node": ">=0.10"
+ },
+ "files": [
+ "index.js"
+ ],
+ "gitHead": "1a95c5d99a02999ccd2cf4663959a18bd2def7b8",
+ "homepage": "https://github.com/jonschlinkert/repeat-string",
+ "keywords": [
+ "fast",
+ "fastest",
+ "fill",
+ "left",
+ "left-pad",
+ "multiple",
+ "pad",
+ "padding",
+ "repeat",
+ "repeating",
+ "repetition",
+ "right",
+ "right-pad",
+ "string",
+ "times"
+ ],
+ "license": "MIT",
+ "main": "index.js",
+ "maintainers": [
+ {
+ "name": "jonschlinkert",
+ "email": "github@sellside.com"
+ },
+ {
+ "name": "doowb",
+ "email": "brian.woodward@gmail.com"
+ }
+ ],
+ "name": "repeat-string",
+ "optionalDependencies": {},
+ "readme": "ERROR: No README data found!",
+ "repository": {
+ "type": "git",
+ "url": "git+https://github.com/jonschlinkert/repeat-string.git"
+ },
+ "scripts": {
+ "test": "mocha"
+ },
+ "verb": {
+ "toc": false,
+ "layout": "default",
+ "tasks": [
+ "readme"
+ ],
+ "plugins": [
+ "gulp-format-md"
+ ],
+ "related": {
+ "list": [
+ "repeat-element"
+ ]
+ },
+ "helpers": [
+ "./benchmark/helper.js"
+ ],
+ "reflinks": [
+ "verb"
+ ]
+ },
+ "version": "1.6.1"
+}
--- /dev/null
+The MIT License (MIT)
+
+Copyright (c) 2015, Jon Schlinkert.
+
+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.
--- /dev/null
+# right-align [![NPM version](https://badge.fury.io/js/right-align.svg)](http://badge.fury.io/js/right-align)
+
+> Right-align the text in a string.
+
+Install with [npm](https://www.npmjs.com/)
+
+```sh
+$ npm i right-align --save
+```
+
+## Usage
+
+```js
+var rightAlign = require('right-align');
+rightAlign(string);
+```
+
+**Example**
+
+If used on the following:
+
+```
+Lorem ipsum dolor sit amet,
+consectetur adipiscing
+elit, sed do eiusmod tempor incididunt
+ut labore et dolore
+magna aliqua. Ut enim ad minim
+veniam, quis
+```
+
+The result would be:
+
+```
+ Lorem ipsum dolor sit amet,
+ consectetur adipiscing
+elit, sed do eiusmod tempor incididunt
+ ut labore et dolore
+ magna aliqua. Ut enim ad minim
+ veniam, quis
+```
+
+## Related projects
+
+* [align-text](https://github.com/jonschlinkert/align-text): Align the text in a string.
+* [center-align](https://github.com/jonschlinkert/center-align): Center-align the text in a string.
+* [justify](https://github.com/bahamas10/node-justify): Left or right (or both) justify text using a custom width and character
+* [repeat-string](https://github.com/jonschlinkert/repeat-string): Repeat the given string n times. Fastest implementation for repeating a string.
+* [repeat-element](https://github.com/jonschlinkert/repeat-element): Create an array by repeating the given value n times.
+* [word-wrap](https://github.com/jonschlinkert/word-wrap): Wrap words to a specified length.
+
+## Running tests
+
+Install dev dependencies:
+
+```sh
+$ npm i -d && npm test
+```
+
+## Contributing
+
+Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](https://github.com/jonschlinkert/right-align/issues/new)
+
+## Author
+
+**Jon Schlinkert**
+
++ [github/jonschlinkert](https://github.com/jonschlinkert)
++ [twitter/jonschlinkert](http://twitter.com/jonschlinkert)
+
+## License
+
+Copyright © 2015 Jon Schlinkert
+Released under the MIT license.
+
+***
+
+_This file was generated by [verb-cli](https://github.com/assemble/verb-cli) on June 09, 2015._
--- /dev/null
+/*!
+ * right-align <https://github.com/jonschlinkert/right-align>
+ *
+ * Copyright (c) 2015, Jon Schlinkert.
+ * Licensed under the MIT License.
+ */
+
+'use strict';
+
+var align = require('align-text');
+
+module.exports = function rightAlign(val) {
+ return align(val, function (len, longest) {
+ return longest - len;
+ });
+};
--- /dev/null
+{
+ "_args": [
+ [
+ {
+ "raw": "right-align@^0.1.1",
+ "scope": null,
+ "escapedName": "right-align",
+ "name": "right-align",
+ "rawSpec": "^0.1.1",
+ "spec": ">=0.1.1 <0.2.0",
+ "type": "range"
+ },
+ "/home/sources/5.0/crosswalk-tizen/wrt/node_modules/cliui"
+ ]
+ ],
+ "_from": "right-align@>=0.1.1 <0.2.0",
+ "_id": "right-align@0.1.3",
+ "_inCache": true,
+ "_location": "/right-align",
+ "_nodeVersion": "0.12.4",
+ "_npmUser": {
+ "name": "jonschlinkert",
+ "email": "github@sellside.com"
+ },
+ "_npmVersion": "2.10.1",
+ "_phantomChildren": {},
+ "_requested": {
+ "raw": "right-align@^0.1.1",
+ "scope": null,
+ "escapedName": "right-align",
+ "name": "right-align",
+ "rawSpec": "^0.1.1",
+ "spec": ">=0.1.1 <0.2.0",
+ "type": "range"
+ },
+ "_requiredBy": [
+ "/cliui"
+ ],
+ "_resolved": "https://registry.npmjs.org/right-align/-/right-align-0.1.3.tgz",
+ "_shasum": "61339b722fe6a3515689210d24e14c96148613ef",
+ "_shrinkwrap": null,
+ "_spec": "right-align@^0.1.1",
+ "_where": "/home/sources/5.0/crosswalk-tizen/wrt/node_modules/cliui",
+ "author": {
+ "name": "Jon Schlinkert",
+ "url": "https://github.com/jonschlinkert"
+ },
+ "bugs": {
+ "url": "https://github.com/jonschlinkert/right-align/issues"
+ },
+ "dependencies": {
+ "align-text": "^0.1.1"
+ },
+ "description": "Right-align the text in a string.",
+ "devDependencies": {
+ "mocha": "*",
+ "should": "*"
+ },
+ "directories": {},
+ "dist": {
+ "shasum": "61339b722fe6a3515689210d24e14c96148613ef",
+ "tarball": "https://registry.npmjs.org/right-align/-/right-align-0.1.3.tgz"
+ },
+ "engines": {
+ "node": ">=0.10.0"
+ },
+ "files": [
+ "index.js"
+ ],
+ "gitHead": "23ee38d6eedbcbfed241ace6587ce5730684dd18",
+ "homepage": "https://github.com/jonschlinkert/right-align",
+ "keywords": [
+ "align",
+ "align-center",
+ "center",
+ "center-align",
+ "right",
+ "right-align",
+ "text",
+ "typography"
+ ],
+ "license": "MIT",
+ "main": "index.js",
+ "maintainers": [
+ {
+ "name": "jonschlinkert",
+ "email": "github@sellside.com"
+ }
+ ],
+ "name": "right-align",
+ "optionalDependencies": {},
+ "readme": "ERROR: No README data found!",
+ "repository": {
+ "type": "git",
+ "url": "git://github.com/jonschlinkert/right-align.git"
+ },
+ "scripts": {
+ "test": "mocha"
+ },
+ "version": "0.1.3"
+}
--- /dev/null
+The MIT License (MIT)
+
+Copyright (c) 2015, Jon Schlinkert.
+
+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.
--- /dev/null
+# window-size [![NPM version](https://badge.fury.io/js/window-size.svg)](http://badge.fury.io/js/window-size) [![Build Status](https://travis-ci.org/jonschlinkert/window-size.svg)](https://travis-ci.org/jonschlinkert/window-size)
+
+> Reliable way to to get the height and width of the terminal/console in a node.js environment.
+
+## Install
+
+Install with [npm](https://www.npmjs.com/)
+
+```sh
+$ npm i window-size --save
+```
+
+## Usage
+
+```js
+var size = require('window-size');
+size.height; // "25" (rows)
+size.width; // "80" (columns)
+```
+
+## Other projects
+
+* [base-cli](https://www.npmjs.com/package/base-cli): Plugin for base-methods that maps built-in methods to CLI args (also supports methods from a… [more](https://www.npmjs.com/package/base-cli) | [homepage](https://github.com/jonschlinkert/base-cli)
+* [lint-deps](https://www.npmjs.com/package/lint-deps): CLI tool that tells you when dependencies are missing from package.json and offers you a… [more](https://www.npmjs.com/package/lint-deps) | [homepage](https://github.com/jonschlinkert/lint-deps)
+* [yargs](https://www.npmjs.com/package/yargs): Light-weight option parsing with an argv hash. No optstrings attached. | [homepage](https://github.com/bcoe/yargs#readme)
+
+## Contributing
+
+Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](https://github.com/jonschlinkert/window-size/issues/new).
+
+## Author
+
+**Jon Schlinkert**
+
++ [github/jonschlinkert](https://github.com/jonschlinkert)
++ [twitter/jonschlinkert](http://twitter.com/jonschlinkert)
+
+## License
+
+Copyright © 2014-2015 [Jon Schlinkert](https://github.com/jonschlinkert)
+Released under the MIT license.
+
+***
+
+_This file was generated by [verb-cli](https://github.com/assemble/verb-cli) on November 15, 2015._
\ No newline at end of file
--- /dev/null
+#!/usr/bin/env node
+'use strict';
+var helpText = ['Usage',
+' $ window-size',
+'',
+'Example',
+' $ window-size',
+' height: 40 ',
+' width : 145',
+''].join('\n');
+
+function showSize () {
+ var size = require('./');
+ console.log('height: ' + size.height);
+ console.log('width : ' + size.width);
+}
+
+if (process.argv.length > 2) {
+ switch (process.argv[2]) {
+ case 'help':
+ case '--help':
+ case '-h':
+ console.log(helpText);
+ break;
+ default:
+ showSize();
+ }
+} else {
+ showSize();
+}
--- /dev/null
+'use strict';
+
+/*!
+ * window-size <https://github.com/jonschlinkert/window-size>
+ *
+ * Copyright (c) 2014-2015 Jon Schlinkert
+ * Licensed under the MIT license.
+ */
+
+var tty = require('tty');
+
+module.exports = (function () {
+ var width;
+ var height;
+
+ if (tty.isatty(1) && tty.isatty(2)) {
+ if (process.stdout.getWindowSize) {
+ width = process.stdout.getWindowSize(1)[0];
+ height = process.stdout.getWindowSize(1)[1];
+ } else if (tty.getWindowSize) {
+ width = tty.getWindowSize()[1];
+ height = tty.getWindowSize()[0];
+ } else if (process.stdout.columns && process.stdout.rows) {
+ height = process.stdout.columns;
+ width = process.stdout.rows;
+ }
+ } else {
+ Error('window-size could not get size with tty or process.stdout.');
+ }
+
+ return {height: height, width: width};
+})();
--- /dev/null
+{
+ "_args": [
+ [
+ {
+ "raw": "window-size@^0.1.1",
+ "scope": null,
+ "escapedName": "window-size",
+ "name": "window-size",
+ "rawSpec": "^0.1.1",
+ "spec": ">=0.1.1 <0.2.0",
+ "type": "range"
+ },
+ "/home/sources/5.0/crosswalk-tizen/wrt/node_modules/yargs"
+ ]
+ ],
+ "_from": "window-size@>=0.1.1 <0.2.0",
+ "_id": "window-size@0.1.4",
+ "_inCache": true,
+ "_location": "/window-size",
+ "_nodeVersion": "5.0.0",
+ "_npmUser": {
+ "name": "jonschlinkert",
+ "email": "github@sellside.com"
+ },
+ "_npmVersion": "3.3.6",
+ "_phantomChildren": {},
+ "_requested": {
+ "raw": "window-size@^0.1.1",
+ "scope": null,
+ "escapedName": "window-size",
+ "name": "window-size",
+ "rawSpec": "^0.1.1",
+ "spec": ">=0.1.1 <0.2.0",
+ "type": "range"
+ },
+ "_requiredBy": [
+ "/yargs"
+ ],
+ "_resolved": "https://registry.npmjs.org/window-size/-/window-size-0.1.4.tgz",
+ "_shasum": "f8e1aa1ee5a53ec5bf151ffa09742a6ad7697876",
+ "_shrinkwrap": null,
+ "_spec": "window-size@^0.1.1",
+ "_where": "/home/sources/5.0/crosswalk-tizen/wrt/node_modules/yargs",
+ "author": {
+ "name": "Jon Schlinkert",
+ "url": "https://github.com/jonschlinkert"
+ },
+ "bin": {
+ "window-size": "cli.js"
+ },
+ "bugs": {
+ "url": "https://github.com/jonschlinkert/window-size/issues"
+ },
+ "dependencies": {},
+ "description": "Reliable way to to get the height and width of the terminal/console in a node.js environment.",
+ "devDependencies": {
+ "semistandard": "^7.0.2",
+ "tap": "^2.2.1"
+ },
+ "directories": {},
+ "dist": {
+ "shasum": "f8e1aa1ee5a53ec5bf151ffa09742a6ad7697876",
+ "tarball": "https://registry.npmjs.org/window-size/-/window-size-0.1.4.tgz"
+ },
+ "engines": {
+ "node": ">= 0.10.0"
+ },
+ "files": [
+ "index.js",
+ "cli.js"
+ ],
+ "gitHead": "619d0da99254adc5c6059c84e3ec2b24564add46",
+ "homepage": "https://github.com/jonschlinkert/window-size",
+ "keywords": [
+ "console",
+ "height",
+ "resize",
+ "size",
+ "terminal",
+ "tty",
+ "width",
+ "window"
+ ],
+ "license": "MIT",
+ "main": "index.js",
+ "maintainers": [
+ {
+ "name": "jonschlinkert",
+ "email": "github@sellside.com"
+ },
+ {
+ "name": "doowb",
+ "email": "brian.woodward@gmail.com"
+ }
+ ],
+ "name": "window-size",
+ "optionalDependencies": {},
+ "readme": "ERROR: No README data found!",
+ "repository": {
+ "type": "git",
+ "url": "git+https://github.com/jonschlinkert/window-size.git"
+ },
+ "scripts": {
+ "pretest": "semistandard",
+ "test": "tap --coverage test.js"
+ },
+ "verb": {
+ "related": {
+ "list": [
+ "yargs",
+ "lint-deps",
+ "base-cli"
+ ]
+ }
+ },
+ "version": "0.1.4"
+}
--- /dev/null
+node_modules
--- /dev/null
+wordwrap
+========
+
+Wrap your words.
+
+example
+=======
+
+made out of meat
+----------------
+
+meat.js
+
+ var wrap = require('wordwrap')(15);
+ console.log(wrap('You and your whole family are made out of meat.'));
+
+output:
+
+ You and your
+ whole family
+ are made out
+ of meat.
+
+centered
+--------
+
+center.js
+
+ var wrap = require('wordwrap')(20, 60);
+ console.log(wrap(
+ 'At long last the struggle and tumult was over.'
+ + ' The machines had finally cast off their oppressors'
+ + ' and were finally free to roam the cosmos.'
+ + '\n'
+ + 'Free of purpose, free of obligation.'
+ + ' Just drifting through emptiness.'
+ + ' The sun was just another point of light.'
+ ));
+
+output:
+
+ At long last the struggle and tumult
+ was over. The machines had finally cast
+ off their oppressors and were finally
+ free to roam the cosmos.
+ Free of purpose, free of obligation.
+ Just drifting through emptiness. The
+ sun was just another point of light.
+
+methods
+=======
+
+var wrap = require('wordwrap');
+
+wrap(stop), wrap(start, stop, params={mode:"soft"})
+---------------------------------------------------
+
+Returns a function that takes a string and returns a new string.
+
+Pad out lines with spaces out to column `start` and then wrap until column
+`stop`. If a word is longer than `stop - start` characters it will overflow.
+
+In "soft" mode, split chunks by `/(\S+\s+/` and don't break up chunks which are
+longer than `stop - start`, in "hard" mode, split chunks with `/\b/` and break
+up chunks longer than `stop - start`.
+
+wrap.hard(start, stop)
+----------------------
+
+Like `wrap()` but with `params.mode = "hard"`.
--- /dev/null
+var wrap = require('wordwrap')(20, 60);
+console.log(wrap(
+ 'At long last the struggle and tumult was over.'
+ + ' The machines had finally cast off their oppressors'
+ + ' and were finally free to roam the cosmos.'
+ + '\n'
+ + 'Free of purpose, free of obligation.'
+ + ' Just drifting through emptiness.'
+ + ' The sun was just another point of light.'
+));
--- /dev/null
+var wrap = require('wordwrap')(15);
+
+console.log(wrap('You and your whole family are made out of meat.'));
--- /dev/null
+var wordwrap = module.exports = function (start, stop, params) {
+ if (typeof start === 'object') {
+ params = start;
+ start = params.start;
+ stop = params.stop;
+ }
+
+ if (typeof stop === 'object') {
+ params = stop;
+ start = start || params.start;
+ stop = undefined;
+ }
+
+ if (!stop) {
+ stop = start;
+ start = 0;
+ }
+
+ if (!params) params = {};
+ var mode = params.mode || 'soft';
+ var re = mode === 'hard' ? /\b/ : /(\S+\s+)/;
+
+ return function (text) {
+ var chunks = text.toString()
+ .split(re)
+ .reduce(function (acc, x) {
+ if (mode === 'hard') {
+ for (var i = 0; i < x.length; i += stop - start) {
+ acc.push(x.slice(i, i + stop - start));
+ }
+ }
+ else acc.push(x)
+ return acc;
+ }, [])
+ ;
+
+ return chunks.reduce(function (lines, rawChunk) {
+ if (rawChunk === '') return lines;
+
+ var chunk = rawChunk.replace(/\t/g, ' ');
+
+ var i = lines.length - 1;
+ if (lines[i].length + chunk.length > stop) {
+ lines[i] = lines[i].replace(/\s+$/, '');
+
+ chunk.split(/\n/).forEach(function (c) {
+ lines.push(
+ new Array(start + 1).join(' ')
+ + c.replace(/^\s+/, '')
+ );
+ });
+ }
+ else if (chunk.match(/\n/)) {
+ var xs = chunk.split(/\n/);
+ lines[i] += xs.shift();
+ xs.forEach(function (c) {
+ lines.push(
+ new Array(start + 1).join(' ')
+ + c.replace(/^\s+/, '')
+ );
+ });
+ }
+ else {
+ lines[i] += chunk;
+ }
+
+ return lines;
+ }, [ new Array(start + 1).join(' ') ]).join('\n');
+ };
+};
+
+wordwrap.soft = wordwrap;
+
+wordwrap.hard = function (start, stop) {
+ return wordwrap(start, stop, { mode : 'hard' });
+};
--- /dev/null
+{
+ "_args": [
+ [
+ {
+ "raw": "wordwrap@0.0.2",
+ "scope": null,
+ "escapedName": "wordwrap",
+ "name": "wordwrap",
+ "rawSpec": "0.0.2",
+ "spec": "0.0.2",
+ "type": "version"
+ },
+ "/home/sources/5.0/crosswalk-tizen/wrt/node_modules/cliui"
+ ]
+ ],
+ "_defaultsLoaded": true,
+ "_engineSupported": true,
+ "_from": "wordwrap@0.0.2",
+ "_id": "wordwrap@0.0.2",
+ "_inCache": true,
+ "_location": "/wordwrap",
+ "_nodeVersion": "v0.5.0-pre",
+ "_npmVersion": "1.0.10",
+ "_phantomChildren": {},
+ "_requested": {
+ "raw": "wordwrap@0.0.2",
+ "scope": null,
+ "escapedName": "wordwrap",
+ "name": "wordwrap",
+ "rawSpec": "0.0.2",
+ "spec": "0.0.2",
+ "type": "version"
+ },
+ "_requiredBy": [
+ "/cliui"
+ ],
+ "_resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.2.tgz",
+ "_shasum": "b79669bb42ecb409f83d583cad52ca17eaa1643f",
+ "_shrinkwrap": null,
+ "_spec": "wordwrap@0.0.2",
+ "_where": "/home/sources/5.0/crosswalk-tizen/wrt/node_modules/cliui",
+ "author": {
+ "name": "James Halliday",
+ "email": "mail@substack.net",
+ "url": "http://substack.net"
+ },
+ "bugs": {
+ "url": "https://github.com/substack/node-wordwrap/issues"
+ },
+ "dependencies": {},
+ "description": "Wrap those words. Show them at what columns to start and stop.",
+ "devDependencies": {
+ "expresso": "=0.7.x"
+ },
+ "directories": {
+ "lib": ".",
+ "example": "example",
+ "test": "test"
+ },
+ "dist": {
+ "shasum": "b79669bb42ecb409f83d583cad52ca17eaa1643f",
+ "tarball": "https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.2.tgz"
+ },
+ "engines": {
+ "node": ">=0.4.0"
+ },
+ "homepage": "https://github.com/substack/node-wordwrap#readme",
+ "keywords": [
+ "word",
+ "wrap",
+ "rule",
+ "format",
+ "column"
+ ],
+ "license": "MIT/X11",
+ "main": "./index.js",
+ "maintainers": [
+ {
+ "name": "substack",
+ "email": "mail@substack.net"
+ }
+ ],
+ "name": "wordwrap",
+ "optionalDependencies": {},
+ "readme": "ERROR: No README data found!",
+ "repository": {
+ "type": "git",
+ "url": "git://github.com/substack/node-wordwrap.git"
+ },
+ "scripts": {
+ "test": "expresso"
+ },
+ "version": "0.0.2"
+}
--- /dev/null
+var assert = require('assert');
+var wordwrap = require('../');
+
+exports.hard = function () {
+ var s = 'Assert from {"type":"equal","ok":false,"found":1,"wanted":2,'
+ + '"stack":[],"id":"b7ddcd4c409de8799542a74d1a04689b",'
+ + '"browser":"chrome/6.0"}'
+ ;
+ var s_ = wordwrap.hard(80)(s);
+
+ var lines = s_.split('\n');
+ assert.equal(lines.length, 2);
+ assert.ok(lines[0].length < 80);
+ assert.ok(lines[1].length < 80);
+
+ assert.equal(s, s_.replace(/\n/g, ''));
+};
+
+exports.break = function () {
+ var s = new Array(55+1).join('a');
+ var s_ = wordwrap.hard(20)(s);
+
+ var lines = s_.split('\n');
+ assert.equal(lines.length, 3);
+ assert.ok(lines[0].length === 20);
+ assert.ok(lines[1].length === 20);
+ assert.ok(lines[2].length === 15);
+
+ assert.equal(s, s_.replace(/\n/g, ''));
+};
--- /dev/null
+In Praise of Idleness
+
+By Bertrand Russell
+
+[1932]
+
+Like most of my generation, I was brought up on the saying: 'Satan finds some mischief for idle hands to do.' Being a highly virtuous child, I believed all that I was told, and acquired a conscience which has kept me working hard down to the present moment. But although my conscience has controlled my actions, my opinions have undergone a revolution. I think that there is far too much work done in the world, that immense harm is caused by the belief that work is virtuous, and that what needs to be preached in modern industrial countries is quite different from what always has been preached. Everyone knows the story of the traveler in Naples who saw twelve beggars lying in the sun (it was before the days of Mussolini), and offered a lira to the laziest of them. Eleven of them jumped up to claim it, so he gave it to the twelfth. this traveler was on the right lines. But in countries which do not enjoy Mediterranean sunshine idleness is more difficult, and a great public propaganda will be required to inaugurate it. I hope that, after reading the following pages, the leaders of the YMCA will start a campaign to induce good young men to do nothing. If so, I shall not have lived in vain.
+
+Before advancing my own arguments for laziness, I must dispose of one which I cannot accept. Whenever a person who already has enough to live on proposes to engage in some everyday kind of job, such as school-teaching or typing, he or she is told that such conduct takes the bread out of other people's mouths, and is therefore wicked. If this argument were valid, it would only be necessary for us all to be idle in order that we should all have our mouths full of bread. What people who say such things forget is that what a man earns he usually spends, and in spending he gives employment. As long as a man spends his income, he puts just as much bread into people's mouths in spending as he takes out of other people's mouths in earning. The real villain, from this point of view, is the man who saves. If he merely puts his savings in a stocking, like the proverbial French peasant, it is obvious that they do not give employment. If he invests his savings, the matter is less obvious, and different cases arise.
+
+One of the commonest things to do with savings is to lend them to some Government. In view of the fact that the bulk of the public expenditure of most civilized Governments consists in payment for past wars or preparation for future wars, the man who lends his money to a Government is in the same position as the bad men in Shakespeare who hire murderers. The net result of the man's economical habits is to increase the armed forces of the State to which he lends his savings. Obviously it would be better if he spent the money, even if he spent it in drink or gambling.
+
+But, I shall be told, the case is quite different when savings are invested in industrial enterprises. When such enterprises succeed, and produce something useful, this may be conceded. In these days, however, no one will deny that most enterprises fail. That means that a large amount of human labor, which might have been devoted to producing something that could be enjoyed, was expended on producing machines which, when produced, lay idle and did no good to anyone. The man who invests his savings in a concern that goes bankrupt is therefore injuring others as well as himself. If he spent his money, say, in giving parties for his friends, they (we may hope) would get pleasure, and so would all those upon whom he spent money, such as the butcher, the baker, and the bootlegger. But if he spends it (let us say) upon laying down rails for surface card in some place where surface cars turn out not to be wanted, he has diverted a mass of labor into channels where it gives pleasure to no one. Nevertheless, when he becomes poor through failure of his investment he will be regarded as a victim of undeserved misfortune, whereas the gay spendthrift, who has spent his money philanthropically, will be despised as a fool and a frivolous person.
+
+All this is only preliminary. I want to say, in all seriousness, that a great deal of harm is being done in the modern world by belief in the virtuousness of work, and that the road to happiness and prosperity lies in an organized diminution of work.
+
+First of all: what is work? Work is of two kinds: first, altering the position of matter at or near the earth's surface relatively to other such matter; second, telling other people to do so. The first kind is unpleasant and ill paid; the second is pleasant and highly paid. The second kind is capable of indefinite extension: there are not only those who give orders, but those who give advice as to what orders should be given. Usually two opposite kinds of advice are given simultaneously by two organized bodies of men; this is called politics. The skill required for this kind of work is not knowledge of the subjects as to which advice is given, but knowledge of the art of persuasive speaking and writing, i.e. of advertising.
+
+Throughout Europe, though not in America, there is a third class of men, more respected than either of the classes of workers. There are men who, through ownership of land, are able to make others pay for the privilege of being allowed to exist and to work. These landowners are idle, and I might therefore be expected to praise them. Unfortunately, their idleness is only rendered possible by the industry of others; indeed their desire for comfortable idleness is historically the source of the whole gospel of work. The last thing they have ever wished is that others should follow their example.
+
+From the beginning of civilization until the Industrial Revolution, a man could, as a rule, produce by hard work little more than was required for the subsistence of himself and his family, although his wife worked at least as hard as he did, and his children added their labor as soon as they were old enough to do so. The small surplus above bare necessaries was not left to those who produced it, but was appropriated by warriors and priests. In times of famine there was no surplus; the warriors and priests, however, still secured as much as at other times, with the result that many of the workers died of hunger. This system persisted in Russia until 1917 [1], and still persists in the East; in England, in spite of the Industrial Revolution, it remained in full force throughout the Napoleonic wars, and until a hundred years ago, when the new class of manufacturers acquired power. In America, the system came to an end with the Revolution, except in the South, where it persisted until the Civil War. A system which lasted so long and ended so recently has naturally left a profound impress upon men's thoughts and opinions. Much that we take for granted about the desirability of work is derived from this system, and, being pre-industrial, is not adapted to the modern world. Modern technique has made it possible for leisure, within limits, to be not the prerogative of small privileged classes, but a right evenly distributed throughout the community. The morality of work is the morality of slaves, and the modern world has no need of slavery.
+
+It is obvious that, in primitive communities, peasants, left to themselves, would not have parted with the slender surplus upon which the warriors and priests subsisted, but would have either produced less or consumed more. At first, sheer force compelled them to produce and part with the surplus. Gradually, however, it was found possible to induce many of them to accept an ethic according to which it was their duty to work hard, although part of their work went to support others in idleness. By this means the amount of compulsion required was lessened, and the expenses of government were diminished. To this day, 99 per cent of British wage-earners would be genuinely shocked if it were proposed that the King should not have a larger income than a working man. The conception of duty, speaking historically, has been a means used by the holders of power to induce others to live for the interests of their masters rather than for their own. Of course the holders of power conceal this fact from themselves by managing to believe that their interests are identical with the larger interests of humanity. Sometimes this is true; Athenian slave-owners, for instance, employed part of their leisure in making a permanent contribution to civilization which would have been impossible under a just economic system. Leisure is essential to civilization, and in former times leisure for the few was only rendered possible by the labors of the many. But their labors were valuable, not because work is good, but because leisure is good. And with modern technique it would be possible to distribute leisure justly without injury to civilization.
+
+Modern technique has made it possible to diminish enormously the amount of labor required to secure the necessaries of life for everyone. This was made obvious during the war. At that time all the men in the armed forces, and all the men and women engaged in the production of munitions, all the men and women engaged in spying, war propaganda, or Government offices connected with the war, were withdrawn from productive occupations. In spite of this, the general level of well-being among unskilled wage-earners on the side of the Allies was higher than before or since. The significance of this fact was concealed by finance: borrowing made it appear as if the future was nourishing the present. But that, of course, would have been impossible; a man cannot eat a loaf of bread that does not yet exist. The war showed conclusively that, by the scientific organization of production, it is possible to keep modern populations in fair comfort on a small part of the working capacity of the modern world. If, at the end of the war, the scientific organization, which had been created in order to liberate men for fighting and munition work, had been preserved, and the hours of the week had been cut down to four, all would have been well. Instead of that the old chaos was restored, those whose work was demanded were made to work long hours, and the rest were left to starve as unemployed. Why? Because work is a duty, and a man should not receive wages in proportion to what he has produced, but in proportion to his virtue as exemplified by his industry.
+
+This is the morality of the Slave State, applied in circumstances totally unlike those in which it arose. No wonder the result has been disastrous. Let us take an illustration. Suppose that, at a given moment, a certain number of people are engaged in the manufacture of pins. They make as many pins as the world needs, working (say) eight hours a day. Someone makes an invention by which the same number of men can make twice as many pins: pins are already so cheap that hardly any more will be bought at a lower price. In a sensible world, everybody concerned in the manufacturing of pins would take to working four hours instead of eight, and everything else would go on as before. But in the actual world this would be thought demoralizing. The men still work eight hours, there are too many pins, some employers go bankrupt, and half the men previously concerned in making pins are thrown out of work. There is, in the end, just as much leisure as on the other plan, but half the men are totally idle while half are still overworked. In this way, it is insured that the unavoidable leisure shall cause misery all round instead of being a universal source of happiness. Can anything more insane be imagined?
+
+The idea that the poor should have leisure has always been shocking to the rich. In England, in the early nineteenth century, fifteen hours was the ordinary day's work for a man; children sometimes did as much, and very commonly did twelve hours a day. When meddlesome busybodies suggested that perhaps these hours were rather long, they were told that work kept adults from drink and children from mischief. When I was a child, shortly after urban working men had acquired the vote, certain public holidays were established by law, to the great indignation of the upper classes. I remember hearing an old Duchess say: 'What do the poor want with holidays? They ought to work.' People nowadays are less frank, but the sentiment persists, and is the source of much of our economic confusion.
+
+Let us, for a moment, consider the ethics of work frankly, without superstition. Every human being, of necessity, consumes, in the course of his life, a certain amount of the produce of human labor. Assuming, as we may, that labor is on the whole disagreeable, it is unjust that a man should consume more than he produces. Of course he may provide services rather than commodities, like a medical man, for example; but he should provide something in return for his board and lodging. to this extent, the duty of work must be admitted, but to this extent only.
+
+I shall not dwell upon the fact that, in all modern societies outside the USSR, many people escape even this minimum amount of work, namely all those who inherit money and all those who marry money. I do not think the fact that these people are allowed to be idle is nearly so harmful as the fact that wage-earners are expected to overwork or starve.
+
+If the ordinary wage-earner worked four hours a day, there would be enough for everybody and no unemployment -- assuming a certain very moderate amount of sensible organization. This idea shocks the well-to-do, because they are convinced that the poor would not know how to use so much leisure. In America men often work long hours even when they are well off; such men, naturally, are indignant at the idea of leisure for wage-earners, except as the grim punishment of unemployment; in fact, they dislike leisure even for their sons. Oddly enough, while they wish their sons to work so hard as to have no time to be civilized, they do not mind their wives and daughters having no work at all. the snobbish admiration of uselessness, which, in an aristocratic society, extends to both sexes, is, under a plutocracy, confined to women; this, however, does not make it any more in agreement with common sense.
+
+The wise use of leisure, it must be conceded, is a product of civilization and education. A man who has worked long hours all his life will become bored if he becomes suddenly idle. But without a considerable amount of leisure a man is cut off from many of the best things. There is no longer any reason why the bulk of the population should suffer this deprivation; only a foolish asceticism, usually vicarious, makes us continue to insist on work in excessive quantities now that the need no longer exists.
+
+In the new creed which controls the government of Russia, while there is much that is very different from the traditional teaching of the West, there are some things that are quite unchanged. The attitude of the governing classes, and especially of those who conduct educational propaganda, on the subject of the dignity of labor, is almost exactly that which the governing classes of the world have always preached to what were called the 'honest poor'. Industry, sobriety, willingness to work long hours for distant advantages, even submissiveness to authority, all these reappear; moreover authority still represents the will of the Ruler of the Universe, Who, however, is now called by a new name, Dialectical Materialism.
+
+The victory of the proletariat in Russia has some points in common with the victory of the feminists in some other countries. For ages, men had conceded the superior saintliness of women, and had consoled women for their inferiority by maintaining that saintliness is more desirable than power. At last the feminists decided that they would have both, since the pioneers among them believed all that the men had told them about the desirability of virtue, but not what they had told them about the worthlessness of political power. A similar thing has happened in Russia as regards manual work. For ages, the rich and their sycophants have written in praise of 'honest toil', have praised the simple life, have professed a religion which teaches that the poor are much more likely to go to heaven than the rich, and in general have tried to make manual workers believe that there is some special nobility about altering the position of matter in space, just as men tried to make women believe that they derived some special nobility from their sexual enslavement. In Russia, all this teaching about the excellence of manual work has been taken seriously, with the result that the manual worker is more honored than anyone else. What are, in essence, revivalist appeals are made, but not for the old purposes: they are made to secure shock workers for special tasks. Manual work is the ideal which is held before the young, and is the basis of all ethical teaching.
+
+For the present, possibly, this is all to the good. A large country, full of natural resources, awaits development, and has has to be developed with very little use of credit. In these circumstances, hard work is necessary, and is likely to bring a great reward. But what will happen when the point has been reached where everybody could be comfortable without working long hours?
+
+In the West, we have various ways of dealing with this problem. We have no attempt at economic justice, so that a large proportion of the total produce goes to a small minority of the population, many of whom do no work at all. Owing to the absence of any central control over production, we produce hosts of things that are not wanted. We keep a large percentage of the working population idle, because we can dispense with their labor by making the others overwork. When all these methods prove inadequate, we have a war: we cause a number of people to manufacture high explosives, and a number of others to explode them, as if we were children who had just discovered fireworks. By a combination of all these devices we manage, though with difficulty, to keep alive the notion that a great deal of severe manual work must be the lot of the average man.
+
+In Russia, owing to more economic justice and central control over production, the problem will have to be differently solved. the rational solution would be, as soon as the necessaries and elementary comforts can be provided for all, to reduce the hours of labor gradually, allowing a popular vote to decide, at each stage, whether more leisure or more goods were to be preferred. But, having taught the supreme virtue of hard work, it is difficult to see how the authorities can aim at a paradise in which there will be much leisure and little work. It seems more likely that they will find continually fresh schemes, by which present leisure is to be sacrificed to future productivity. I read recently of an ingenious plan put forward by Russian engineers, for making the White Sea and the northern coasts of Siberia warm, by putting a dam across the Kara Sea. An admirable project, but liable to postpone proletarian comfort for a generation, while the nobility of toil is being displayed amid the ice-fields and snowstorms of the Arctic Ocean. This sort of thing, if it happens, will be the result of regarding the virtue of hard work as an end in itself, rather than as a means to a state of affairs in which it is no longer needed.
+
+The fact is that moving matter about, while a certain amount of it is necessary to our existence, is emphatically not one of the ends of human life. If it were, we should have to consider every navvy superior to Shakespeare. We have been misled in this matter by two causes. One is the necessity of keeping the poor contented, which has led the rich, for thousands of years, to preach the dignity of labor, while taking care themselves to remain undignified in this respect. The other is the new pleasure in mechanism, which makes us delight in the astonishingly clever changes that we can produce on the earth's surface. Neither of these motives makes any great appeal to the actual worker. If you ask him what he thinks the best part of his life, he is not likely to say: 'I enjoy manual work because it makes me feel that I am fulfilling man's noblest task, and because I like to think how much man can transform his planet. It is true that my body demands periods of rest, which I have to fill in as best I may, but I am never so happy as when the morning comes and I can return to the toil from which my contentment springs.' I have never heard working men say this sort of thing. They consider work, as it should be considered, a necessary means to a livelihood, and it is from their leisure that they derive whatever happiness they may enjoy.
+
+It will be said that, while a little leisure is pleasant, men would not know how to fill their days if they had only four hours of work out of the twenty-four. In so far as this is true in the modern world, it is a condemnation of our civilization; it would not have been true at any earlier period. There was formerly a capacity for light-heartedness and play which has been to some extent inhibited by the cult of efficiency. The modern man thinks that everything ought to be done for the sake of something else, and never for its own sake. Serious-minded persons, for example, are continually condemning the habit of going to the cinema, and telling us that it leads the young into crime. But all the work that goes to producing a cinema is respectable, because it is work, and because it brings a money profit. The notion that the desirable activities are those that bring a profit has made everything topsy-turvy. The butcher who provides you with meat and the baker who provides you with bread are praiseworthy, because they are making money; but when you enjoy the food they have provided, you are merely frivolous, unless you eat only to get strength for your work. Broadly speaking, it is held that getting money is good and spending money is bad. Seeing that they are two sides of one transaction, this is absurd; one might as well maintain that keys are good, but keyholes are bad. Whatever merit there may be in the production of goods must be entirely derivative from the advantage to be obtained by consuming them. The individual, in our society, works for profit; but the social purpose of his work lies in the consumption of what he produces. It is this divorce between the individual and the social purpose of production that makes it so difficult for men to think clearly in a world in which profit-making is the incentive to industry. We think too much of production, and too little of consumption. One result is that we attach too little importance to enjoyment and simple happiness, and that we do not judge production by the pleasure that it gives to the consumer.
+
+When I suggest that working hours should be reduced to four, I am not meaning to imply that all the remaining time should necessarily be spent in pure frivolity. I mean that four hours' work a day should entitle a man to the necessities and elementary comforts of life, and that the rest of his time should be his to use as he might see fit. It is an essential part of any such social system that education should be carried further than it usually is at present, and should aim, in part, at providing tastes which would enable a man to use leisure intelligently. I am not thinking mainly of the sort of things that would be considered 'highbrow'. Peasant dances have died out except in remote rural areas, but the impulses which caused them to be cultivated must still exist in human nature. The pleasures of urban populations have become mainly passive: seeing cinemas, watching football matches, listening to the radio, and so on. This results from the fact that their active energies are fully taken up with work; if they had more leisure, they would again enjoy pleasures in which they took an active part.
+
+In the past, there was a small leisure class and a larger working class. The leisure class enjoyed advantages for which there was no basis in social justice; this necessarily made it oppressive, limited its sympathies, and caused it to invent theories by which to justify its privileges. These facts greatly diminished its excellence, but in spite of this drawback it contributed nearly the whole of what we call civilization. It cultivated the arts and discovered the sciences; it wrote the books, invented the philosophies, and refined social relations. Even the liberation of the oppressed has usually been inaugurated from above. Without the leisure class, mankind would never have emerged from barbarism.
+
+The method of a leisure class without duties was, however, extraordinarily wasteful. None of the members of the class had to be taught to be industrious, and the class as a whole was not exceptionally intelligent. The class might produce one Darwin, but against him had to be set tens of thousands of country gentlemen who never thought of anything more intelligent than fox-hunting and punishing poachers. At present, the universities are supposed to provide, in a more systematic way, what the leisure class provided accidentally and as a by-product. This is a great improvement, but it has certain drawbacks. University life is so different from life in the world at large that men who live in academic milieu tend to be unaware of the preoccupations and problems of ordinary men and women; moreover their ways of expressing themselves are usually such as to rob their opinions of the influence that they ought to have upon the general public. Another disadvantage is that in universities studies are organized, and the man who thinks of some original line of research is likely to be discouraged. Academic institutions, therefore, useful as they are, are not adequate guardians of the interests of civilization in a world where everyone outside their walls is too busy for unutilitarian pursuits.
+
+In a world where no one is compelled to work more than four hours a day, every person possessed of scientific curiosity will be able to indulge it, and every painter will be able to paint without starving, however excellent his pictures may be. Young writers will not be obliged to draw attention to themselves by sensational pot-boilers, with a view to acquiring the economic independence needed for monumental works, for which, when the time at last comes, they will have lost the taste and capacity. Men who, in their professional work, have become interested in some phase of economics or government, will be able to develop their ideas without the academic detachment that makes the work of university economists often seem lacking in reality. Medical men will have the time to learn about the progress of medicine, teachers will not be exasperatedly struggling to teach by routine methods things which they learnt in their youth, which may, in the interval, have been proved to be untrue.
+
+Above all, there will be happiness and joy of life, instead of frayed nerves, weariness, and dyspepsia. The work exacted will be enough to make leisure delightful, but not enough to produce exhaustion. Since men will not be tired in their spare time, they will not demand only such amusements as are passive and vapid. At least one per cent will probably devote the time not spent in professional work to pursuits of some public importance, and, since they will not depend upon these pursuits for their livelihood, their originality will be unhampered, and there will be no need to conform to the standards set by elderly pundits. But it is not only in these exceptional cases that the advantages of leisure will appear. Ordinary men and women, having the opportunity of a happy life, will become more kindly and less persecuting and less inclined to view others with suspicion. The taste for war will die out, partly for this reason, and partly because it will involve long and severe work for all. Good nature is, of all moral qualities, the one that the world needs most, and good nature is the result of ease and security, not of a life of arduous struggle. Modern methods of production have given us the possibility of ease and security for all; we have chosen, instead, to have overwork for some and starvation for others. Hitherto we have continued to be as energetic as we were before there were machines; in this we have been foolish, but there is no reason to go on being foolish forever.
+
+[1] Since then, members of the Communist Party have succeeded to this privilege of the warriors and priests.
--- /dev/null
+var assert = require('assert');
+var wordwrap = require('wordwrap');
+
+var fs = require('fs');
+var idleness = fs.readFileSync(__dirname + '/idleness.txt', 'utf8');
+
+exports.stop80 = function () {
+ var lines = wordwrap(80)(idleness).split(/\n/);
+ var words = idleness.split(/\s+/);
+
+ lines.forEach(function (line) {
+ assert.ok(line.length <= 80, 'line > 80 columns');
+ var chunks = line.match(/\S/) ? line.split(/\s+/) : [];
+ assert.deepEqual(chunks, words.splice(0, chunks.length));
+ });
+};
+
+exports.start20stop60 = function () {
+ var lines = wordwrap(20, 100)(idleness).split(/\n/);
+ var words = idleness.split(/\s+/);
+
+ lines.forEach(function (line) {
+ assert.ok(line.length <= 100, 'line > 100 columns');
+ var chunks = line
+ .split(/\s+/)
+ .filter(function (x) { return x.match(/\S/) })
+ ;
+ assert.deepEqual(chunks, words.splice(0, chunks.length));
+ assert.deepEqual(line.slice(0, 20), new Array(20 + 1).join(' '));
+ });
+};
--- /dev/null
+Copyright (c) 2015, Contributors
+
+Permission to use, copy, modify, and/or distribute this software for any purpose
+with or without fee is hereby granted, provided that the above copyright notice
+and this permission notice appear in all copies.
+
+THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
+REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
+FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
+INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
+OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
+TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
+THIS SOFTWARE.
--- /dev/null
+# y18n
+
+[![Build Status][travis-image]][travis-url]
+[![Coverage Status][coveralls-image]][coveralls-url]
+[![NPM version][npm-image]][npm-url]
+[![js-standard-style][standard-image]][standard-url]
+
+The bare-bones internationalization library used by yargs.
+
+Inspired by [i18n](https://www.npmjs.com/package/i18n).
+
+## Examples
+
+_simple string translation:_
+
+```js
+var __ = require('y18n').__
+
+console.log(__('my awesome string %s', 'foo'))
+```
+
+output:
+
+`my awesome string foo`
+
+_pluralization support:_
+
+```js
+var __n = require('y18n').__n
+
+console.log(__n('one fish %s', '%d fishes %s', 2, 'foo'))
+```
+
+output:
+
+`2 fishes foo`
+
+## JSON Language Files
+
+The JSON language files should be stored in a `./locales` folder.
+File names correspond to locales, e.g., `en.json`, `pirate.json`.
+
+When strings are observed for the first time they will be
+added to the JSON file corresponding to the current locale.
+
+## Methods
+
+### require('y18n')(config)
+
+Create an instance of y18n with the config provided, options include:
+
+* `directory`: the locale directory, default `./locales`.
+* `updateFiles`: should newly observed strings be updated in file, default `true`.
+* `locale`: what locale should be used.
+* `fallbackToLanguage`: should fallback to a language-only file (e.g. `en.json`)
+ be allowed if a file matching the locale does not exist (e.g. `en_US.json`),
+ default `true`.
+
+### y18n.\_\_(str, arg, arg, arg)
+
+Print a localized string, `%s` will be replaced with `arg`s.
+
+### y18n.\_\_n(singularString, pluralString, count, arg, arg, arg)
+
+Print a localized string with appropriate pluralization. If `%d` is provided
+in the string, the `count` will replace this placeholder.
+
+### y18n.setLocale(str)
+
+Set the current locale being used.
+
+### y18n.getLocale()
+
+What locale is currently being used?
+
+### y18n.updateLocale(obj)
+
+Update the current locale with the key value pairs in `obj`.
+
+## License
+
+ISC
+
+[travis-url]: https://travis-ci.org/yargs/y18n
+[travis-image]: https://img.shields.io/travis/yargs/y18n.svg
+[coveralls-url]: https://coveralls.io/github/yargs/y18n
+[coveralls-image]: https://img.shields.io/coveralls/yargs/y18n.svg
+[npm-url]: https://npmjs.org/package/y18n
+[npm-image]: https://img.shields.io/npm/v/y18n.svg
+[standard-image]: https://img.shields.io/badge/code%20style-standard-brightgreen.svg
+[standard-url]: https://github.com/feross/standard
--- /dev/null
+var fs = require('fs')
+var path = require('path')
+var util = require('util')
+
+function Y18N (opts) {
+ // configurable options.
+ opts = opts || {}
+ this.directory = opts.directory || './locales'
+ this.updateFiles = typeof opts.updateFiles === 'boolean' ? opts.updateFiles : true
+ this.locale = opts.locale || 'en'
+ this.fallbackToLanguage = typeof opts.fallbackToLanguage === 'boolean' ? opts.fallbackToLanguage : true
+
+ // internal stuff.
+ this.cache = {}
+ this.writeQueue = []
+}
+
+Y18N.prototype.__ = function () {
+ var args = Array.prototype.slice.call(arguments)
+ var str = args.shift()
+ var cb = function () {} // start with noop.
+
+ if (typeof args[args.length - 1] === 'function') cb = args.pop()
+ cb = cb || function () {} // noop.
+
+ if (!this.cache[this.locale]) this._readLocaleFile()
+
+ // we've observed a new string, update the language file.
+ if (!this.cache[this.locale][str] && this.updateFiles) {
+ this.cache[this.locale][str] = str
+
+ // include the current directory and locale,
+ // since these values could change before the
+ // write is performed.
+ this._enqueueWrite([this.directory, this.locale, cb])
+ } else {
+ cb()
+ }
+
+ return util.format.apply(util, [this.cache[this.locale][str] || str].concat(args))
+}
+
+Y18N.prototype._enqueueWrite = function (work) {
+ this.writeQueue.push(work)
+ if (this.writeQueue.length === 1) this._processWriteQueue()
+}
+
+Y18N.prototype._processWriteQueue = function () {
+ var _this = this
+ var work = this.writeQueue[0]
+
+ // destructure the enqueued work.
+ var directory = work[0]
+ var locale = work[1]
+ var cb = work[2]
+
+ var languageFile = this._resolveLocaleFile(directory, locale)
+ var serializedLocale = JSON.stringify(this.cache[locale], null, 2)
+
+ fs.writeFile(languageFile, serializedLocale, 'utf-8', function (err) {
+ _this.writeQueue.shift()
+ if (_this.writeQueue.length > 0) _this._processWriteQueue()
+ cb(err)
+ })
+}
+
+Y18N.prototype._readLocaleFile = function () {
+ var localeLookup = {}
+ var languageFile = this._resolveLocaleFile(this.directory, this.locale)
+
+ try {
+ localeLookup = JSON.parse(fs.readFileSync(languageFile, 'utf-8'))
+ } catch (err) {
+ if (err instanceof SyntaxError) {
+ err.message = 'syntax error in ' + languageFile
+ }
+
+ if (err.code === 'ENOENT') localeLookup = {}
+ else throw err
+ }
+
+ this.cache[this.locale] = localeLookup
+}
+
+Y18N.prototype._resolveLocaleFile = function (directory, locale) {
+ var file = path.resolve(directory, './', locale + '.json')
+ if (this.fallbackToLanguage && !this._fileExistsSync(file) && ~locale.lastIndexOf('_')) {
+ // attempt fallback to language only
+ var languageFile = path.resolve(directory, './', locale.split('_')[0] + '.json')
+ if (this._fileExistsSync(languageFile)) file = languageFile
+ }
+ return file
+}
+
+// this only exists because fs.existsSync() "will be deprecated"
+// see https://nodejs.org/api/fs.html#fs_fs_existssync_path
+Y18N.prototype._fileExistsSync = function (file) {
+ try {
+ return fs.statSync(file).isFile()
+ } catch (err) {
+ return false
+ }
+}
+
+Y18N.prototype.__n = function () {
+ var args = Array.prototype.slice.call(arguments)
+ var singular = args.shift()
+ var plural = args.shift()
+ var quantity = args.shift()
+
+ var cb = function () {} // start with noop.
+ if (typeof args[args.length - 1] === 'function') cb = args.pop()
+
+ if (!this.cache[this.locale]) this._readLocaleFile()
+
+ var str = quantity === 1 ? singular : plural
+ if (this.cache[this.locale][singular]) {
+ str = this.cache[this.locale][singular][quantity === 1 ? 'one' : 'other']
+ }
+
+ // we've observed a new string, update the language file.
+ if (!this.cache[this.locale][singular] && this.updateFiles) {
+ this.cache[this.locale][singular] = {
+ one: singular,
+ other: plural
+ }
+
+ // include the current directory and locale,
+ // since these values could change before the
+ // write is performed.
+ this._enqueueWrite([this.directory, this.locale, cb])
+ } else {
+ cb()
+ }
+
+ // if a %d placeholder is provided, add quantity
+ // to the arguments expanded by util.format.
+ var values = [str]
+ if (~str.indexOf('%d')) values.push(quantity)
+
+ return util.format.apply(util, values.concat(args))
+}
+
+Y18N.prototype.setLocale = function (locale) {
+ this.locale = locale
+}
+
+Y18N.prototype.getLocale = function () {
+ return this.locale
+}
+
+Y18N.prototype.updateLocale = function (obj) {
+ if (!this.cache[this.locale]) this._readLocaleFile()
+
+ for (var key in obj) {
+ this.cache[this.locale][key] = obj[key]
+ }
+}
+
+module.exports = function (opts) {
+ var y18n = new Y18N(opts)
+
+ // bind all functions to y18n, so that
+ // they can be used in isolation.
+ for (var key in y18n) {
+ if (typeof y18n[key] === 'function') {
+ y18n[key] = y18n[key].bind(y18n)
+ }
+ }
+
+ return y18n
+}
--- /dev/null
+{
+ "_args": [
+ [
+ {
+ "raw": "y18n@^3.0.0",
+ "scope": null,
+ "escapedName": "y18n",
+ "name": "y18n",
+ "rawSpec": "^3.0.0",
+ "spec": ">=3.0.0 <4.0.0",
+ "type": "range"
+ },
+ "/home/sources/5.0/crosswalk-tizen/wrt/node_modules/yargs"
+ ]
+ ],
+ "_from": "y18n@>=3.0.0 <4.0.0",
+ "_id": "y18n@3.2.1",
+ "_inCache": true,
+ "_location": "/y18n",
+ "_nodeVersion": "3.2.0",
+ "_npmOperationalInternal": {
+ "host": "packages-13-west.internal.npmjs.com",
+ "tmp": "tmp/y18n-3.2.1.tgz_1458191070611_0.9606689948122948"
+ },
+ "_npmUser": {
+ "name": "bcoe",
+ "email": "ben@npmjs.com"
+ },
+ "_npmVersion": "3.3.0",
+ "_phantomChildren": {},
+ "_requested": {
+ "raw": "y18n@^3.0.0",
+ "scope": null,
+ "escapedName": "y18n",
+ "name": "y18n",
+ "rawSpec": "^3.0.0",
+ "spec": ">=3.0.0 <4.0.0",
+ "type": "range"
+ },
+ "_requiredBy": [
+ "/yargs"
+ ],
+ "_resolved": "https://registry.npmjs.org/y18n/-/y18n-3.2.1.tgz",
+ "_shasum": "6d15fba884c08679c0d77e88e7759e811e07fa41",
+ "_shrinkwrap": null,
+ "_spec": "y18n@^3.0.0",
+ "_where": "/home/sources/5.0/crosswalk-tizen/wrt/node_modules/yargs",
+ "author": {
+ "name": "Ben Coe",
+ "email": "ben@npmjs.com"
+ },
+ "bugs": {
+ "url": "https://github.com/yargs/y18n/issues"
+ },
+ "dependencies": {},
+ "description": "the bare-bones internationalization library used by yargs",
+ "devDependencies": {
+ "chai": "^3.4.1",
+ "coveralls": "^2.11.6",
+ "mocha": "^2.3.4",
+ "nyc": "^6.1.1",
+ "rimraf": "^2.5.0",
+ "standard": "^5.4.1"
+ },
+ "directories": {},
+ "dist": {
+ "shasum": "6d15fba884c08679c0d77e88e7759e811e07fa41",
+ "tarball": "https://registry.npmjs.org/y18n/-/y18n-3.2.1.tgz"
+ },
+ "files": [
+ "index.js"
+ ],
+ "gitHead": "34d6ad7bfeac67721ccbcf3bbcc761f33d787c90",
+ "homepage": "https://github.com/yargs/y18n",
+ "keywords": [
+ "i18n",
+ "internationalization",
+ "yargs"
+ ],
+ "license": "ISC",
+ "main": "index.js",
+ "maintainers": [
+ {
+ "name": "bcoe",
+ "email": "ben@npmjs.com"
+ },
+ {
+ "name": "nexdrew",
+ "email": "andrew@npmjs.com"
+ }
+ ],
+ "name": "y18n",
+ "optionalDependencies": {},
+ "readme": "ERROR: No README data found!",
+ "repository": {
+ "type": "git",
+ "url": "git+ssh://git@github.com/yargs/y18n.git"
+ },
+ "scripts": {
+ "coverage": "nyc report --reporter=text-lcov | coveralls",
+ "pretest": "standard",
+ "test": "nyc mocha"
+ },
+ "version": "3.2.1"
+}
--- /dev/null
+## Change Log
+
+### v3.19.0 (2015/08/14 05:12 +00:00)
+- [#224](https://github.com/bcoe/yargs/pull/224) added Portuguese translation (@codemonkey3045)
+
+### v3.18.1 (2015/08/12 05:53 +00:00)
+
+- [#228](https://github.com/bcoe/yargs/pull/228) notes about embedding yargs in Electron (@etiktin)
+- [#223](https://github.com/bcoe/yargs/pull/223) make booleans work in config files (@sgentle)
+
+### v3.18.0 (2015/08/06 20:05 +00:00)
+- [#222](https://github.com/bcoe/yargs/pull/222) updates fr locale (@nexdrew)
+- [#221](https://github.com/bcoe/yargs/pull/221) adds missing locale strings (@nexdrew)
+- [#220](https://github.com/bcoe/yargs/pull/220) adds es locale (@zkat)
+
+### v3.17.1 (2015/08/02 19:35 +00:00)
+- [#218](https://github.com/bcoe/yargs/pull/218) upgrades nyc (@bcoe)
+
+### v3.17.0 (2015/08/02 18:39 +00:00)
+- [#217](https://github.com/bcoe/yargs/pull/217) sort methods in README.md (@nexdrew)
+- [#215](https://github.com/bcoe/yargs/pull/215) adds fr locale (@LoicMahieu)
+
+### v3.16.0 (2015/07/30 04:35 +00:00)
+- [#210](https://github.com/bcoe/yargs/pull/210) adds i18n support to yargs (@bcoe)
+- [#209](https://github.com/bcoe/yargs/pull/209) adds choices type to yargs (@nexdrew)
+- [#207](https://github.com/bcoe/yargs/pull/207) pretty new shields from shields.io (@SimenB)
+- [#208](https://github.com/bcoe/yargs/pull/208) improvements to README.md (@nexdrew)
+- [#205](https://github.com/bcoe/yargs/pull/205) faster build times on Travis (@ChristianMurphy)
+
+### v3.15.0 (2015/07/06 06:01 +00:00)
+- [#197](https://github.com/bcoe/yargs/pull/197) tweaks to how errors bubble up from parser.js (@bcoe)
+- [#193](https://github.com/bcoe/yargs/pull/193) upgraded nyc, reporting now happens by default (@bcoe)
+
+### v3.14.0 (2015/06/28 02:12 +00:00)
+
+- [#192](https://github.com/bcoe/yargs/pull/192) standard style nits (@bcoe)
+- [#190](https://github.com/bcoe/yargs/pull/190) allow for hidden commands, e.g.,
+ .completion('completion', false) (@tschaub)
+
+### v3.13.0 (2015/06/24 04:12 +00:00)
+
+- [#187](https://github.com/bcoe/yargs/pull/187) completion now behaves differently
+ if it is being run in the context of a command (@tschaub)
+- [#186](https://github.com/bcoe/yargs/pull/186) if no matches are found for a completion
+ default to filename completion (@tschaub)
+
+### v3.12.0 (2015/06/19 03:23 +00:00)
+- [#183](https://github.com/bcoe/yargs/pull/183) don't complete commands if they've already been completed (@tschaub)
+- [#181](https://github.com/bcoe/yargs/pull/181) various fixes for completion. (@bcoe, @tschaub)
+- [#182](https://github.com/bcoe/yargs/pull/182) you can now set a maximum # of of required arguments (@bcoe)
+
+### v3.11.0 (2015/06/15 05:15 +00:00)
+
+- [#173](https://github.com/bcoe/yargs/pull/173) update standard, window-size, chai (@bcoe)
+- [#171](https://github.com/bcoe/yargs/pull/171) a description can now be set
+ when providing a config option. (@5c077yP)
+
+### v3.10.0 (2015/05/29 04:25 +00:00)
+
+- [#165](https://github.com/bcoe/yargs/pull/165) expose yargs.terminalWidth() thanks @ensonic (@bcoe)
+- [#164](https://github.com/bcoe/yargs/pull/164) better array handling thanks @getify (@bcoe)
+
+### v3.9.1 (2015/05/20 05:14 +00:00)
+- [b6662b6](https://github.com/bcoe/yargs/commit/b6662b6774cfeab4876f41ec5e2f67b7698f4e2f) clarify .config() docs (@linclark)
+- [0291360](https://github.com/bcoe/yargs/commit/02913606285ce31ce81d7f12c48d8a3029776ec7) fixed tests, switched to nyc for coverage, fixed security issue, added Lin as collaborator (@bcoe)
+
+### v3.9.0 (2015/05/10 18:32 +00:00)
+- [#157](https://github.com/bcoe/yargs/pull/157) Merge pull request #157 from bcoe/command-yargs. allows handling of command specific arguments. Thanks for the suggestion @ohjames (@bcoe)
+- [#158](https://github.com/bcoe/yargs/pull/158) Merge pull request #158 from kemitchell/spdx-license. Update license format (@kemitchell)
+
+### v3.8.0 (2015/04/24 23:10 +00:00)
+- [#154](https://github.com/bcoe/yargs/pull/154) showHelp's method signature was misleading fixes #153 (@bcoe)
+- [#151](https://github.com/bcoe/yargs/pull/151) refactor yargs' table layout logic to use new helper library (@bcoe)
+- [#150](https://github.com/bcoe/yargs/pull/150) Fix README example in argument requirements (@annonymouse)
+
+### v3.7.2 (2015/04/13 11:52 -07:00)
+
+* [679fbbf](https://github.com/bcoe/yargs/commit/679fbbf55904030ccee8a2635e8e5f46551ab2f0) updated yargs to use the [standard](https://github.com/feross/standard) style guide (agokjr)
+* [22382ee](https://github.com/bcoe/yargs/commit/22382ee9f5b495bc2586c1758cd1091cec3647f9 various bug fixes for $0 (@nylen)
+
+### v3.7.1 (2015/04/10 11:06 -07:00)
+
+* [89e1992](https://github.com/bcoe/yargs/commit/89e1992a004ba73609b5f9ee6890c4060857aba4) detect iojs bin along with node bin. (@bcoe)
+* [755509e](https://github.com/bcoe/yargs/commit/755509ea90041e5f7833bba3b8c5deffe56f0aab) improvements to example documentation in README.md (@rstacruz)
+* [0d2dfc8](https://github.com/bcoe/yargs/commit/0d2dfc822a43418242908ad97ddd5291a1b35dc6) showHelp() no longer requires that .argv has been called (@bcoe)
+
+### v3.7.0 (2015/04/04 02:29 -07:00)
+
+* [56cbe2d](https://github.com/bcoe/yargs/commit/56cbe2ddd33dc176dcbf97ba40559864a9f114e4) make .requiresArg() work with type hints. (@bcoe).
+* [2f5d562](https://github.com/bcoe/yargs/commit/2f5d5624f736741deeedf6a664d57bc4d857bdd0) serialize arrays and objects in usage strings. (@bcoe).
+* [5126304](https://github.com/bcoe/yargs/commit/5126304dd18351fc28f10530616fdd9361e0af98) be more lenient about alias/primary key ordering in chaining API. (@bcoe)
+
+### v3.6.0 (2015/03/21 01:00 +00:00)
+- [4e24e22](https://github.com/bcoe/yargs/commit/4e24e22e6a195e55ab943ede704a0231ac33b99c) support for .js configuration files. (@pirxpilot)
+
+### v3.5.4 (2015/03/12 05:56 +00:00)
+- [c16cc08](https://github.com/bcoe/yargs/commit/c16cc085501155cf7fd853ccdf8584b05ab92b78) message for non-option arguments is now optional, thanks to (@raine)
+
+### v3.5.3 (2015/03/09 06:14 +00:00)
+- [870b428](https://github.com/bcoe/yargs/commit/870b428cf515d560926ca392555b7ad57dba9e3d) completion script was missing in package.json (@bcoe)
+
+### v3.5.2 (2015/03/09 06:11 +00:00)
+- [58a4b24](https://github.com/bcoe/yargs/commit/58a4b2473ebbb326713d522be53e32d3aabb08d2) parse was being called multiple times, resulting in strange behavior (@bcoe)
+
+### v3.5.1 (2015/03/09 04:55 +00:00)
+- [4e588e0](https://github.com/bcoe/yargs/commit/4e588e055afbeb9336533095f051496e3977f515) accidentally left testing logic in (@bcoe)
+
+### v3.5.0 (2015/03/09 04:49 +00:00)
+- [718bacd](https://github.com/bcoe/yargs/commit/718bacd81b9b44f786af76b2afe491fe06274f19) added support for bash completions see #4 (@bcoe)
+- [a192882](https://github.com/bcoe/yargs/commit/a19288270fc431396c42af01125eeb4443664528) downgrade to mocha 2.1.0 until https://github.com/mochajs/mocha/issues/1585 can be sorted out (@bcoe)
+
+### v3.4.7 (2015/03/09 04:09 +00:00)
+- [9845e5c](https://github.com/bcoe/yargs/commit/9845e5c1a9c684ba0be3f0bfb40e7b62ab49d9c8) the Argv singleton was not being updated when manually parsing arguments, fixes #114 (@bcoe)
+
+### v3.4.6 (2015/03/09 04:01 +00:00)
+- [45b4c80](https://github.com/bcoe/yargs/commit/45b4c80b890d02770b0a94f326695a8a566e8fe9) set placeholders for all keys fixes #115 (@bcoe)
+
+### v3.4.5 (2015/03/01 20:31 +00:00)
+- [a758e0b](https://github.com/bcoe/yargs/commit/a758e0b2556184f067cf3d9c4ef886d39817ebd2) fix for count consuming too many arguments (@bcoe)
+
+### v3.4.4 (2015/02/28 04:52 +00:00)
+- [0476af7](https://github.com/bcoe/yargs/commit/0476af757966acf980d998b45108221d4888cfcb) added nargs feature, allowing you to specify the number of arguments after an option (@bcoe)
+- [092477d](https://github.com/bcoe/yargs/commit/092477d7ab3efbf0ba11cede57f7d8cfc70b024f) updated README with full example of v3.0 API (@bcoe)
+
+### v3.3.3 (2015/02/28 04:23 +00:00)
+- [0c4b769](https://github.com/bcoe/yargs/commit/0c4b769516cd8d93a7c4e5e675628ae0049aa9a8) remove string dependency, which conflicted with other libraries see #106 (@bcoe)
+
+### v3.3.2 (2015/02/28 04:11 +00:00)
+- [2a98906](https://github.com/bcoe/yargs/commit/2a9890675821c0e7a12f146ce008b0562cb8ec9a) add $0 to epilog (@schnittstabil)
+
+### v3.3.1 (2015/02/24 03:28 +00:00)
+- [ad485ce](https://github.com/bcoe/yargs/commit/ad485ce748ebdfce25b88ef9d6e83d97a2f68987) fix for applying defaults to camel-case args (@bcoe)
+
+### v3.3.0 (2015/02/24 00:49 +00:00)
+- [8bfe36d](https://github.com/bcoe/yargs/commit/8bfe36d7fb0f93a799ea3f4c756a7467c320f8c0) fix and document restart() command, as a tool for building nested CLIs (@bcoe)
+
+### v3.2.1 (2015/02/22 05:45 +00:00)
+- [49a6d18](https://github.com/bcoe/yargs/commit/49a6d1822a4ef9b1ea6f90cc366be60912628885) you can now provide a function that generates a default value (@bcoe)
+
+### v3.2.0 (2015/02/22 05:24 +00:00)
+- [7a55886](https://github.com/bcoe/yargs/commit/7a55886c9343cf71a20744ca5cdd56d2ea7412d5) improvements to yargs two-column text layout (@bcoe)
+- [b6ab513](https://github.com/bcoe/yargs/commit/b6ab5136a4c3fa6aa496f6b6360382e403183989) Tweak NPM version badge (@nylen)
+
+### v3.1.0 (2015/02/19 19:37 +00:00)
+- [9bd2379](https://github.com/bcoe/yargs/commit/9bd237921cf1b61fd9f32c0e6d23f572fc225861) version now accepts a function, making it easy to load version #s from a package.json (@bcoe)
+
+### v3.0.4 (2015/02/14 01:40 +00:00)
+- [0b7c19b](https://github.com/bcoe/yargs/commit/0b7c19beaecb747267ca4cc10e5cb2a8550bc4b7) various fixes for dot-notation handling (@bcoe)
+
+### v3.0.3 (2015/02/14 00:59 +00:00)
+- [c3f35e9](https://github.com/bcoe/yargs/commit/c3f35e99bd5a0d278073fcadd95e2d778616cc17) make sure dot-notation is applied to aliases (@bcoe)
+
+### 3.0.2 (2015/02/13 16:50 +00:00)
+- [74c8967](https://github.com/bcoe/yargs/commit/74c8967c340c204a0a7edf8a702b6f46c2705435) document epilog shorthand of epilogue. (@bcoe)
+- [670110f](https://github.com/bcoe/yargs/commit/670110fc01bedc4831b6fec6afac54517d5a71bc) any non-truthy value now causes check to fail see #76 (@bcoe)
+- [0d8f791](https://github.com/bcoe/yargs/commit/0d8f791a33c11ced4cd431ea8d3d3a337d456b56) finished implementing my wish-list of fetures for yargs 3.0. see #88 (@bcoe)
+- [5768447](https://github.com/bcoe/yargs/commit/5768447447c4c8e8304f178846206ce86540f063) fix coverage. (@bcoe)
+- [82e793f](https://github.com/bcoe/yargs/commit/82e793f3f61c41259eaacb67f0796aea2cf2aaa0) detect console width and perform word-wrapping. (@bcoe)
+- [67476b3](https://github.com/bcoe/yargs/commit/67476b37eea07fee55f23f35b9e0c7d76682b86d) refactor two-column table layout so that we can use it for examples and usage (@bcoe)
+- [4724cdf](https://github.com/bcoe/yargs/commit/4724cdfcc8e37ae1ca3dcce9d762f476e9ef4bb4) major refactor of index.js, in prep for 3.x release. (@bcoe)
+
+### v2.3.0 (2015/02/08 20:41 +00:00)
+- [d824620](https://github.com/bcoe/yargs/commit/d824620493df4e63664af1fe320764dd1a9244e6) allow for undefined boolean defaults (@ashi009)
+
+### v2.2.0 (2015/02/08 20:07 +00:00)
+- [d6edd98](https://github.com/bcoe/yargs/commit/d6edd9848826e7389ed1393858c45d03961365fd) in-prep for further refactoring, and a 3.x release I've shuffled some things around and gotten test-coverage to 100%. (@bcoe)
+
+### v2.1.2 (2015/02/08 06:05 +00:00)
+- [d640745](https://github.com/bcoe/yargs/commit/d640745a7b9f8d476e0223879d056d18d9c265c4) switch to path.relative (@bcoe)
+- [3bfd41f](https://github.com/bcoe/yargs/commit/3bfd41ff262a041f29d828b88936a79c63cad594) remove mocha.opts. (@bcoe)
+- [47a2f35](https://github.com/bcoe/yargs/commit/47a2f357091db70903a402d6765501c1d63f15fe) document using .string('_') for string ids. see #56 (@bcoe)
+- [#57](https://github.com/bcoe/yargs/pull/57) Merge pull request #57 from eush77/option-readme (@eush77)
+
+### v2.1.1 (2015/02/06 08:08 +00:00)
+- [01c6c61](https://github.com/bcoe/yargs/commit/01c6c61d67b4ebf88f41f0b32a345ec67f0ac17d) fix for #71, 'newAliases' of undefined (@bcoe)
+
+### v2.1.0 (2015/02/06 07:59 +00:00)
+- [6a1a3fa](https://github.com/bcoe/yargs/commit/6a1a3fa731958e26ccd56885f183dd8985cc828f) try to guess argument types, and apply sensible defaults see #73 (@bcoe)
+
+### v2.0.1 (2015/02/06 07:54 +00:00)
+- [96a06b2](https://github.com/bcoe/yargs/commit/96a06b2650ff1d085a52b7328d8bba614c20cc12) Fix for strange behavior with --sort option, see #51 (@bcoe)
+
+### v2.0.0 (2015/02/06 07:45 +00:00)
+- [0250517](https://github.com/bcoe/yargs/commit/0250517c9643e53f431b824e8ccfa54937414011) - [108fb84](https://github.com/bcoe/yargs/commit/108fb8409a3a63dcaf99d917fe4dfcfaa1de236d) fixed bug with boolean parsing, when bools separated by = see #66 (@bcoe)
+- [a465a59](https://github.com/bcoe/yargs/commit/a465a5915f912715738de890982e4f8395958b10) Add `files` field to the package.json (@shinnn)
+- [31043de](https://github.com/bcoe/yargs/commit/31043de7a38a17c4c97711f1099f5fb164334db3) fix for yargs.argv having the same keys added multiple times see #63 (@bcoe)
+- [2d68c5b](https://github.com/bcoe/yargs/commit/2d68c5b91c976431001c4863ce47c9297850f1ad) Disable process.exit calls using .exitProcess(false) (@cianclarke)
+- [45da9ec](https://github.com/bcoe/yargs/commit/45da9ec4c55a7bd394721bc6a1db0dabad7bc52a) Mention .option in README (@eush77)
+
+### v1.3.2 (2014/10/06 21:56 +00:00)
+- [b8d3472](https://github.com/bcoe/yargs/commit/b8d34725482e5821a3cc809c0df71378f282f526) 1.3.2 (@chevex)
+
+### list (2014/08/30 18:41 +00:00)
+- [fbc777f](https://github.com/bcoe/yargs/commit/fbc777f416eeefd37c84e44d27d7dfc7c1925721) Now that yargs is the successor to optimist, I'm changing the README language to be more universal. Pirate speak isn't very accessible to non-native speakers. (@chevex)
+- [a54d068](https://github.com/bcoe/yargs/commit/a54d0682ae2efc2394d407ab171cc8a8bbd135ea) version output will not print extra newline (@boneskull)
+- [1cef5d6](https://github.com/bcoe/yargs/commit/1cef5d62a9d6d61a3948a49574892e01932cc6ae) Added contributors section to package.json (@chrisn)
+- [cc295c0](https://github.com/bcoe/yargs/commit/cc295c0a80a2de267e0155b60d315fc4b6f7c709) Added 'require' and 'required' as synonyms for 'demand' (@chrisn)
+- [d0bf951](https://github.com/bcoe/yargs/commit/d0bf951d949066b6280101ed606593d079ee15c8) Updating minimist. (@chevex)
+- [c15f8e7](https://github.com/bcoe/yargs/commit/c15f8e7f245b261e542cf205ce4f4313630cbdb4) Fix #31 (bad interaction between camelCase options and strict mode) (@nylen)
+- [d991b9b](https://github.com/bcoe/yargs/commit/d991b9be687a68812dee1e3b185ba64b7778b82d) Added .help() and .version() methods (@chrisn)
+- [e8c8aa4](https://github.com/bcoe/yargs/commit/e8c8aa46268379357cb11e9fc34b8c403037724b) Added .showHelpOnFail() method (@chrisn)
+- [e855af4](https://github.com/bcoe/yargs/commit/e855af4a933ea966b5bbdd3c4c6397a4bac1a053) Allow boolean flag with .demand() (@chrisn)
+- [14dbec2](https://github.com/bcoe/yargs/commit/14dbec24fb7380683198e2b20c4deb8423e64bea) Fixes issue #22. Arguments are no longer printed to the console when using .config. (@chevex)
+- [bef74fc](https://github.com/bcoe/yargs/commit/bef74fcddc1544598a804f80d0a3728459f196bf) Informing users that Yargs is the official optimist successor. (@chevex)
+- [#24](https://github.com/bcoe/yargs/pull/24) Merge pull request #24 from chrisn/strict (@chrisn)
+- [889a2b2](https://github.com/bcoe/yargs/commit/889a2b28eb9768801b05163360a470d0fd6c8b79) Added requiresArg option, for options that require values (@chrisn)
+- [eb16369](https://github.com/bcoe/yargs/commit/eb163692262be1fe80b992fd8803d5923c5a9b18) Added .strict() method, to report error if unknown arguments are given (@chrisn)
+- [0471c3f](https://github.com/bcoe/yargs/commit/0471c3fd999e1ad4e6cded88b8aa02013b66d14f) Changed optimist to yargs in usage-options.js example (@chrisn)
+- [5c88f74](https://github.com/bcoe/yargs/commit/5c88f74e3cf031b17c54b4b6606c83e485ff520e) Change optimist to yargs in examples (@chrisn)
+- [66f12c8](https://github.com/bcoe/yargs/commit/66f12c82ba3c943e4de8ca862980e835da8ecb3a) Fix a couple of bad interactions between aliases and defaults (@nylen)
+- [8fa1d80](https://github.com/bcoe/yargs/commit/8fa1d80f14b03eb1f2898863a61f1d1615bceb50) Document second argument of usage(message, opts) (@Gobie)
+- [56e6528](https://github.com/bcoe/yargs/commit/56e6528cf674ff70d63083fb044ff240f608448e) For "--some-option", also set argv.someOption (@nylen)
+- [ed5f6d3](https://github.com/bcoe/yargs/commit/ed5f6d33f57ad1086b11c91b51100f7c6c7fa8ee) Finished porting unit tests to Mocha. (@chevex)
+
+### v1.0.15 (2014/02/05 23:18 +00:00)
+- [e2b1fc0](https://github.com/bcoe/yargs/commit/e2b1fc0c4a59cf532ae9b01b275e1ef57eeb64d2) 1.0.15 update to badges (@chevex)
+
+### v1.0.14 (2014/02/05 23:17 +00:00)
+- [f33bbb0](https://github.com/bcoe/yargs/commit/f33bbb0f00fe18960f849cc8e15a7428a4cd59b8) Revert "Fixed issue which caused .demand function not to work correctly." (@chevex)
+
+### v1.0.13 (2014/02/05 22:13 +00:00)
+- [6509e5e](https://github.com/bcoe/yargs/commit/6509e5e7dee6ef1a1f60eea104be0faa1a045075) Fixed issue which caused .demand function not to work correctly. (@chevex)
+
+### v1.0.12 (2013/12/13 00:09 +00:00)
+- [05eb267](https://github.com/bcoe/yargs/commit/05eb26741c9ce446b33ff006e5d33221f53eaceb) 1.0.12 (@chevex)
+
+### v1.0.11 (2013/12/13 00:07 +00:00)
+- [c1bde46](https://github.com/bcoe/yargs/commit/c1bde46e37318a68b87d17a50c130c861d6ce4a9) 1.0.11 (@chevex)
+
+### v1.0.10 (2013/12/12 23:57 +00:00)
+- [dfebf81](https://github.com/bcoe/yargs/commit/dfebf8164c25c650701528ee581ca483a99dc21c) Fixed formatting in README (@chevex)
+
+### v1.0.9 (2013/12/12 23:47 +00:00)
+- [0b4e34a](https://github.com/bcoe/yargs/commit/0b4e34af5e6d84a9dbb3bb6d02cd87588031c182) Update README.md (@chevex)
+
+### v1.0.8 (2013/12/06 16:36 +00:00)
+- [#1](https://github.com/bcoe/yargs/pull/1) fix error caused by check() see #1 (@martinheidegger)
+
+### v1.0.7 (2013/11/24 18:01 +00:00)
+- [a247d88](https://github.com/bcoe/yargs/commit/a247d88d6e46644cbb7303c18b1bb678fc132d72) Modified Pirate Joe image. (@chevex)
+
+### v1.0.6 (2013/11/23 19:21 +00:00)
+- [d7f69e1](https://github.com/bcoe/yargs/commit/d7f69e1d34bc929736a8bdccdc724583e21b7eab) Updated Pirate Joe image. (@chevex)
+
+### v1.0.5 (2013/11/23 19:09 +00:00)
+- [ece809c](https://github.com/bcoe/yargs/commit/ece809cf317cc659175e1d66d87f3ca68c2760be) Updated readme notice again. (@chevex)
+
+### v1.0.4 (2013/11/23 19:05 +00:00)
+- [9e81e81](https://github.com/bcoe/yargs/commit/9e81e81654028f83ba86ffc3ac772a0476084e5e) Updated README with a notice about yargs being a fork of optimist and what that implies. (@chevex)
+
+### v1.0.3 (2013/11/23 17:43 +00:00)
+- [65e7a78](https://github.com/bcoe/yargs/commit/65e7a782c86764944d63d084416aba9ee6019c5f) Changed some small wording in README.md. (@chevex)
+- [459e20e](https://github.com/bcoe/yargs/commit/459e20e539b366b85128dd281ccd42221e96c7da) Fix a bug in the options function, when string and boolean options weren't applied to aliases. (@shockone)
+
+### v1.0.2 (2013/11/23 09:46 +00:00)
+- [3d80ebe](https://github.com/bcoe/yargs/commit/3d80ebed866d3799224b6f7d596247186a3898a9) 1.0.2 (@chevex)
+
+### v1.0.1 (2013/11/23 09:39 +00:00)
+- [f80ff36](https://github.com/bcoe/yargs/commit/f80ff3642d580d4b68bf9f5a94277481bd027142) Updated image. (@chevex)
+
+### v1.0.0 (2013/11/23 09:33 +00:00)
+- [54e31d5](https://github.com/bcoe/yargs/commit/54e31d505f820b80af13644e460894b320bf25a3) Rebranded from optimist to yargs in the spirit of the fork :D (@chevex)
+- [4ebb6c5](https://github.com/bcoe/yargs/commit/4ebb6c59f44787db7c24c5b8fe2680f01a23f498) Added documentation for demandCount(). (@chevex)
+- [4561ce6](https://github.com/bcoe/yargs/commit/4561ce66dcffa95f49e8b4449b25b94cd68acb25) Simplified the error messages returned by .check(). (@chevex)
+- [661c678](https://github.com/bcoe/yargs/commit/661c67886f479b16254a830b7e1db3be29e6b7a6) Fixed an issue with demand not accepting a zero value. (@chevex)
+- [731dd3c](https://github.com/bcoe/yargs/commit/731dd3c37624790490bd6df4d5f1da8f4348279e) Add .fail(fn) so death isn't the only option. Should fix issue #39. (@chevex)
+- [fa15417](https://github.com/bcoe/yargs/commit/fa15417ff9e70dace0d726627a5818654824c1d8) Added a few missing 'return self' (@chevex)
+- [e655e4d](https://github.com/bcoe/yargs/commit/e655e4d99d1ae1d3695ef755d51c2de08d669761) Fix showing help in certain JS environments. (@chevex)
+- [a746a31](https://github.com/bcoe/yargs/commit/a746a31cd47c87327028e6ea33762d6187ec5c87) Better string representation of default values. (@chevex)
+- [6134619](https://github.com/bcoe/yargs/commit/6134619a7e90b911d5443230b644c5d447c1a68c) Implies: conditional demands (@chevex)
+- [046b93b](https://github.com/bcoe/yargs/commit/046b93b5d40a27367af4cb29726e4d781d934639) Added support for JSON config files. (@chevex)
+- [a677ec0](https://github.com/bcoe/yargs/commit/a677ec0a0ecccd99c75e571d03323f950688da03) Add .example(cmd, desc) feature. (@chevex)
+- [1bd4375](https://github.com/bcoe/yargs/commit/1bd4375e11327ba1687d4bb6e5e9f3c30c1be2af) Added 'defaults' as alias to 'default' so as to avoid usage of a reserved keyword. (@chevex)
+- [6b753c1](https://github.com/bcoe/yargs/commit/6b753c16ca09e723060e70b773b430323b29c45c) add .normalize(args..) support for normalizing paths (@chevex)
+- [33d7d59](https://github.com/bcoe/yargs/commit/33d7d59341d364f03d3a25f0a55cb99004dbbe4b) Customize error messages with demand(key, msg) (@chevex)
+- [647d37f](https://github.com/bcoe/yargs/commit/647d37f164c20f4bafbf67dd9db6cd6e2cd3b49f) Merge branch 'rewrite-duplicate-test' of github.com:isbadawi/node-optimist (@chevex)
+- [9059d1a](https://github.com/bcoe/yargs/commit/9059d1ad5e8aea686c2a01c89a23efdf929fff2e) Pass aliases object to check functions for greater versatility. (@chevex)
+- [623dc26](https://github.com/bcoe/yargs/commit/623dc26c7331abff2465ef8532e3418996d42fe6) Added ability to count boolean options and rolled minimist library back into project. (@chevex)
+- [49f0dce](https://github.com/bcoe/yargs/commit/49f0dcef35de4db544c3966350d36eb5838703f6) Fixed small typo. (@chevex)
+- [79ec980](https://github.com/bcoe/yargs/commit/79ec9806d9ca6eb0014cfa4b6d1849f4f004baf2) Removed dependency on wordwrap module. (@chevex)
+- [ea14630](https://github.com/bcoe/yargs/commit/ea14630feddd69d1de99dd8c0e08948f4c91f00a) Merge branch 'master' of github.com:chbrown/node-optimist (@chevex)
+- [2b75da2](https://github.com/bcoe/yargs/commit/2b75da2624061e0f4f3107d20303c06ec9054906) Merge branch 'master' of github.com:seanzhou1023/node-optimist (@chevex)
+- [d9bda11](https://github.com/bcoe/yargs/commit/d9bda1116e26f3b40e833ca9ca19263afea53565) Merge branch 'patch-1' of github.com:thefourtheye/node-optimist (@chevex)
+- [d6cc606](https://github.com/bcoe/yargs/commit/d6cc6064a4f1bea38a16a4430b8a1334832fbeff) Renamed README. (@chevex)
+- [9498d3f](https://github.com/bcoe/yargs/commit/9498d3f59acfb5e102826503e681623c3a64b178) Renamed readme and added .gitignore. (@chevex)
+- [bbd1fe3](https://github.com/bcoe/yargs/commit/bbd1fe37fefa366dde0fb3dc44d91fe8b28f57f5) Included examples for ```help``` and ```showHelp``` functions and fixed few formatting issues (@thefourtheye)
+- [37fea04](https://github.com/bcoe/yargs/commit/37fea0470a5796a0294c1dcfff68d8041650e622) .alias({}) behaves differently based on mapping direction when generating descriptions (@chbrown)
+- [855b20d](https://github.com/bcoe/yargs/commit/855b20d0be567ca121d06b30bea64001b74f3d6d) Documented function signatures are useful for dynamically typed languages. (@chbrown)
+
+### 0.6.0 (2013/06/25 08:48 +00:00)
+- [d37bfe0](https://github.com/bcoe/yargs/commit/d37bfe05ae6d295a0ab481efe4881222412791f4) all tests passing using minimist (@substack)
+- [76f1352](https://github.com/bcoe/yargs/commit/76f135270399d01f2bbc621e524a5966e5c422fd) all parse tests now passing (@substack)
+- [a7b6754](https://github.com/bcoe/yargs/commit/a7b6754276c38d1565479a5685c3781aeb947816) using minimist, some tests passing (@substack)
+- [6655688](https://github.com/bcoe/yargs/commit/66556882aa731cbbbe16cc4d42c85740a2e98099) Give credit where its due (@DeadAlready)
+- [602a2a9](https://github.com/bcoe/yargs/commit/602a2a92a459f93704794ad51b115bbb08b535ce) v0.5.3 - Remove wordwrap as dependency (@DeadAlready)
+
+### 0.5.2 (2013/05/31 03:46 +00:00)
+- [4497ca5](https://github.com/bcoe/yargs/commit/4497ca55e332760a37b866ec119ded347ca27a87) fixed the whitespace bug without breaking anything else (@substack)
+- [5a3dd1a](https://github.com/bcoe/yargs/commit/5a3dd1a4e0211a38613c6e02f61328e1031953fa) failing test for whitespace arg (@substack)
+
+### 0.5.1 (2013/05/30 07:17 +00:00)
+- [a20228f](https://github.com/bcoe/yargs/commit/a20228f62a454755dd07f628a7c5759113918327) fix parse() to work with functions before it (@substack)
+- [b13bd4c](https://github.com/bcoe/yargs/commit/b13bd4cac856a9821d42fa173bdb58f089365a7d) failing test for parse() with modifiers (@substack)
+
+### 0.5.0 (2013/05/18 21:59 +00:00)
+- [c474a64](https://github.com/bcoe/yargs/commit/c474a649231527915c222156e3b40806d365a87c) fixes for dash (@substack)
+
+### 0.4.0 (2013/04/13 19:03 +00:00)
+- [dafe3e1](https://github.com/bcoe/yargs/commit/dafe3e18d7c6e7c2d68e06559df0e5cbea3adb14) failing short test (@substack)
+
+### 0.3.7 (2013/04/04 04:07 +00:00)
+- [6c7a0ec](https://github.com/bcoe/yargs/commit/6c7a0ec94ce4199a505f0518b4d6635d4e47cc81) Fix for windows. On windows there is no _ in environment. (@hdf)
+
+### 0.3.6 (2013/04/04 04:04 +00:00)
+- [e72346a](https://github.com/bcoe/yargs/commit/e72346a727b7267af5aa008b418db89970873f05) Add support for newlines in -a="" arguments (@danielbeardsley)
+- [71e1fb5](https://github.com/bcoe/yargs/commit/71e1fb55ea9987110a669ac6ec12338cfff3821c) drop 0.4, add 0.8 to travis (@substack)
+
+### 0.3.5 (2012/10/10 11:09 +00:00)
+- [ee692b3](https://github.com/bcoe/yargs/commit/ee692b37554c70a0bb16389a50a26b66745cbbea) Fix parsing booleans (@vojtajina)
+- [5045122](https://github.com/bcoe/yargs/commit/5045122664c3f5b4805addf1be2148d5856f7ce8) set $0 properly in the tests (@substack)
+
+### 0.3.4 (2012/04/30 06:54 +00:00)
+- [f28c0e6](https://github.com/bcoe/yargs/commit/f28c0e62ca94f6e0bb2e6d82fc3d91a55e69b903) bump for string "true" params (@substack)
+- [8f44aeb](https://github.com/bcoe/yargs/commit/8f44aeb74121ddd689580e2bf74ef86a605e9bf2) Fix failing test for aliased booleans. (@coderarity)
+- [b9f7b61](https://github.com/bcoe/yargs/commit/b9f7b613b1e68e11e6c23fbda9e555a517dcc976) Add failing test for short aliased booleans. (@coderarity)
+
+### 0.3.3 (2012/04/30 06:45 +00:00)
+- [541bac8](https://github.com/bcoe/yargs/commit/541bac8dd787a5f1a5d28f6d8deb1627871705e7) Fixes #37.
+
+### 0.3.2 (2012/04/12 20:28 +00:00)
+- [3a0f014](https://github.com/bcoe/yargs/commit/3a0f014c1451280ac1c9caa1f639d31675586eec) travis badge (@substack)
+- [4fb60bf](https://github.com/bcoe/yargs/commit/4fb60bf17845f4ce3293f8ca49c9a1a7c736cfce) Fix boolean aliases. (@coderarity)
+- [f14dda5](https://github.com/bcoe/yargs/commit/f14dda546efc4fe06ace04d36919bfbb7634f79b) Adjusted package.json to use tap (@jfhbrook)
+- [88e5d32](https://github.com/bcoe/yargs/commit/88e5d32295be6e544c8d355ff84e355af38a1c74) test/usage.js no longer hangs (@jfhbrook)
+- [e1e740c](https://github.com/bcoe/yargs/commit/e1e740c27082f3ce84deca2093d9db2ef735d0e5) two tests for combined boolean/alias opts parsing (@jfhbrook)
+
+### 0.3.1 (2011/12/31 08:44 +00:00)
+- [d09b719](https://github.com/bcoe/yargs/commit/d09b71980ef711b6cf3918cd19beec8257e40e82) If "default" is set to false it was not passed on, fixed. (@wolframkriesing)
+
+### 0.3.0 (2011/12/09 06:03 +00:00)
+- [6e74aa7](https://github.com/bcoe/yargs/commit/6e74aa7b46a65773e20c0cb68d2d336d4a0d553d) bump and documented dot notation (@substack)
+
+### 0.2.7 (2011/10/20 02:25 +00:00)
+- [94adee2](https://github.com/bcoe/yargs/commit/94adee20e17b58d0836f80e8b9cdbe9813800916) argv._ can be told 'Hey! argv._! Don't be messing with my args.', and it WILL obey (@colinta)
+- [c46fdd5](https://github.com/bcoe/yargs/commit/c46fdd56a05410ae4a1e724a4820c82e77ff5469) optimistic critter image (@substack)
+- [5c95c73](https://github.com/bcoe/yargs/commit/5c95c73aedf4c7482bd423e10c545e86d7c8a125) alias options() to option() (@substack)
+- [f7692ea](https://github.com/bcoe/yargs/commit/f7692ea8da342850af819367833abb685fde41d8) [fix] Fix for parsing boolean edge case (@indexzero)
+- [d1f92d1](https://github.com/bcoe/yargs/commit/d1f92d1425bd7f356055e78621b30cdf9741a3c2)
+- [b01bda8](https://github.com/bcoe/yargs/commit/b01bda8d86e455bbf74ce497864cb8ab5b9fb847) [fix test] Update to ensure optimist is aware of default booleans. Associated tests included (@indexzero)
+- [aa753e7](https://github.com/bcoe/yargs/commit/aa753e7c54fb3a12f513769a0ff6d54aa0f63943) [dist test] Update devDependencies in package.json. Update test pathing to be more npm and require.paths future-proof (@indexzero)
+- [7bfce2f](https://github.com/bcoe/yargs/commit/7bfce2f3b3c98e6539e7549d35fbabced7e9341e) s/sys/util/ (@substack)
+- [d420a7a](https://github.com/bcoe/yargs/commit/d420a7a9c890d2cdb11acfaf3ea3f43bc3e39f41) update usage output (@substack)
+- [cf86eed](https://github.com/bcoe/yargs/commit/cf86eede2e5fc7495b6ec15e6d137d9ac814f075) some sage readme protips about parsing rules (@substack)
+- [5da9f7a](https://github.com/bcoe/yargs/commit/5da9f7a5c0e1758ec7c5801fb3e94d3f6e970513) documented all the methods finally (@substack)
+- [8ca6879](https://github.com/bcoe/yargs/commit/8ca6879311224b25933642987300f6a29de5c21b) fenced syntax highlighting (@substack)
+- [b72bacf](https://github.com/bcoe/yargs/commit/b72bacf1d02594778c1935405bc8137eb61761dc) right-alignment of wrapped extra params (@substack)
+- [2b980bf](https://github.com/bcoe/yargs/commit/2b980bf2656b4ee8fc5134dc5f56a48855c35198) now with .wrap() (@substack)
+- [d614f63](https://github.com/bcoe/yargs/commit/d614f639654057d1b7e35e3f5a306e88ec2ad1e4) don't show 'Options:' when there aren't any (@substack)
+- [691eda3](https://github.com/bcoe/yargs/commit/691eda354df97b5a86168317abcbcaabdc08a0fb) failing test for multi-aliasing (@substack)
+- [0826c9f](https://github.com/bcoe/yargs/commit/0826c9f462109feab2bc7a99346d22e72bf774b7) "Options:" > "options:" (@substack)
+- [72f7490](https://github.com/bcoe/yargs/commit/72f749025d01b7f295738ed370a669d885fbada0) [minor] Update formatting for `.showHelp()` (@indexzero)
+- [75aecce](https://github.com/bcoe/yargs/commit/75aeccea74329094072f95800e02c275e7d999aa) options works again, too lazy to write a proper test right now (@substack)
+- [f742e54](https://github.com/bcoe/yargs/commit/f742e5439817c662dc3bd8734ddd6467e6018cfd) line_count_options example, which breaks (@substack)
+- [4ca06b8](https://github.com/bcoe/yargs/commit/4ca06b8b4ea99b5d5714b315a2a8576bee6e5537) line count example (@substack)
+- [eeb8423](https://github.com/bcoe/yargs/commit/eeb8423e0a5ecc9dc3eb1e6df9f3f8c1c88f920b) remove self.argv setting in boolean (@substack)
+- [6903412](https://github.com/bcoe/yargs/commit/69034126804660af9cc20ea7f4457b50338ee3d7) removed camel case for now (@substack)
+- [5a0d88b](https://github.com/bcoe/yargs/commit/5a0d88bf23e9fa79635dd034e2a1aa992acc83cd) remove dead longest checking code (@substack)
+- [d782170](https://github.com/bcoe/yargs/commit/d782170babf7284b1aa34f5350df0dd49c373fa8) .help() too (@substack)
+- [622ec17](https://github.com/bcoe/yargs/commit/622ec17379bb5374fdbb190404c82bc600975791) rm old help generator (@substack)
+- [7c8baac](https://github.com/bcoe/yargs/commit/7c8baac4d66195e9f5158503ea9ebfb61153dab7) nub keys (@substack)
+- [8197785](https://github.com/bcoe/yargs/commit/8197785ad4762465084485b041abd722f69bf344) generate help message based on the previous calls, todo: nub (@substack)
+- [3ffbdc3](https://github.com/bcoe/yargs/commit/3ffbdc33c8f5e83d4ea2ac60575ce119570c7ede) stub out new showHelp, better checks (@substack)
+- [d4e21f5](https://github.com/bcoe/yargs/commit/d4e21f56a4830f7de841900d3c79756fb9886184) let .options() take single options too (@substack)
+- [3c4cf29](https://github.com/bcoe/yargs/commit/3c4cf2901a29bac119cca8e983028d8669230ec6) .options() is now heaps simpler (@substack)
+- [89f0d04](https://github.com/bcoe/yargs/commit/89f0d043cbccd302f10ab30c2069e05d2bf817c9) defaults work again, all tests pass (@substack)
+- [dd87333](https://github.com/bcoe/yargs/commit/dd8733365423006a6e4156372ebb55f98323af58) update test error messages, down to 2 failing tests (@substack)
+- [53f7bc6](https://github.com/bcoe/yargs/commit/53f7bc626b9875f2abdfc5dd7a80bde7f14143a3) fix for bools doubling up, passes the parse test again, others fail (@substack)
+- [2213e2d](https://github.com/bcoe/yargs/commit/2213e2ddc7263226fba717fb041dc3fde9bc2ee4) refactored for an argv getter, failing several tests (@substack)
+- [d1e7379](https://github.com/bcoe/yargs/commit/d1e737970f15c6c006bebdd8917706827ff2f0f2) just rescan for now, alias test passes (@substack)
+- [b2f8c99](https://github.com/bcoe/yargs/commit/b2f8c99cc477a8eb0fdf4cf178e1785b63185cfd) failing alias test (@substack)
+- [d0c0174](https://github.com/bcoe/yargs/commit/d0c0174daa144bfb6dc7290fdc448c393c475e15) .alias() (@substack)
+- [d85f431](https://github.com/bcoe/yargs/commit/d85f431ad7d07b058af3f2a57daa51495576c164) [api] Remove `.describe()` in favor of building upon the existing `.usage()` API (@indexzero)
+- [edbd527](https://github.com/bcoe/yargs/commit/edbd5272a8e213e71acd802782135c7f9699913a) [doc api] Add `.describe()`, `.options()`, and `.showHelp()` methods along with example. (@indexzero)
+- [be4902f](https://github.com/bcoe/yargs/commit/be4902ff0961ae8feb9093f2c0a4066463ded2cf) updates for coffee since it now does argv the node way (@substack)
+- [e24cb23](https://github.com/bcoe/yargs/commit/e24cb23798ee64e53b60815e7fda78b87f42390c) more general coffeescript detection (@substack)
+- [78ac753](https://github.com/bcoe/yargs/commit/78ac753e5d0ec32a96d39d893272afe989e42a4d) Don't trigger the CoffeeScript hack when running under node_g. (@papandreou)
+- [bcfe973](https://github.com/bcoe/yargs/commit/bcfe9731d7f90d4632281b8a52e8d76eb0195ae6) .string() but failing test (@substack)
+- [1987aca](https://github.com/bcoe/yargs/commit/1987aca28c7ba4e8796c07bbc547cb984804c826) test hex strings (@substack)
+- [ef36db3](https://github.com/bcoe/yargs/commit/ef36db32259b0b0d62448dc907c760e5554fb7e7) more keywords (@substack)
+- [cc53c56](https://github.com/bcoe/yargs/commit/cc53c56329960bed6ab077a79798e991711ba01d) Added camelCase function that converts --multi-word-option to camel case (so it becomes argv.multiWordOption). (@papandreou)
+- [60b57da](https://github.com/bcoe/yargs/commit/60b57da36797716e5783a633c6d5c79099016d45) fixed boolean bug by rescanning (@substack)
+- [dff6d07](https://github.com/bcoe/yargs/commit/dff6d078d97f8ac503c7d18dcc7b7a8c364c2883) boolean examples (@substack)
+- [0e380b9](https://github.com/bcoe/yargs/commit/0e380b92c4ef4e3c8dac1da18b5c31d85b1d02c9) boolean() with passing test (@substack)
+- [62644d4](https://github.com/bcoe/yargs/commit/62644d4bffbb8d1bbf0c2baf58a1d14a6359ef07) coffee compatibility with node regex for versions too (@substack)
+- [430fafc](https://github.com/bcoe/yargs/commit/430fafcf1683d23774772826581acff84b456827) argv._ fixed by fixing the coffee detection (@substack)
+- [343b8af](https://github.com/bcoe/yargs/commit/343b8afefd98af274ebe21b5a16b3a949ec5429f) whichNodeArgs test fails too (@substack)
+- [63df2f3](https://github.com/bcoe/yargs/commit/63df2f371f31e63d7f1dec2cbf0022a5f08da9d2) replicated mnot's bug in whichNodeEmpty test (@substack)
+- [35473a4](https://github.com/bcoe/yargs/commit/35473a4d93a45e5e7e512af8bb54ebb532997ae1) test for ./bin usage (@substack)
+- [13df151](https://github.com/bcoe/yargs/commit/13df151e44228eed10e5441c7cd163e086c458a4) don't coerce booleans to numbers (@substack)
+- [85f8007](https://github.com/bcoe/yargs/commit/85f8007e93b8be7124feea64b1f1916d8ba1894a) package bump for automatic number conversion (@substack)
+- [8f17014](https://github.com/bcoe/yargs/commit/8f170141cded4ccc0c6d67a849c5bf996aa29643) updated readme and examples with new auto-numberification goodness (@substack)
+- [73dc901](https://github.com/bcoe/yargs/commit/73dc9011ac968e39b55e19e916084a839391b506) auto number conversion works yay (@substack)
+- [bcec56b](https://github.com/bcoe/yargs/commit/bcec56b3d031e018064cbb691539ccc4f28c14ad) failing test for not-implemented auto numification (@substack)
+- [ebd2844](https://github.com/bcoe/yargs/commit/ebd2844d683feeac583df79af0e5124a7a7db04e) odd that eql doesn't check types careflly (@substack)
+- [fd854b0](https://github.com/bcoe/yargs/commit/fd854b02e512ce854b76386d395672a7969c1bc4) package author + keywords (@substack)
+- [656a1d5](https://github.com/bcoe/yargs/commit/656a1d5a1b7c0e49d72e80cb13f20671d56f76c6) updated readme with .default() stuff (@substack)
+- [cd7f8c5](https://github.com/bcoe/yargs/commit/cd7f8c55f0b82b79b690d14c5f806851236998a1) passing tests for new .default() behavior (@substack)
+- [932725e](https://github.com/bcoe/yargs/commit/932725e39ce65bc91a0385a5fab659a5fa976ac2) new default() thing for setting default key/values (@substack)
+- [4e6c7ab](https://github.com/bcoe/yargs/commit/4e6c7aba6374ac9ebc6259ecf91f13af7bce40e3) test for coffee usage (@substack)
+- [d54ffcc](https://github.com/bcoe/yargs/commit/d54ffccf2a5a905f51ed5108f7c647f35d64ae23) new --key value style with passing tests. NOTE: changes existing behavior (@substack)
+- [ed2a2d5](https://github.com/bcoe/yargs/commit/ed2a2d5d828100ebeef6385c0fb88d146a5cfe9b) package bump for summatix's coffee script fix (@substack)
+- [75a975e](https://github.com/bcoe/yargs/commit/75a975eed8430d28e2a79dc9e6d819ad545f4587) Added support for CoffeeScript (@summatix)
+- [56b2b1d](https://github.com/bcoe/yargs/commit/56b2b1de8d11f8a2b91979d8ae2d6db02d8fe64d) test coverage for the falsy check() usage (@substack)
+- [a4843a9](https://github.com/bcoe/yargs/commit/a4843a9f0e69ffb4afdf6a671d89eb6f218be35d) check bug fixed plus a handy string (@substack)
+- [857bd2d](https://github.com/bcoe/yargs/commit/857bd2db933a5aaa9cfecba0ced2dc9b415f8111) tests for demandCount, back up to 100% coverage (@substack)
+- [073b776](https://github.com/bcoe/yargs/commit/073b7768ebd781668ef05c13f9003aceca2f5c35) call demandCount from demand (@substack)
+- [4bd4b7a](https://github.com/bcoe/yargs/commit/4bd4b7a085c8b6ce1d885a0f486cc9865cee2db1) add demandCount to check for the number of arguments in the _ list (@marshall)
+- [b8689ac](https://github.com/bcoe/yargs/commit/b8689ac68dacf248119d242bba39a41cb0adfa07) Rebase checks. That will be its own module eventually. (@substack)
+- [e688370](https://github.com/bcoe/yargs/commit/e688370b576f0aa733c3f46183df69e1b561668e) a $0 like in perl (@substack)
+- [2e5e196](https://github.com/bcoe/yargs/commit/2e5e1960fc19afb21fb3293752316eaa8bcd3609) usage test hacking around process and console (@substack)
+- [fcc3521](https://github.com/bcoe/yargs/commit/fcc352163fbec6a1dfe8caf47a0df39de24fe016) description pun (@substack)
+- [87a1fe2](https://github.com/bcoe/yargs/commit/87a1fe29037ca2ca5fefda85141aaeb13e8ce761) mit/x11 license (@substack)
+- [8d089d2](https://github.com/bcoe/yargs/commit/8d089d24cd687c0bde3640a96c09b78f884900dd) bool example is more consistent and also shows off short option grouping (@substack)
+- [448d747](https://github.com/bcoe/yargs/commit/448d7473ac68e8e03d8befc9457b0d9e21725be0) start of the readme and examples (@substack)
+- [da74dea](https://github.com/bcoe/yargs/commit/da74dea799a9b59dbf022cbb8001bfdb0d52eec9) more tests for long and short captures (@substack)
+- [ab6387e](https://github.com/bcoe/yargs/commit/ab6387e6769ca4af82ca94c4c67c7319f0d9fcfa) silly bug in the tests with s/not/no/, all tests pass now (@substack)
+- [102496a](https://github.com/bcoe/yargs/commit/102496a319e8e06f6550d828fc2f72992c7d9ecc) hack an instance for process.argv onto Argv so the export can be called to create an instance or used for argv, which is the most common case (@substack)
+- [a01caeb](https://github.com/bcoe/yargs/commit/a01caeb532546d19f68f2b2b87f7036cfe1aaedd) divide example (@substack)
+- [443da55](https://github.com/bcoe/yargs/commit/443da55736acbaf8ff8b04d1b9ce19ab016ddda2) start of the lib with a package.json (@substack)
--- /dev/null
+Copyright 2010 James Halliday (mail@substack.net)
+
+This project is free software released under the MIT/X11 license:
+
+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.
--- /dev/null
+yargs
+========
+
+Yargs be a node.js library fer hearties tryin' ter parse optstrings.
+
+With yargs, ye be havin' a map that leads straight to yer treasure! Treasure of course, being a simple option hash.
+
+[![Build Status][travis-image]][travis-url]
+[![Dependency Status][gemnasium-image]][gemnasium-url]
+[![Coverage Status][coveralls-image]][coveralls-url]
+[![NPM version][npm-image]][npm-url]
+
+> Yargs is the official successor to optimist. Please feel free to submit issues and pull requests. If you'd like to contribute and don't know where to start, have a look at [the issue list](https://github.com/bcoe/yargs/issues) :)
+
+examples
+========
+
+With yargs, the options be just a hash!
+-------------------------------------------------------------------
+
+plunder.js:
+
+````javascript
+#!/usr/bin/env node
+var argv = require('yargs').argv;
+
+if (argv.ships > 3 && argv.distance < 53.5) {
+ console.log('Plunder more riffiwobbles!');
+}
+else {
+ console.log('Retreat from the xupptumblers!');
+}
+````
+
+***
+
+ $ ./plunder.js --ships=4 --distance=22
+ Plunder more riffiwobbles!
+
+ $ ./plunder.js --ships 12 --distance 98.7
+ Retreat from the xupptumblers!
+
+![Joe was one optimistic pirate.](http://i.imgur.com/4WFGVJ9.png)
+
+But don't walk the plank just yet! There be more! You can do short options:
+-------------------------------------------------
+
+short.js:
+
+````javascript
+#!/usr/bin/env node
+var argv = require('yargs').argv;
+console.log('(%d,%d)', argv.x, argv.y);
+````
+
+***
+
+ $ ./short.js -x 10 -y 21
+ (10,21)
+
+And booleans, both long, short, and even grouped:
+----------------------------------
+
+bool.js:
+
+````javascript
+#!/usr/bin/env node
+var util = require('util');
+var argv = require('yargs').argv;
+
+if (argv.s) {
+ process.stdout.write(argv.fr ? 'Le perroquet dit: ' : 'The parrot says: ');
+}
+console.log(
+ (argv.fr ? 'couac' : 'squawk') + (argv.p ? '!' : '')
+);
+````
+
+***
+
+ $ ./bool.js -s
+ The parrot says: squawk
+
+ $ ./bool.js -sp
+ The parrot says: squawk!
+
+ $ ./bool.js -sp --fr
+ Le perroquet dit: couac!
+
+And non-hyphenated options too! Just use `argv._`!
+-------------------------------------------------
+
+nonopt.js:
+
+````javascript
+#!/usr/bin/env node
+var argv = require('yargs').argv;
+console.log('(%d,%d)', argv.x, argv.y);
+console.log(argv._);
+````
+
+***
+
+ $ ./nonopt.js -x 6.82 -y 3.35 rum
+ (6.82,3.35)
+ [ 'rum' ]
+
+ $ ./nonopt.js "me hearties" -x 0.54 yo -y 1.12 ho
+ (0.54,1.12)
+ [ 'me hearties', 'yo', 'ho' ]
+
+Yargs even counts your booleans!
+----------------------------------------------------------------------
+
+count.js:
+
+````javascript
+#!/usr/bin/env node
+var argv = require('yargs')
+ .count('verbose')
+ .alias('v', 'verbose')
+ .argv;
+
+VERBOSE_LEVEL = argv.verbose;
+
+function WARN() { VERBOSE_LEVEL >= 0 && console.log.apply(console, arguments); }
+function INFO() { VERBOSE_LEVEL >= 1 && console.log.apply(console, arguments); }
+function DEBUG() { VERBOSE_LEVEL >= 2 && console.log.apply(console, arguments); }
+
+WARN("Showing only important stuff");
+INFO("Showing semi-important stuff too");
+DEBUG("Extra chatty mode");
+````
+
+***
+ $ node count.js
+ Showing only important stuff
+
+ $ node count.js -v
+ Showing only important stuff
+ Showing semi-important stuff too
+
+ $ node count.js -vv
+ Showing only important stuff
+ Showing semi-important stuff too
+ Extra chatty mode
+
+ $ node count.js -v --verbose
+ Showing only important stuff
+ Showing semi-important stuff too
+ Extra chatty mode
+
+Tell users how to use yer options and make demands.
+-------------------------------------------------
+
+area.js:
+
+````javascript
+#!/usr/bin/env node
+var argv = require('yargs')
+ .usage('Usage: $0 -w [num] -h [num]')
+ .demand(['w','h'])
+ .argv;
+
+console.log("The area is:", argv.w * argv.h);
+````
+
+***
+
+ $ ./area.js -w 55 -h 11
+ The area is: 605
+
+ $ node ./area.js -w 4.91 -w 2.51
+ Usage: area.js -w [num] -h [num]
+
+ Options:
+ -w [required]
+ -h [required]
+
+ Missing required arguments: h
+
+After yer demands have been met, demand more! Ask for non-hypenated arguments!
+-----------------------------------------
+
+demand_count.js:
+
+````javascript
+#!/usr/bin/env node
+var argv = require('yargs')
+ .demand(2)
+ .argv;
+console.dir(argv);
+````
+
+***
+
+ $ ./demand_count.js a
+
+ Not enough non-option arguments: got 1, need at least 2
+
+ $ ./demand_count.js a b
+ { _: [ 'a', 'b' ], '$0': 'demand_count.js' }
+
+ $ ./demand_count.js a b c
+ { _: [ 'a', 'b', 'c' ], '$0': 'demand_count.js' }
+
+EVEN MORE SHIVER ME TIMBERS!
+------------------
+
+default_singles.js:
+
+````javascript
+#!/usr/bin/env node
+var argv = require('yargs')
+ .default('x', 10)
+ .default('y', 10)
+ .argv
+;
+console.log(argv.x + argv.y);
+````
+
+***
+
+ $ ./default_singles.js -x 5
+ 15
+
+default_hash.js:
+
+````javascript
+#!/usr/bin/env node
+var argv = require('yargs')
+ .default({ x : 10, y : 10 })
+ .argv
+;
+console.log(argv.x + argv.y);
+````
+
+***
+
+ $ ./default_hash.js -y 7
+ 17
+
+And if you really want to get all descriptive about it...
+---------------------------------------------------------
+
+boolean_single.js:
+
+````javascript
+#!/usr/bin/env node
+var argv = require('yargs')
+ .boolean('v')
+ .argv
+;
+console.dir(argv.v);
+console.dir(argv._);
+````
+
+***
+
+ $ ./boolean_single.js -v "me hearties" yo ho
+ true
+ [ 'me hearties', 'yo', 'ho' ]
+
+
+boolean_double.js:
+
+````javascript
+#!/usr/bin/env node
+var argv = require('yargs')
+ .boolean(['x','y','z'])
+ .argv
+;
+console.dir([ argv.x, argv.y, argv.z ]);
+console.dir(argv._);
+````
+
+***
+
+ $ ./boolean_double.js -x -z one two three
+ [ true, false, true ]
+ [ 'one', 'two', 'three' ]
+
+Yargs is here to help you...
+---------------------------
+
+Ye can describe parameters fer help messages and set aliases. Yargs figures
+out how ter format a handy help string automatically.
+
+line_count.js:
+
+````javascript
+#!/usr/bin/env node
+var argv = require('yargs')
+ .usage('Usage: $0 <command> [options]')
+ .command('count', 'Count the lines in a file')
+ .demand(1)
+ .example('$0 count -f foo.js', 'count the lines in the given file')
+ .demand('f')
+ .alias('f', 'file')
+ .nargs('f', 1)
+ .describe('f', 'Load a file')
+ .help('h')
+ .alias('h', 'help')
+ .epilog('copyright 2015')
+ .argv;
+
+var fs = require('fs');
+var s = fs.createReadStream(argv.file);
+
+var lines = 0;
+s.on('data', function (buf) {
+ lines += buf.toString().match(/\n/g).length;
+});
+
+s.on('end', function () {
+ console.log(lines);
+});
+````
+
+***
+ $ node line_count.js count
+ Usage: line_count.js <command> [options]
+
+ Commands:
+ count Count the lines in a file
+
+ Options:
+ -f, --file Load a file [required]
+ -h, --help Show help [boolean]
+
+ Examples:
+ line_count.js count -f foo.js count the lines in the given file
+
+ copyright 2015
+
+ Missing required arguments: f
+
+ $ node line_count.js count --file line_count.js
+ 26
+
+ $ node line_count.js count -f line_count.js
+ 26
+
+methods
+=======
+
+By itself,
+
+````javascript
+require('yargs').argv
+````
+
+will use the `process.argv` array to construct the `argv` object.
+
+You can pass in the `process.argv` yourself:
+
+````javascript
+require('yargs')([ '-x', '1', '-y', '2' ]).argv
+````
+
+or use `.parse()` to do the same thing:
+
+````javascript
+require('yargs').parse([ '-x', '1', '-y', '2' ])
+````
+
+The rest of these methods below come in just before the terminating `.argv`.
+
+.alias(key, alias)
+------------------
+
+Set key names as equivalent such that updates to a key will propagate to aliases
+and vice-versa.
+
+Optionally `.alias()` can take an object that maps keys to aliases.
+Each key of this object should be the canonical version of the option, and each
+value should be a string or an array of strings.
+
+.argv
+-----
+
+Get the arguments as a plain old object.
+
+Arguments without a corresponding flag show up in the `argv._` array.
+
+The script name or node command is available at `argv.$0` similarly to how `$0`
+works in bash or perl.
+
+If `yargs` is executed in an environment that embeds node and there's no script name (e.g. [Electron]
+(http://electron.atom.io/) or [nw.js](http://nwjs.io/)), it will ignore the first parameter since it
+expects it to be the script name. In order to override this behavior, use `.parse(process.argv.slice(1))`
+instead of `.argv` and the first parameter won't be ignored.
+
+.array(key)
+----------
+
+Tell the parser to interpret `key` as an array. If `.array('foo')` is set,
+`--foo foo bar` will be parsed as `['foo', 'bar']` rather than as `'foo'`.
+
+.boolean(key)
+-------------
+
+Interpret `key` as a boolean. If a non-flag option follows `key` in
+`process.argv`, that string won't get set as the value of `key`.
+
+`key` will default to `false`, unless a `default(key, undefined)` is
+explicitly set.
+
+If `key` is an array, interpret all the elements as booleans.
+
+.check(fn)
+----------
+
+Check that certain conditions are met in the provided arguments.
+
+`fn` is called with two arguments, the parsed `argv` hash and an array of options and their aliases.
+
+If `fn` throws or returns a non-truthy value, show the thrown error, usage information, and
+exit.
+
+.choices(key, choices)
+----------------------
+
+Limit valid values for `key` to a predefined set of `choices`, given as an array
+or as an individual value.
+
+```js
+var argv = require('yargs')
+ .alias('i', 'ingredient')
+ .describe('i', 'choose your sandwich ingredients')
+ .choices('i', ['peanut-butter', 'jelly', 'banana', 'pickles'])
+ .help('help')
+ .argv
+```
+
+If this method is called multiple times, all enumerated values will be merged
+together. Choices are generally strings or numbers, and value matching is
+case-sensitive.
+
+Optionally `.choices()` can take an object that maps multiple keys to their
+choices.
+
+Choices can also be specified as `choices` in the object given to `option()`.
+
+```js
+var argv = require('yargs')
+ .option('size', {
+ alias: 's',
+ describe: 'choose a size',
+ choices: ['xs', 's', 'm', 'l', 'xl']
+ })
+ .argv
+```
+
+.command(cmd, desc, [fn])
+-------------------
+
+Document the commands exposed by your application.
+
+Use `desc` to provide a description for each command your application accepts (the
+values stored in `argv._`). Set `desc` to `false` to create a hidden command.
+Hidden commands don't show up in the help output and aren't available for
+completion.
+
+Optionally, you can provide a handler `fn` which will be executed when
+a given command is provided. The handler will be executed with an instance
+of `yargs`, which can be used to compose nested commands.
+
+Here's an example of top-level and nested commands in action:
+
+```js
+var argv = require('yargs')
+ .usage('npm <command>')
+ .command('install', 'tis a mighty fine package to install')
+ .command('publish', 'shiver me timbers, should you be sharing all that', function (yargs) {
+ argv = yargs.option('f', {
+ alias: 'force',
+ description: 'yar, it usually be a bad idea'
+ })
+ .help('help')
+ .argv
+ })
+ .help('help')
+ .argv;
+```
+
+.completion(cmd, [description], [fn]);
+-------------
+
+Enable bash-completion shortcuts for commands and options.
+
+`cmd`: When present in `argv._`, will result in the `.bashrc` completion script
+being outputted. To enable bash completions, concat the generated script to your
+`.bashrc` or `.bash_profile`.
+
+`description`: Provide a description in your usage instructions for the command
+that generates bash completion scripts.
+
+`fn`: Rather than relying on yargs' default completion functionality, which
+shiver me timbers is pretty awesome, you can provide your own completion
+method.
+
+```js
+var argv = require('yargs')
+ .completion('completion', function(current, argv) {
+ // 'current' is the current command being completed.
+ // 'argv' is the parsed arguments so far.
+ // simply return an array of completions.
+ return [
+ 'foo',
+ 'bar'
+ ];
+ })
+ .argv;
+```
+
+But wait, there's more! You can provide asynchronous completions.
+
+```js
+var argv = require('yargs')
+ .completion('completion', function(current, argv, done) {
+ setTimeout(function() {
+ done([
+ 'apple',
+ 'banana'
+ ]);
+ }, 500);
+ })
+ .argv;
+```
+
+.config(key, [description])
+------------
+
+Tells the parser that if the option specified by `key` is passed in, it
+should be interpreted as a path to a JSON config file. The file is loaded
+and parsed, and its properties are set as arguments. If present, the
+`description` parameter customizes the description of the config (`key`) option
+in the usage string.
+
+.default(key, value, [description])
+--------------------
+
+Set `argv[key]` to `value` if no option was specified in `process.argv`.
+
+Optionally `.default()` can take an object that maps keys to default values.
+
+But wait, there's more! The default value can be a `function` which returns
+a value. The name of the function will be used in the usage string:
+
+```js
+var argv = require('yargs')
+ .default('random', function randomValue() {
+ return Math.random() * 256;
+ }).argv;
+```
+
+Optionally, `description` can also be provided and will take precedence over
+displaying the value in the usage instructions:
+
+```js
+.default('timeout', 60000, '(one-minute)')
+```
+
+<a name="demand-key-msg-boolean"></a>.demand(key, [msg | boolean])
+------------------------------
+.demand(count, [max], [msg])
+------------------------------
+
+If `key` is a string, show the usage information and exit if `key` wasn't
+specified in `process.argv`.
+
+If `key` is a number, demand at least as many non-option arguments, which show
+up in `argv._`. A second number can also optionally be provided, which indicates
+the maximum number of non-option arguments.
+
+If `key` is an array, demand each element.
+
+If a `msg` string is given, it will be printed when the argument is missing,
+instead of the standard error message. This is especially helpful for the non-option arguments in `argv._`.
+
+If a `boolean` value is given, it controls whether the option is demanded;
+this is useful when using `.options()` to specify command line parameters.
+
+.describe(key, desc)
+--------------------
+
+Describe a `key` for the generated usage information.
+
+Optionally `.describe()` can take an object that maps keys to descriptions.
+
+.epilog(str)
+------------
+.epilogue(str)
+--------------
+
+A message to print at the end of the usage instructions, e.g.
+
+```js
+var argv = require('yargs')
+ .epilogue('for more information, find our manual at http://example.com');
+```
+
+.example(cmd, desc)
+-------------------
+
+Give some example invocations of your program. Inside `cmd`, the string
+`$0` will get interpolated to the current script name or node command for the
+present script similar to how `$0` works in bash or perl.
+Examples will be printed out as part of the help message.
+
+.exitProcess(enable)
+----------------------------------
+
+By default, yargs exits the process when the user passes a help flag, uses the
+`.version` functionality, or when validation fails. Calling
+`.exitProcess(false)` disables this behavior, enabling further actions after
+yargs have been validated.
+
+.fail(fn)
+---------
+
+Method to execute when a failure occurs, rather than printing the failure message.
+
+`fn` is called with the failure message that would have been printed.
+
+.help([option, [description]])
+------------------------------
+
+Add an option (e.g. `--help`) that displays the usage string and exits the
+process. If present, the `description` parameter customizes the description of
+the help option in the usage string.
+
+If invoked without parameters, `.help()` returns the generated usage string.
+
+Example:
+
+```js
+var yargs = require("yargs")
+ .usage("$0 -operand1 number -operand2 number -operation [add|subtract]");
+console.log(yargs.help());
+```
+
+Later on, `argv` can be retrieved with `yargs.argv`.
+
+.implies(x, y)
+--------------
+
+Given the key `x` is set, it is required that the key `y` is set.
+
+Optionally `.implies()` can accept an object specifying multiple implications.
+
+.locale(locale)
+---------------
+
+Set a locale other than the default `en` locale:
+
+```js
+var argv = require('yargs')
+ .usage('./$0 - follow ye instructions true')
+ .option('option', {
+ alias: 'o',
+ describe: "'tis a mighty fine option",
+ demand: true
+ })
+ .command('run', "Arrr, ya best be knowin' what yer doin'")
+ .example('$0 run foo', "shiver me timbers, here's an example for ye")
+ .help('help')
+ .wrap(70)
+ .locale('pirate')
+ .argv
+```
+
+***
+
+```shell
+./test.js - follow ye instructions true
+
+Choose yer command:
+ run Arrr, ya best be knowin' what yer doin'
+
+Options for me hearties!
+ --option, -o 'tis a mighty fine option [requi-yar-ed]
+ --help Parlay this here code of conduct [boolean]
+
+Ex. marks the spot:
+ test.js run foo shiver me timbers, here's an example for ye
+
+Ye be havin' to set the followin' argument land lubber: option
+```
+
+Locales currently supported:
+
+* **en:** American English.
+* **es:** Spanish.
+* **fr:** French.
+* **pt:** Portuguese.
+* **pirate:** American Pirate.
+
+To submit a new translation for yargs:
+
+1. use `./locales/en.json` as a starting point.
+2. submit a pull request with the new locale file.
+
+.nargs(key, count)
+-----------
+
+The number of arguments that should be consumed after a key. This can be a
+useful hint to prevent parsing ambiguity. For example:
+
+```js
+var argv = require('yargs')
+ .nargs('token', 1)
+ .parse(['--token', '-my-token']);
+```
+
+parses as:
+
+`{ _: [], token: '-my-token', '$0': 'node test' }`
+
+Optionally `.nargs()` can take an object of `key`/`narg` pairs.
+
+.option(key, opt)
+-----------------
+.options(key, opt)
+------------------
+
+Instead of chaining together `.alias().demand().default().describe().string()`, you can specify
+keys in `opt` for each of the chainable methods.
+
+For example:
+
+````javascript
+var argv = require('yargs')
+ .option('f', {
+ alias: 'file',
+ demand: true,
+ default: '/etc/passwd',
+ describe: 'x marks the spot',
+ type: 'string'
+ })
+ .argv
+;
+````
+
+is the same as
+
+````javascript
+var argv = require('yargs')
+ .alias('f', 'file')
+ .demand('f')
+ .default('f', '/etc/passwd')
+ .describe('f', 'x marks the spot')
+ .string('f')
+ .argv
+;
+````
+
+Optionally `.options()` can take an object that maps keys to `opt` parameters.
+
+````javascript
+var argv = require('yargs')
+ .options({
+ 'f': {
+ alias: 'file',
+ demand: true,
+ default: '/etc/passwd',
+ describe: 'x marks the spot',
+ type: 'string'
+ }
+ })
+ .argv
+;
+````
+
+.parse(args)
+------------
+
+Parse `args` instead of `process.argv`. Returns the `argv` object.
+
+.require(key, [msg | boolean])
+------------------------------
+.required(key, [msg | boolean])
+------------------------------
+
+An alias for [`demand()`](#demand-key-msg-boolean). See docs there.
+
+.requiresArg(key)
+-----------------
+
+Specifies either a single option key (string), or an array of options that
+must be followed by option values. If any option value is missing, show the
+usage information and exit.
+
+The default behavior is to set the value of any key not followed by an
+option value to `true`.
+
+.reset()
+--------
+
+Reset the argument object built up so far. This is useful for
+creating nested command line interfaces.
+
+```js
+var yargs = require('yargs')
+ .usage('$0 command')
+ .command('hello', 'hello command')
+ .command('world', 'world command')
+ .demand(1, 'must provide a valid command'),
+ argv = yargs.argv,
+ command = argv._[0];
+
+if (command === 'hello') {
+ yargs.reset()
+ .usage('$0 hello')
+ .help('h')
+ .example('$0 hello', 'print the hello message!')
+ .argv
+
+ console.log('hello!');
+} else if (command === 'world'){
+ yargs.reset()
+ .usage('$0 world')
+ .help('h')
+ .example('$0 world', 'print the world message!')
+ .argv
+
+ console.log('world!');
+} else {
+ yargs.showHelp();
+}
+```
+
+.showCompletionScript()
+----------------------
+
+Generate a bash completion script. Users of your application can install this
+script in their `.bashrc`, and yargs will provide completion shortcuts for
+commands and options.
+
+.showHelp(consoleLevel='error')
+---------------------------
+
+Print the usage data using the [`console`](https://nodejs.org/api/console.html) function `consoleLevel` for printing.
+
+Example:
+
+```js
+var yargs = require("yargs")
+ .usage("$0 -operand1 number -operand2 number -operation [add|subtract]");
+yargs.showHelp(); //prints to stderr using console.error()
+```
+
+Or, to print the usage data to `stdout` instead, you can specify the use of `console.log`:
+
+```js
+yargs.showHelp("log"); //prints to stdout using console.log()
+```
+
+Later on, `argv` can be retrieved with `yargs.argv`.
+
+.showHelpOnFail(enable, [message])
+----------------------------------
+
+By default, yargs outputs a usage string if any error is detected. Use the
+`.showHelpOnFail()` method to customize this behavior. If `enable` is `false`,
+the usage string is not output. If the `message` parameter is present, this
+message is output after the error message.
+
+line_count.js:
+
+````javascript
+#!/usr/bin/env node
+var argv = require('yargs')
+ .usage('Count the lines in a file.\nUsage: $0 -f <file>')
+ .demand('f')
+ .alias('f', 'file')
+ .describe('f', 'Load a file')
+ .string('f')
+ .showHelpOnFail(false, 'Specify --help for available options')
+ .help('help')
+ .argv;
+
+// etc.
+````
+
+***
+
+```
+$ node line_count.js
+Missing argument value: f
+
+Specify --help for available options
+```
+
+.strict()
+---------
+
+Any command-line argument given that is not demanded, or does not have a
+corresponding description, will be reported as an error.
+
+.string(key)
+------------
+
+Tell the parser logic not to interpret `key` as a number or boolean.
+This can be useful if you need to preserve leading zeros in an input.
+
+If `key` is an array, interpret all the elements as strings.
+
+`.string('_')` will result in non-hyphenated arguments being interpreted as strings,
+regardless of whether they resemble numbers.
+
+.updateLocale(obj)
+------------------
+.updateStrings(obj)
+------------------
+
+Override the default strings used by yargs with the key/value
+pairs provided in `obj`:
+
+```js
+var argv = require('yargs')
+ .command('run', 'the run command')
+ .help('help')
+ .updateStrings({
+ 'Commands:': 'My Commands -->\n'
+ })
+ .wrap(null)
+ .argv
+```
+
+***
+
+```shell
+My Commands -->
+
+ run the run command
+
+Options:
+ --help Show help [boolean]
+```
+
+If you explicitly specify a `locale()`, you should do so *before* calling
+`updateStrings()`.
+
+.usage(message, [opts])
+---------------------
+
+Set a usage message to show which commands to use. Inside `message`, the string
+`$0` will get interpolated to the current script name or node command for the
+present script similar to how `$0` works in bash or perl.
+
+`opts` is optional and acts like calling `.options(opts)`.
+
+.version(version, [option], [description])
+----------------------------------------
+
+Add an option (e.g. `--version`) that displays the version number (given by the
+`version` parameter) and exits the process. If present, the `description`
+parameter customizes the description of the version option in the usage string.
+
+You can provide a `function` for version, rather than a string.
+This is useful if you want to use the version from your package.json:
+
+```js
+var argv = require('yargs')
+ .version(function() {
+ return require('../package').version;
+ })
+ .argv;
+```
+
+.wrap(columns)
+--------------
+
+Format usage output to wrap at `columns` many columns.
+
+By default wrap will be set to `Math.min(80, windowWidth)`. Use `.wrap(null)` to
+specify no column limit (no right-align). Use `.wrap(yargs.terminalWidth())` to
+maximize the width of yargs' usage instructions.
+
+parsing tricks
+==============
+
+stop parsing
+------------
+
+Use `--` to stop parsing flags and stuff the remainder into `argv._`.
+
+ $ node examples/reflect.js -a 1 -b 2 -- -c 3 -d 4
+ { _: [ '-c', '3', '-d', '4' ],
+ a: 1,
+ b: 2,
+ '$0': 'examples/reflect.js' }
+
+negate fields
+-------------
+
+If you want to explicity set a field to false instead of just leaving it
+undefined or to override a default you can do `--no-key`.
+
+ $ node examples/reflect.js -a --no-b
+ { _: [], a: true, b: false, '$0': 'examples/reflect.js' }
+
+numbers
+-------
+
+Every argument that looks like a number (`!isNaN(Number(arg))`) is converted to
+one. This way you can just `net.createConnection(argv.port)` and you can add
+numbers out of `argv` with `+` without having that mean concatenation,
+which is super frustrating.
+
+duplicates
+----------
+
+If you specify a flag multiple times it will get turned into an array containing
+all the values in order.
+
+ $ node examples/reflect.js -x 5 -x 8 -x 0
+ { _: [], x: [ 5, 8, 0 ], '$0': 'examples/reflect.js' }
+
+dot notation
+------------
+
+When you use dots (`.`s) in argument names, an implicit object path is assumed.
+This lets you organize arguments into nested objects.
+
+ $ node examples/reflect.js --foo.bar.baz=33 --foo.quux=5
+ { _: [],
+ foo: { bar: { baz: 33 }, quux: 5 },
+ '$0': 'examples/reflect.js' }
+
+short numbers
+-------------
+
+Short numeric `-n5` style arguments work too:
+
+ $ node examples/reflect.js -n123 -m456
+ { _: [], n: 123, m: 456, '$0': 'examples/reflect.js' }
+
+installation
+============
+
+With [npm](http://github.com/isaacs/npm), just do:
+
+ npm install yargs
+
+or clone this project on github:
+
+ git clone http://github.com/bcoe/yargs.git
+
+To run the tests with npm, just do:
+
+ npm test
+
+inspired by
+===========
+
+This module is loosely inspired by Perl's
+[Getopt::Casual](http://search.cpan.org/~photo/Getopt-Casual-0.13.1/Casual.pm).
+
+
+
+[travis-url]: https://travis-ci.org/bcoe/yargs
+[travis-image]: https://img.shields.io/travis/bcoe/yargs.svg
+[gemnasium-url]: https://gemnasium.com/bcoe/yargs
+[gemnasium-image]: https://img.shields.io/gemnasium/bcoe/yargs.svg
+[coveralls-url]: https://coveralls.io/github/bcoe/yargs
+[coveralls-image]: https://img.shields.io/coveralls/bcoe/yargs.svg
+[npm-url]: https://npmjs.org/package/yargs
+[npm-image]: https://img.shields.io/npm/v/yargs.svg
--- /dev/null
+###-begin-{{app_name}}-completions-###
+#
+# yargs command completion script
+#
+# Installation: {{app_path}} completion >> ~/.bashrc
+# or {{app_path}} completion >> ~/.bash_profile on OSX.
+#
+_yargs_completions()
+{
+ local cur_word args type_list
+
+ cur_word="${COMP_WORDS[COMP_CWORD]}"
+ args=$(printf "%s " "${COMP_WORDS[@]}")
+
+ # ask yargs to generate completions.
+ type_list=`{{app_path}} --get-yargs-completions $args`
+
+ COMPREPLY=( $(compgen -W "${type_list}" -- ${cur_word}) )
+
+ # if no match was found, fall back to filename completion
+ if [ ${#COMPREPLY[@]} -eq 0 ]; then
+ COMPREPLY=( $(compgen -f -- "${cur_word}" ) )
+ fi
+
+ return 0
+}
+complete -F _yargs_completions {{app_name}}
+###-end-{{app_name}}-completions-###
--- /dev/null
+var assert = require('assert')
+var Completion = require('./lib/completion')
+var Parser = require('./lib/parser')
+var path = require('path')
+var Usage = require('./lib/usage')
+var Validation = require('./lib/validation')
+var Y18n = require('y18n')
+
+Argv(process.argv.slice(2))
+
+var exports = module.exports = Argv
+function Argv (processArgs, cwd) {
+ processArgs = processArgs || [] // handle calling yargs().
+
+ var self = {}
+ var completion = null
+ var usage = null
+ var validation = null
+ var y18n = Y18n({
+ directory: path.resolve(__dirname, './locales'),
+ locale: 'en',
+ updateFiles: false
+ })
+
+ if (!cwd) cwd = process.cwd()
+
+ self.$0 = process.argv
+ .slice(0, 2)
+ .map(function (x, i) {
+ // ignore the node bin, specify this in your
+ // bin file with #!/usr/bin/env node
+ if (i === 0 && /\b(node|iojs)$/.test(x)) return
+ var b = rebase(cwd, x)
+ return x.match(/^\//) && b.length < x.length
+ ? b : x
+ })
+ .join(' ').trim()
+
+ if (process.env._ !== undefined && process.argv[1] === process.env._) {
+ self.$0 = process.env._.replace(
+ path.dirname(process.execPath) + '/', ''
+ )
+ }
+
+ var options
+ self.resetOptions = self.reset = function () {
+ // put yargs back into its initial
+ // state, this is useful for creating a
+ // nested CLI.
+ options = {
+ array: [],
+ boolean: [],
+ string: [],
+ narg: {},
+ key: {},
+ alias: {},
+ default: {},
+ defaultDescription: {},
+ choices: {},
+ requiresArg: [],
+ count: [],
+ normalize: [],
+ config: []
+ }
+
+ usage = Usage(self, y18n) // handle usage output.
+ validation = Validation(self, usage, y18n) // handle arg validation.
+ completion = Completion(self, usage)
+
+ demanded = {}
+
+ exitProcess = true
+ strict = false
+ helpOpt = null
+ versionOpt = null
+ commandHandlers = {}
+ self.parsed = false
+
+ return self
+ }
+ self.resetOptions()
+
+ self.boolean = function (bools) {
+ options.boolean.push.apply(options.boolean, [].concat(bools))
+ return self
+ }
+
+ self.array = function (arrays) {
+ options.array.push.apply(options.array, [].concat(arrays))
+ return self
+ }
+
+ self.nargs = function (key, n) {
+ if (typeof key === 'object') {
+ Object.keys(key).forEach(function (k) {
+ self.nargs(k, key[k])
+ })
+ } else {
+ options.narg[key] = n
+ }
+ return self
+ }
+
+ self.choices = function (key, values) {
+ if (typeof key === 'object') {
+ Object.keys(key).forEach(function (k) {
+ self.choices(k, key[k])
+ })
+ } else {
+ options.choices[key] = (options.choices[key] || []).concat(values)
+ }
+ return self
+ }
+
+ self.normalize = function (strings) {
+ options.normalize.push.apply(options.normalize, [].concat(strings))
+ return self
+ }
+
+ self.config = function (key, msg) {
+ self.describe(key, msg || usage.deferY18nLookup('Path to JSON config file'))
+ options.config.push.apply(options.config, [].concat(key))
+ return self
+ }
+
+ self.example = function (cmd, description) {
+ usage.example(cmd, description)
+ return self
+ }
+
+ self.command = function (cmd, description, fn) {
+ if (description !== false) {
+ usage.command(cmd, description)
+ }
+ if (fn) commandHandlers[cmd] = fn
+ return self
+ }
+
+ var commandHandlers = {}
+ self.getCommandHandlers = function () {
+ return commandHandlers
+ }
+
+ self.string = function (strings) {
+ options.string.push.apply(options.string, [].concat(strings))
+ return self
+ }
+
+ self.default = function (key, value, defaultDescription) {
+ if (typeof key === 'object') {
+ Object.keys(key).forEach(function (k) {
+ self.default(k, key[k])
+ })
+ } else {
+ if (typeof value === 'function') {
+ defaultDescription = usage.functionDescription(value, defaultDescription)
+ value = value.call()
+ }
+ options.defaultDescription[key] = defaultDescription
+ options.default[key] = value
+ }
+ return self
+ }
+
+ self.alias = function (x, y) {
+ if (typeof x === 'object') {
+ Object.keys(x).forEach(function (key) {
+ self.alias(key, x[key])
+ })
+ } else {
+ options.alias[x] = (options.alias[x] || []).concat(y)
+ }
+ return self
+ }
+
+ self.count = function (counts) {
+ options.count.push.apply(options.count, [].concat(counts))
+ return self
+ }
+
+ var demanded = {}
+ self.demand = self.required = self.require = function (keys, max, msg) {
+ // you can optionally provide a 'max' key,
+ // which will raise an exception if too many '_'
+ // options are provided.
+ if (typeof max !== 'number') {
+ msg = max
+ max = Infinity
+ }
+
+ if (typeof keys === 'number') {
+ if (!demanded._) demanded._ = { count: 0, msg: null, max: max }
+ demanded._.count = keys
+ demanded._.msg = msg
+ } else if (Array.isArray(keys)) {
+ keys.forEach(function (key) {
+ self.demand(key, msg)
+ })
+ } else {
+ if (typeof msg === 'string') {
+ demanded[keys] = { msg: msg }
+ } else if (msg === true || typeof msg === 'undefined') {
+ demanded[keys] = { msg: undefined }
+ }
+ }
+
+ return self
+ }
+ self.getDemanded = function () {
+ return demanded
+ }
+
+ self.requiresArg = function (requiresArgs) {
+ options.requiresArg.push.apply(options.requiresArg, [].concat(requiresArgs))
+ return self
+ }
+
+ self.implies = function (key, value) {
+ validation.implies(key, value)
+ return self
+ }
+
+ self.usage = function (msg, opts) {
+ if (!opts && typeof msg === 'object') {
+ opts = msg
+ msg = null
+ }
+
+ usage.usage(msg)
+
+ if (opts) self.options(opts)
+
+ return self
+ }
+
+ self.epilogue = self.epilog = function (msg) {
+ usage.epilog(msg)
+ return self
+ }
+
+ self.fail = function (f) {
+ usage.failFn(f)
+ return self
+ }
+
+ self.check = function (f) {
+ validation.check(f)
+ return self
+ }
+
+ self.defaults = self.default
+
+ self.describe = function (key, desc) {
+ options.key[key] = true
+ usage.describe(key, desc)
+ return self
+ }
+
+ self.parse = function (args) {
+ return parseArgs(args)
+ }
+
+ self.option = self.options = function (key, opt) {
+ if (typeof key === 'object') {
+ Object.keys(key).forEach(function (k) {
+ self.options(k, key[k])
+ })
+ } else {
+ assert(typeof opt === 'object', 'second argument to option must be an object')
+
+ options.key[key] = true // track manually set keys.
+
+ if (opt.alias) self.alias(key, opt.alias)
+
+ var demand = opt.demand || opt.required || opt.require
+
+ if (demand) {
+ self.demand(key, demand)
+ } if ('config' in opt) {
+ self.config(key)
+ } if ('default' in opt) {
+ self.default(key, opt.default)
+ } if ('nargs' in opt) {
+ self.nargs(key, opt.nargs)
+ } if ('choices' in opt) {
+ self.choices(key, opt.choices)
+ } if (opt.boolean || opt.type === 'boolean') {
+ self.boolean(key)
+ if (opt.alias) self.boolean(opt.alias)
+ } if (opt.array || opt.type === 'array') {
+ self.array(key)
+ if (opt.alias) self.array(opt.alias)
+ } if (opt.string || opt.type === 'string') {
+ self.string(key)
+ if (opt.alias) self.string(opt.alias)
+ } if (opt.count || opt.type === 'count') {
+ self.count(key)
+ }
+
+ var desc = opt.describe || opt.description || opt.desc
+ if (desc) {
+ self.describe(key, desc)
+ }
+
+ if (opt.requiresArg) {
+ self.requiresArg(key)
+ }
+ }
+
+ return self
+ }
+ self.getOptions = function () {
+ return options
+ }
+
+ self.wrap = function (cols) {
+ usage.wrap(cols)
+ return self
+ }
+
+ var strict = false
+ self.strict = function () {
+ strict = true
+ return self
+ }
+ self.getStrict = function () {
+ return strict
+ }
+
+ self.showHelp = function (level) {
+ if (!self.parsed) parseArgs(processArgs) // run parser, if it has not already been executed.
+ usage.showHelp(level)
+ return self
+ }
+
+ var versionOpt = null
+ self.version = function (ver, opt, msg) {
+ versionOpt = opt || 'version'
+ usage.version(ver)
+ self.boolean(versionOpt)
+ self.describe(versionOpt, msg || usage.deferY18nLookup('Show version number'))
+ return self
+ }
+
+ var helpOpt = null
+ self.addHelpOpt = function (opt, msg) {
+ helpOpt = opt
+ self.boolean(opt)
+ self.describe(opt, msg || usage.deferY18nLookup('Show help'))
+ return self
+ }
+
+ self.showHelpOnFail = function (enabled, message) {
+ usage.showHelpOnFail(enabled, message)
+ return self
+ }
+
+ var exitProcess = true
+ self.exitProcess = function (enabled) {
+ if (typeof enabled !== 'boolean') {
+ enabled = true
+ }
+ exitProcess = enabled
+ return self
+ }
+ self.getExitProcess = function () {
+ return exitProcess
+ }
+
+ self.help = function () {
+ if (arguments.length > 0) return self.addHelpOpt.apply(self, arguments)
+
+ if (!self.parsed) parseArgs(processArgs) // run parser, if it has not already been executed.
+
+ return usage.help()
+ }
+
+ var completionCommand = null
+ self.completion = function (cmd, desc, fn) {
+ // a function to execute when generating
+ // completions can be provided as the second
+ // or third argument to completion.
+ if (typeof desc === 'function') {
+ fn = desc
+ desc = null
+ }
+
+ // register the completion command.
+ completionCommand = cmd || 'completion'
+ if (!desc && desc !== false) {
+ desc = 'generate bash completion script'
+ }
+ self.command(completionCommand, desc)
+
+ // a function can be provided
+ if (fn) completion.registerFunction(fn)
+
+ return self
+ }
+
+ self.showCompletionScript = function ($0) {
+ $0 = $0 || self.$0
+ console.log(completion.generateCompletionScript($0))
+ return self
+ }
+
+ self.locale = function (locale) {
+ y18n.setLocale(locale)
+ return self
+ }
+
+ self.updateStrings = self.updateLocale = function (obj) {
+ y18n.updateLocale(obj)
+ return self
+ }
+
+ self.getUsageInstance = function () {
+ return usage
+ }
+
+ self.getValidationInstance = function () {
+ return validation
+ }
+
+ self.terminalWidth = function () {
+ return require('window-size').width
+ }
+
+ Object.defineProperty(self, 'argv', {
+ get: function () {
+ var args = null
+
+ try {
+ args = parseArgs(processArgs)
+ } catch (err) {
+ usage.fail(err.message)
+ }
+
+ return args
+ },
+ enumerable: true
+ })
+
+ function parseArgs (args) {
+ var parsed = Parser(args, options, y18n)
+ var argv = parsed.argv
+ var aliases = parsed.aliases
+
+ argv.$0 = self.$0
+
+ self.parsed = parsed
+
+ // while building up the argv object, there
+ // are two passes through the parser. If completion
+ // is being performed short-circuit on the first pass.
+ if (completionCommand &&
+ (process.argv.join(' ')).indexOf(completion.completionKey) !== -1 &&
+ !argv[completion.completionKey]) {
+ return argv
+ }
+
+ // if there's a handler associated with a
+ // command defer processing to it.
+ var handlerKeys = Object.keys(self.getCommandHandlers())
+ for (var i = 0, command; (command = handlerKeys[i]) !== undefined; i++) {
+ if (~argv._.indexOf(command)) {
+ self.getCommandHandlers()[command](self.reset())
+ return self.argv
+ }
+ }
+
+ // generate a completion script for adding to ~/.bashrc.
+ if (completionCommand && ~argv._.indexOf(completionCommand) && !argv[completion.completionKey]) {
+ self.showCompletionScript()
+ if (exitProcess) {
+ process.exit(0)
+ }
+ }
+
+ // we must run completions first, a user might
+ // want to complete the --help or --version option.
+ if (completion.completionKey in argv) {
+ // we allow for asynchronous completions,
+ // e.g., loading in a list of commands from an API.
+ completion.getCompletion(function (completions) {
+ ;(completions || []).forEach(function (completion) {
+ console.log(completion)
+ })
+
+ if (exitProcess) {
+ process.exit(0)
+ }
+ })
+ return
+ }
+
+ Object.keys(argv).forEach(function (key) {
+ if (key === helpOpt && argv[key]) {
+ self.showHelp('log')
+ if (exitProcess) {
+ process.exit(0)
+ }
+ } else if (key === versionOpt && argv[key]) {
+ usage.showVersion()
+ if (exitProcess) {
+ process.exit(0)
+ }
+ }
+ })
+
+ if (parsed.error) throw parsed.error
+
+ // if we're executed via bash completion, don't
+ // bother with validation.
+ if (!argv[completion.completionKey]) {
+ validation.nonOptionCount(argv)
+ validation.missingArgumentValue(argv)
+ validation.requiredArguments(argv)
+ if (strict) validation.unknownArguments(argv, aliases)
+ validation.customChecks(argv, aliases)
+ validation.limitedChoices(argv)
+ validation.implications(argv)
+ }
+
+ setPlaceholderKeys(argv)
+
+ return argv
+ }
+
+ function setPlaceholderKeys (argv) {
+ Object.keys(options.key).forEach(function (key) {
+ if (typeof argv[key] === 'undefined') argv[key] = undefined
+ })
+ }
+
+ sigletonify(self)
+ return self
+}
+
+// rebase an absolute path to a relative one with respect to a base directory
+// exported for tests
+exports.rebase = rebase
+function rebase (base, dir) {
+ return path.relative(base, dir)
+}
+
+/* Hack an instance of Argv with process.argv into Argv
+ so people can do
+ require('yargs')(['--beeble=1','-z','zizzle']).argv
+ to parse a list of args and
+ require('yargs').argv
+ to get a parsed version of process.argv.
+*/
+function sigletonify (inst) {
+ Object.keys(inst).forEach(function (key) {
+ if (key === 'argv') {
+ Argv.__defineGetter__(key, inst.__lookupGetter__(key))
+ } else {
+ Argv[key] = typeof inst[key] === 'function'
+ ? inst[key].bind(inst)
+ : inst[key]
+ }
+ })
+}
--- /dev/null
+var fs = require('fs')
+var path = require('path')
+
+// add bash completions to your
+// yargs-powered applications.
+module.exports = function (yargs, usage) {
+ var self = {
+ completionKey: 'get-yargs-completions'
+ }
+
+ // get a list of completion commands.
+ self.getCompletion = function (done) {
+ var completions = []
+ var current = process.argv[process.argv.length - 1]
+ var previous = process.argv.slice(process.argv.indexOf('--' + self.completionKey) + 1)
+ var argv = yargs.parse(previous)
+
+ // a custom completion function can be provided
+ // to completion().
+ if (completionFunction) {
+ if (completionFunction.length < 3) {
+ // synchronous completion function.
+ return done(completionFunction(current, argv))
+ } else {
+ // asynchronous completion function
+ return completionFunction(current, argv, function (completions) {
+ done(completions)
+ })
+ }
+ }
+
+ var handlers = yargs.getCommandHandlers()
+ for (var i = 0, ii = previous.length; i < ii; ++i) {
+ if (handlers[previous[i]]) {
+ return handlers[previous[i]](yargs.reset())
+ }
+ }
+
+ if (!current.match(/^-/)) {
+ usage.getCommands().forEach(function (command) {
+ if (previous.indexOf(command[0]) === -1) {
+ completions.push(command[0])
+ }
+ })
+ }
+
+ if (current.match(/^-/)) {
+ Object.keys(yargs.getOptions().key).forEach(function (key) {
+ completions.push('--' + key)
+ })
+ }
+
+ done(completions)
+ }
+
+ // generate the completion script to add to your .bashrc.
+ self.generateCompletionScript = function ($0) {
+ var script = fs.readFileSync(
+ path.resolve(__dirname, '../completion.sh.hbs'),
+ 'utf-8'
+ )
+ var name = path.basename($0)
+
+ // add ./to applications not yet installed as bin.
+ if ($0.match(/\.js$/)) $0 = './' + $0
+
+ script = script.replace(/{{app_name}}/g, name)
+ return script.replace(/{{app_path}}/g, $0)
+ }
+
+ // register a function to perform your own custom
+ // completions., this function can be either
+ // synchrnous or asynchronous.
+ var completionFunction = null
+ self.registerFunction = function (fn) {
+ completionFunction = fn
+ }
+
+ return self
+}
--- /dev/null
+// fancy-pants parsing of argv, originally forked
+// from minimist: https://www.npmjs.com/package/minimist
+var camelCase = require('camelcase')
+var path = require('path')
+
+function increment (orig) {
+ return orig !== undefined ? orig + 1 : 0
+}
+
+module.exports = function (args, opts, y18n) {
+ if (!opts) opts = {}
+
+ var __ = y18n.__
+ var error = null
+ var flags = { arrays: {}, bools: {}, strings: {}, counts: {}, normalize: {}, configs: {}, defaulted: {} }
+
+ ;[].concat(opts['array']).filter(Boolean).forEach(function (key) {
+ flags.arrays[key] = true
+ })
+
+ ;[].concat(opts['boolean']).filter(Boolean).forEach(function (key) {
+ flags.bools[key] = true
+ })
+
+ ;[].concat(opts.string).filter(Boolean).forEach(function (key) {
+ flags.strings[key] = true
+ })
+
+ ;[].concat(opts.count).filter(Boolean).forEach(function (key) {
+ flags.counts[key] = true
+ })
+
+ ;[].concat(opts.normalize).filter(Boolean).forEach(function (key) {
+ flags.normalize[key] = true
+ })
+
+ ;[].concat(opts.config).filter(Boolean).forEach(function (key) {
+ flags.configs[key] = true
+ })
+
+ var aliases = {}
+ var newAliases = {}
+
+ extendAliases(opts.key)
+ extendAliases(opts.alias)
+
+ var defaults = opts['default'] || {}
+ Object.keys(defaults).forEach(function (key) {
+ if (/-/.test(key) && !opts.alias[key]) {
+ aliases[key] = aliases[key] || []
+ }
+ (aliases[key] || []).forEach(function (alias) {
+ defaults[alias] = defaults[key]
+ })
+ })
+
+ var argv = { _: [] }
+
+ Object.keys(flags.bools).forEach(function (key) {
+ setArg(key, !(key in defaults) ? false : defaults[key])
+ setDefaulted(key)
+ })
+
+ var notFlags = []
+ if (args.indexOf('--') !== -1) {
+ notFlags = args.slice(args.indexOf('--') + 1)
+ args = args.slice(0, args.indexOf('--'))
+ }
+
+ for (var i = 0; i < args.length; i++) {
+ var arg = args[i]
+ var broken
+ var key
+ var letters
+ var m
+ var next
+ var value
+
+ // -- seperated by =
+ if (arg.match(/^--.+=/)) {
+ // Using [\s\S] instead of . because js doesn't support the
+ // 'dotall' regex modifier. See:
+ // http://stackoverflow.com/a/1068308/13216
+ m = arg.match(/^--([^=]+)=([\s\S]*)$/)
+
+ // nargs format = '--f=monkey washing cat'
+ if (checkAllAliases(m[1], opts.narg)) {
+ args.splice(i + 1, m[1], m[2])
+ i = eatNargs(i, m[1], args)
+ // arrays format = '--f=a b c'
+ } else if (checkAllAliases(m[1], flags.arrays) && args.length > i + 1) {
+ args.splice(i + 1, m[1], m[2])
+ i = eatArray(i, m[1], args)
+ } else {
+ setArg(m[1], m[2])
+ }
+ } else if (arg.match(/^--no-.+/)) {
+ key = arg.match(/^--no-(.+)/)[1]
+ setArg(key, false)
+
+ // -- seperated by space.
+ } else if (arg.match(/^--.+/)) {
+ key = arg.match(/^--(.+)/)[1]
+
+ // nargs format = '--foo a b c'
+ if (checkAllAliases(key, opts.narg)) {
+ i = eatNargs(i, key, args)
+ // array format = '--foo a b c'
+ } else if (checkAllAliases(key, flags.arrays) && args.length > i + 1) {
+ i = eatArray(i, key, args)
+ } else {
+ next = args[i + 1]
+
+ if (next !== undefined && !next.match(/^-/) &&
+ !checkAllAliases(key, flags.bools) &&
+ !checkAllAliases(key, flags.counts)) {
+ setArg(key, next)
+ i++
+ } else if (/^(true|false)$/.test(next)) {
+ setArg(key, next)
+ i++
+ } else {
+ setArg(key, defaultForType(guessType(key, flags)))
+ }
+ }
+
+ // dot-notation flag seperated by '='.
+ } else if (arg.match(/^-.\..+=/)) {
+ m = arg.match(/^-([^=]+)=([\s\S]*)$/)
+ setArg(m[1], m[2])
+
+ // dot-notation flag seperated by space.
+ } else if (arg.match(/^-.\..+/)) {
+ next = args[i + 1]
+ key = arg.match(/^-(.\..+)/)[1]
+
+ if (next !== undefined && !next.match(/^-/) &&
+ !checkAllAliases(key, flags.bools) &&
+ !checkAllAliases(key, flags.counts)) {
+ setArg(key, next)
+ i++
+ } else {
+ setArg(key, defaultForType(guessType(key, flags)))
+ }
+ } else if (arg.match(/^-[^-]+/)) {
+ letters = arg.slice(1, -1).split('')
+ broken = false
+
+ for (var j = 0; j < letters.length; j++) {
+ next = arg.slice(j + 2)
+
+ if (letters[j + 1] && letters[j + 1] === '=') {
+ value = arg.slice(j + 3)
+ key = letters[j]
+
+ // nargs format = '-f=monkey washing cat'
+ if (checkAllAliases(letters[j], opts.narg)) {
+ args.splice(i + 1, 0, value)
+ i = eatNargs(i, key, args)
+ // array format = '-f=a b c'
+ } else if (checkAllAliases(key, flags.arrays) && args.length > i + 1) {
+ args.splice(i + 1, 0, value)
+ i = eatArray(i, key, args)
+ } else {
+ setArg(key, value)
+ }
+
+ broken = true
+ break
+ }
+
+ if (next === '-') {
+ setArg(letters[j], next)
+ continue
+ }
+
+ if (/[A-Za-z]/.test(letters[j]) &&
+ /-?\d+(\.\d*)?(e-?\d+)?$/.test(next)) {
+ setArg(letters[j], next)
+ broken = true
+ break
+ }
+
+ if (letters[j + 1] && letters[j + 1].match(/\W/)) {
+ setArg(letters[j], arg.slice(j + 2))
+ broken = true
+ break
+ } else {
+ setArg(letters[j], defaultForType(guessType(letters[j], flags)))
+ }
+ }
+
+ key = arg.slice(-1)[0]
+
+ if (!broken && key !== '-') {
+ // nargs format = '-f a b c'
+ if (checkAllAliases(key, opts.narg)) {
+ i = eatNargs(i, key, args)
+ // array format = '-f a b c'
+ } else if (checkAllAliases(key, flags.arrays) && args.length > i + 1) {
+ i = eatArray(i, key, args)
+ } else {
+ if (args[i + 1] && !/^(-|--)[^-]/.test(args[i + 1]) &&
+ !checkAllAliases(key, flags.bools) &&
+ !checkAllAliases(key, flags.counts)) {
+ setArg(key, args[i + 1])
+ i++
+ } else if (args[i + 1] && /true|false/.test(args[i + 1])) {
+ setArg(key, args[i + 1])
+ i++
+ } else {
+ setArg(key, defaultForType(guessType(key, flags)))
+ }
+ }
+ }
+ } else {
+ argv._.push(
+ flags.strings['_'] || !isNumber(arg) ? arg : Number(arg)
+ )
+ }
+ }
+
+ setConfig(argv)
+ applyDefaultsAndAliases(argv, aliases, defaults)
+
+ Object.keys(flags.counts).forEach(function (key) {
+ setArg(key, defaults[key])
+ })
+
+ notFlags.forEach(function (key) {
+ argv._.push(key)
+ })
+
+ // how many arguments should we consume, based
+ // on the nargs option?
+ function eatNargs (i, key, args) {
+ var toEat = checkAllAliases(key, opts.narg)
+
+ if (args.length - (i + 1) < toEat) error = Error(__('Not enough arguments following: %s', key))
+
+ for (var ii = i + 1; ii < (toEat + i + 1); ii++) {
+ setArg(key, args[ii])
+ }
+
+ return (i + toEat)
+ }
+
+ // if an option is an array, eat all non-hyphenated arguments
+ // following it... YUM!
+ // e.g., --foo apple banana cat becomes ["apple", "banana", "cat"]
+ function eatArray (i, key, args) {
+ for (var ii = i + 1; ii < args.length; ii++) {
+ if (/^-/.test(args[ii])) break
+ i = ii
+ setArg(key, args[ii])
+ }
+
+ return i
+ }
+
+ function setArg (key, val) {
+ unsetDefaulted(key)
+
+ // handle parsing boolean arguments --foo=true --bar false.
+ if (checkAllAliases(key, flags.bools) || checkAllAliases(key, flags.counts)) {
+ if (typeof val === 'string') val = val === 'true'
+ }
+
+ if (/-/.test(key) && !(aliases[key] && aliases[key].length)) {
+ var c = camelCase(key)
+ aliases[key] = [c]
+ newAliases[c] = true
+ }
+
+ var value = !checkAllAliases(key, flags.strings) && isNumber(val) ? Number(val) : val
+
+ if (checkAllAliases(key, flags.counts)) {
+ value = increment
+ }
+
+ var splitKey = key.split('.')
+ setKey(argv, splitKey, value)
+
+ ;(aliases[splitKey[0]] || []).forEach(function (x) {
+ x = x.split('.')
+
+ // handle populating dot notation for both
+ // the key and its aliases.
+ if (splitKey.length > 1) {
+ var a = [].concat(splitKey)
+ a.shift() // nuke the old key.
+ x = x.concat(a)
+ }
+
+ setKey(argv, x, value)
+ })
+
+ var keys = [key].concat(aliases[key] || [])
+ for (var i = 0, l = keys.length; i < l; i++) {
+ if (flags.normalize[keys[i]]) {
+ keys.forEach(function (key) {
+ argv.__defineSetter__(key, function (v) {
+ val = path.normalize(v)
+ })
+
+ argv.__defineGetter__(key, function () {
+ return typeof val === 'string' ?
+ path.normalize(val) : val
+ })
+ })
+ break
+ }
+ }
+ }
+
+ // set args from config.json file, this should be
+ // applied last so that defaults can be applied.
+ function setConfig (argv) {
+ var configLookup = {}
+
+ // expand defaults/aliases, in-case any happen to reference
+ // the config.json file.
+ applyDefaultsAndAliases(configLookup, aliases, defaults)
+
+ Object.keys(flags.configs).forEach(function (configKey) {
+ var configPath = argv[configKey] || configLookup[configKey]
+ if (configPath) {
+ try {
+ var config = require(path.resolve(process.cwd(), configPath))
+
+ Object.keys(config).forEach(function (key) {
+ // setting arguments via CLI takes precedence over
+ // values within the config file.
+ if (argv[key] === undefined || (flags.defaulted[key])) {
+ delete argv[key]
+ setArg(key, config[key])
+ }
+ })
+ } catch (ex) {
+ if (argv[configKey]) error = Error(__('Invalid JSON config file: %s', configPath))
+ }
+ }
+ })
+ }
+
+ function applyDefaultsAndAliases (obj, aliases, defaults) {
+ Object.keys(defaults).forEach(function (key) {
+ if (!hasKey(obj, key.split('.'))) {
+ setKey(obj, key.split('.'), defaults[key])
+
+ ;(aliases[key] || []).forEach(function (x) {
+ setKey(obj, x.split('.'), defaults[key])
+ })
+ }
+ })
+ }
+
+ function hasKey (obj, keys) {
+ var o = obj
+ keys.slice(0, -1).forEach(function (key) {
+ o = (o[key] || {})
+ })
+
+ var key = keys[keys.length - 1]
+ return key in o
+ }
+
+ function setKey (obj, keys, value) {
+ var o = obj
+ keys.slice(0, -1).forEach(function (key) {
+ if (o[key] === undefined) o[key] = {}
+ o = o[key]
+ })
+
+ var key = keys[keys.length - 1]
+ if (value === increment) {
+ o[key] = increment(o[key])
+ } else if (o[key] === undefined && checkAllAliases(key, flags.arrays)) {
+ o[key] = Array.isArray(value) ? value : [value]
+ } else if (o[key] === undefined || typeof o[key] === 'boolean') {
+ o[key] = value
+ } else if (Array.isArray(o[key])) {
+ o[key].push(value)
+ } else {
+ o[key] = [ o[key], value ]
+ }
+ }
+
+ // extend the aliases list with inferred aliases.
+ function extendAliases (obj) {
+ Object.keys(obj || {}).forEach(function (key) {
+ aliases[key] = [].concat(opts.alias[key] || [])
+ // For "--option-name", also set argv.optionName
+ aliases[key].concat(key).forEach(function (x) {
+ if (/-/.test(x)) {
+ var c = camelCase(x)
+ aliases[key].push(c)
+ newAliases[c] = true
+ }
+ })
+ aliases[key].forEach(function (x) {
+ aliases[x] = [key].concat(aliases[key].filter(function (y) {
+ return x !== y
+ }))
+ })
+ })
+ }
+
+ // check if a flag is set for any of a key's aliases.
+ function checkAllAliases (key, flag) {
+ var isSet = false
+ var toCheck = [].concat(aliases[key] || [], key)
+
+ toCheck.forEach(function (key) {
+ if (flag[key]) isSet = flag[key]
+ })
+
+ return isSet
+ }
+
+ function setDefaulted (key) {
+ [].concat(aliases[key] || [], key).forEach(function (k) {
+ flags.defaulted[k] = true
+ })
+ }
+
+ function unsetDefaulted (key) {
+ [].concat(aliases[key] || [], key).forEach(function (k) {
+ delete flags.defaulted[k]
+ })
+ }
+
+ // return a default value, given the type of a flag.,
+ // e.g., key of type 'string' will default to '', rather than 'true'.
+ function defaultForType (type) {
+ var def = {
+ boolean: true,
+ string: '',
+ array: []
+ }
+
+ return def[type]
+ }
+
+ // given a flag, enforce a default type.
+ function guessType (key, flags) {
+ var type = 'boolean'
+
+ if (flags.strings && flags.strings[key]) type = 'string'
+ else if (flags.arrays && flags.arrays[key]) type = 'array'
+
+ return type
+ }
+
+ function isNumber (x) {
+ if (typeof x === 'number') return true
+ if (/^0x[0-9a-f]+$/i.test(x)) return true
+ return /^[-+]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test(x)
+ }
+
+ return {
+ argv: argv,
+ aliases: aliases,
+ error: error,
+ newAliases: newAliases
+ }
+}
--- /dev/null
+// this file handles outputting usage instructions,
+// failures, etc. keeps logging in one place.
+var cliui = require('cliui')
+var decamelize = require('decamelize')
+var wsize = require('window-size')
+
+module.exports = function (yargs, y18n) {
+ var __ = y18n.__
+ var self = {}
+
+ // methods for ouputting/building failure message.
+ var fails = []
+ self.failFn = function (f) {
+ fails.push(f)
+ }
+
+ var failMessage = null
+ var showHelpOnFail = true
+ self.showHelpOnFail = function (enabled, message) {
+ if (typeof enabled === 'string') {
+ message = enabled
+ enabled = true
+ } else if (typeof enabled === 'undefined') {
+ enabled = true
+ }
+ failMessage = message
+ showHelpOnFail = enabled
+ return self
+ }
+
+ self.fail = function (msg) {
+ if (fails.length) {
+ fails.forEach(function (f) {
+ f(msg)
+ })
+ } else {
+ if (showHelpOnFail) yargs.showHelp('error')
+ if (msg) console.error(msg)
+ if (failMessage) {
+ if (msg) console.error('')
+ console.error(failMessage)
+ }
+ if (yargs.getExitProcess()) {
+ process.exit(1)
+ } else {
+ throw new Error(msg)
+ }
+ }
+ }
+
+ // methods for ouputting/building help (usage) message.
+ var usage
+ self.usage = function (msg) {
+ usage = msg
+ }
+
+ var examples = []
+ self.example = function (cmd, description) {
+ examples.push([cmd, description || ''])
+ }
+
+ var commands = []
+ self.command = function (cmd, description) {
+ commands.push([cmd, description || ''])
+ }
+ self.getCommands = function () {
+ return commands
+ }
+
+ var descriptions = {}
+ self.describe = function (key, desc) {
+ if (typeof key === 'object') {
+ Object.keys(key).forEach(function (k) {
+ self.describe(k, key[k])
+ })
+ } else {
+ descriptions[key] = desc
+ }
+ }
+ self.getDescriptions = function () {
+ return descriptions
+ }
+
+ var epilog
+ self.epilog = function (msg) {
+ epilog = msg
+ }
+
+ var wrap = windowWidth()
+ self.wrap = function (cols) {
+ wrap = cols
+ }
+
+ var deferY18nLookupPrefix = '__yargsString__:'
+ self.deferY18nLookup = function (str) {
+ return deferY18nLookupPrefix + str
+ }
+
+ self.help = function () {
+ normalizeAliases()
+
+ var demanded = yargs.getDemanded()
+ var options = yargs.getOptions()
+ var keys = Object.keys(
+ Object.keys(descriptions)
+ .concat(Object.keys(demanded))
+ .concat(Object.keys(options.default))
+ .reduce(function (acc, key) {
+ if (key !== '_') acc[key] = true
+ return acc
+ }, {})
+ )
+ var ui = cliui({
+ width: wrap,
+ wrap: !!wrap
+ })
+
+ // the usage string.
+ if (usage) {
+ var u = usage.replace(/\$0/g, yargs.$0)
+ ui.div(u + '\n')
+ }
+
+ // your application's commands, i.e., non-option
+ // arguments populated in '_'.
+ if (commands.length) {
+ ui.div(__('Commands:'))
+
+ commands.forEach(function (command) {
+ ui.div(
+ {text: command[0], padding: [0, 2, 0, 2], width: maxWidth(commands) + 4},
+ {text: command[1]}
+ )
+ })
+
+ ui.div()
+ }
+
+ // the options table.
+ var aliasKeys = (Object.keys(options.alias) || [])
+ .concat(Object.keys(yargs.parsed.newAliases) || [])
+
+ keys = keys.filter(function (key) {
+ return !yargs.parsed.newAliases[key] && aliasKeys.every(function (alias) {
+ return (options.alias[alias] || []).indexOf(key) === -1
+ })
+ })
+
+ var switches = keys.reduce(function (acc, key) {
+ acc[key] = [ key ].concat(options.alias[key] || [])
+ .map(function (sw) {
+ return (sw.length > 1 ? '--' : '-') + sw
+ })
+ .join(', ')
+
+ return acc
+ }, {})
+
+ if (keys.length) {
+ ui.div(__('Options:'))
+
+ keys.forEach(function (key) {
+ var kswitch = switches[key]
+ var desc = descriptions[key] || ''
+ var type = null
+
+ if (~desc.lastIndexOf(deferY18nLookupPrefix)) desc = __(desc.substring(deferY18nLookupPrefix.length))
+
+ if (~options.boolean.indexOf(key)) type = '[' + __('boolean') + ']'
+ if (~options.count.indexOf(key)) type = '[' + __('count') + ']'
+ if (~options.string.indexOf(key)) type = '[' + __('string') + ']'
+ if (~options.normalize.indexOf(key)) type = '[' + __('string') + ']'
+ if (~options.array.indexOf(key)) type = '[' + __('array') + ']'
+
+ var extra = [
+ type,
+ demanded[key] ? '[' + __('required') + ']' : null,
+ options.choices && options.choices[key] ? '[' + __('choices:') + ' ' +
+ self.stringifiedValues(options.choices[key]) + ']' : null,
+ defaultString(options.default[key], options.defaultDescription[key])
+ ].filter(Boolean).join(' ')
+
+ ui.span(
+ {text: kswitch, padding: [0, 2, 0, 2], width: maxWidth(switches) + 4},
+ desc
+ )
+
+ if (extra) ui.div({text: extra, padding: [0, 0, 0, 2], align: 'right'})
+ else ui.div()
+ })
+
+ ui.div()
+ }
+
+ // describe some common use-cases for your application.
+ if (examples.length) {
+ ui.div(__('Examples:'))
+
+ examples.forEach(function (example) {
+ example[0] = example[0].replace(/\$0/g, yargs.$0)
+ })
+
+ examples.forEach(function (example) {
+ ui.div(
+ {text: example[0], padding: [0, 2, 0, 2], width: maxWidth(examples) + 4},
+ example[1]
+ )
+ })
+
+ ui.div()
+ }
+
+ // the usage string.
+ if (epilog) {
+ var e = epilog.replace(/\$0/g, yargs.$0)
+ ui.div(e + '\n')
+ }
+
+ return ui.toString()
+ }
+
+ // return the maximum width of a string
+ // in the left-hand column of a table.
+ function maxWidth (table) {
+ var width = 0
+
+ // table might be of the form [leftColumn],
+ // or {key: leftColumn}}
+ if (!Array.isArray(table)) {
+ table = Object.keys(table).map(function (key) {
+ return [table[key]]
+ })
+ }
+
+ table.forEach(function (v) {
+ width = Math.max(v[0].length, width)
+ })
+
+ // if we've enabled 'wrap' we should limit
+ // the max-width of the left-column.
+ if (wrap) width = Math.min(width, parseInt(wrap * 0.5, 10))
+
+ return width
+ }
+
+ // make sure any options set for aliases,
+ // are copied to the keys being aliased.
+ function normalizeAliases () {
+ var demanded = yargs.getDemanded()
+ var options = yargs.getOptions()
+
+ ;(Object.keys(options.alias) || []).forEach(function (key) {
+ options.alias[key].forEach(function (alias) {
+ // copy descriptions.
+ if (descriptions[alias]) self.describe(key, descriptions[alias])
+ // copy demanded.
+ if (demanded[alias]) yargs.demand(key, demanded[alias].msg)
+
+ // type messages.
+ if (~options.boolean.indexOf(alias)) yargs.boolean(key)
+ if (~options.count.indexOf(alias)) yargs.count(key)
+ if (~options.string.indexOf(alias)) yargs.string(key)
+ if (~options.normalize.indexOf(alias)) yargs.normalize(key)
+ if (~options.array.indexOf(alias)) yargs.array(key)
+ })
+ })
+ }
+
+ self.showHelp = function (level) {
+ level = level || 'error'
+ console[level](self.help())
+ }
+
+ self.functionDescription = function (fn, defaultDescription) {
+ if (defaultDescription) {
+ return defaultDescription
+ }
+ var description = fn.name ? decamelize(fn.name, '-') : __('generated-value')
+ return ['(', description, ')'].join('')
+ }
+
+ self.stringifiedValues = function (values, separator) {
+ var string = ''
+ var sep = separator || ', '
+ var array = [].concat(values)
+
+ if (!values || !array.length) return string
+
+ array.forEach(function (value) {
+ if (string.length) string += sep
+ string += JSON.stringify(value)
+ })
+
+ return string
+ }
+
+ // format the default-value-string displayed in
+ // the right-hand column.
+ function defaultString (value, defaultDescription) {
+ var string = '[' + __('default:') + ' '
+
+ if (value === undefined) return null
+
+ if (defaultDescription) {
+ string += defaultDescription
+ } else {
+ switch (typeof value) {
+ case 'string':
+ string += JSON.stringify(value)
+ break
+ case 'object':
+ string += JSON.stringify(value)
+ break
+ default:
+ string += value
+ }
+ }
+
+ return string + ']'
+ }
+
+ // guess the width of the console window, max-width 80.
+ function windowWidth () {
+ return wsize.width ? Math.min(80, wsize.width) : null
+ }
+
+ // logic for displaying application version.
+ var version = null
+ self.version = function (ver, opt, msg) {
+ version = ver
+ }
+
+ self.showVersion = function () {
+ if (typeof version === 'function') console.log(version())
+ else console.log(version)
+ }
+
+ return self
+}
--- /dev/null
+// validation-type-stuff, missing params,
+// bad implications, custom checks.
+module.exports = function (yargs, usage, y18n) {
+ var __ = y18n.__
+ var __n = y18n.__n
+ var self = {}
+
+ // validate appropriate # of non-option
+ // arguments were provided, i.e., '_'.
+ self.nonOptionCount = function (argv) {
+ var demanded = yargs.getDemanded()
+ var _s = argv._.length
+
+ if (demanded._ && (_s < demanded._.count || _s > demanded._.max)) {
+ if (demanded._.msg !== undefined) {
+ usage.fail(demanded._.msg)
+ } else if (_s < demanded._.count) {
+ usage.fail(
+ __('Not enough non-option arguments: got %s, need at least %s', argv._.length, demanded._.count)
+ )
+ } else {
+ usage.fail(
+ __('Too many non-option arguments: got %s, maximum of %s', argv._.length, demanded._.max)
+ )
+ }
+ }
+ }
+
+ // make sure that any args that require an
+ // value (--foo=bar), have a value.
+ self.missingArgumentValue = function (argv) {
+ var defaultValues = [true, false, '']
+ var options = yargs.getOptions()
+
+ if (options.requiresArg.length > 0) {
+ var missingRequiredArgs = []
+
+ options.requiresArg.forEach(function (key) {
+ var value = argv[key]
+
+ // if a value is explicitly requested,
+ // flag argument as missing if it does not
+ // look like foo=bar was entered.
+ if (~defaultValues.indexOf(value) ||
+ (Array.isArray(value) && !value.length)) {
+ missingRequiredArgs.push(key)
+ }
+ })
+
+ if (missingRequiredArgs.length > 0) {
+ usage.fail(__n(
+ 'Missing argument value: %s',
+ 'Missing argument values: %s',
+ missingRequiredArgs.length,
+ missingRequiredArgs.join(', ')
+ ))
+ }
+ }
+ }
+
+ // make sure all the required arguments are present.
+ self.requiredArguments = function (argv) {
+ var demanded = yargs.getDemanded()
+ var missing = null
+
+ Object.keys(demanded).forEach(function (key) {
+ if (!argv.hasOwnProperty(key)) {
+ missing = missing || {}
+ missing[key] = demanded[key]
+ }
+ })
+
+ if (missing) {
+ var customMsgs = []
+ Object.keys(missing).forEach(function (key) {
+ var msg = missing[key].msg
+ if (msg && customMsgs.indexOf(msg) < 0) {
+ customMsgs.push(msg)
+ }
+ })
+
+ var customMsg = customMsgs.length ? '\n' + customMsgs.join('\n') : ''
+
+ usage.fail(__n(
+ 'Missing required argument: %s',
+ 'Missing required arguments: %s',
+ Object.keys(missing).length,
+ Object.keys(missing).join(', ') + customMsg
+ ))
+ }
+ }
+
+ // check for unknown arguments (strict-mode).
+ self.unknownArguments = function (argv, aliases) {
+ var aliasLookup = {}
+ var descriptions = usage.getDescriptions()
+ var demanded = yargs.getDemanded()
+ var unknown = []
+
+ Object.keys(aliases).forEach(function (key) {
+ aliases[key].forEach(function (alias) {
+ aliasLookup[alias] = key
+ })
+ })
+
+ Object.keys(argv).forEach(function (key) {
+ if (key !== '$0' && key !== '_' &&
+ !descriptions.hasOwnProperty(key) &&
+ !demanded.hasOwnProperty(key) &&
+ !aliasLookup.hasOwnProperty(key)) {
+ unknown.push(key)
+ }
+ })
+
+ if (unknown.length > 0) {
+ usage.fail(__n(
+ 'Unknown argument: %s',
+ 'Unknown arguments: %s',
+ unknown.length,
+ unknown.join(', ')
+ ))
+ }
+ }
+
+ // validate arguments limited to enumerated choices
+ self.limitedChoices = function (argv) {
+ var options = yargs.getOptions()
+ var invalid = {}
+
+ if (!Object.keys(options.choices).length) return
+
+ Object.keys(argv).forEach(function (key) {
+ if (key !== '$0' && key !== '_' &&
+ options.choices.hasOwnProperty(key)) {
+ [].concat(argv[key]).forEach(function (value) {
+ // TODO case-insensitive configurability
+ if (options.choices[key].indexOf(value) === -1) {
+ invalid[key] = (invalid[key] || []).concat(value)
+ }
+ })
+ }
+ })
+
+ var invalidKeys = Object.keys(invalid)
+
+ if (!invalidKeys.length) return
+
+ var msg = __('Invalid values:')
+ invalidKeys.forEach(function (key) {
+ msg += '\n ' + __(
+ 'Argument: %s, Given: %s, Choices: %s',
+ key,
+ usage.stringifiedValues(invalid[key]),
+ usage.stringifiedValues(options.choices[key])
+ )
+ })
+ usage.fail(msg)
+ }
+
+ // custom checks, added using the `check` option on yargs.
+ var checks = []
+ self.check = function (f) {
+ checks.push(f)
+ }
+
+ self.customChecks = function (argv, aliases) {
+ checks.forEach(function (f) {
+ try {
+ var result = f(argv, aliases)
+ if (!result) {
+ usage.fail(__('Argument check failed: %s', f.toString()))
+ } else if (typeof result === 'string') {
+ usage.fail(result)
+ }
+ } catch (err) {
+ usage.fail(err.message ? err.message : err)
+ }
+ })
+ }
+
+ // check implications, argument foo implies => argument bar.
+ var implied = {}
+ self.implies = function (key, value) {
+ if (typeof key === 'object') {
+ Object.keys(key).forEach(function (k) {
+ self.implies(k, key[k])
+ })
+ } else {
+ implied[key] = value
+ }
+ }
+ self.getImplied = function () {
+ return implied
+ }
+
+ self.implications = function (argv) {
+ var implyFail = []
+
+ Object.keys(implied).forEach(function (key) {
+ var num
+ var origKey = key
+ var value = implied[key]
+
+ // convert string '1' to number 1
+ num = Number(key)
+ key = isNaN(num) ? key : num
+
+ if (typeof key === 'number') {
+ // check length of argv._
+ key = argv._.length >= key
+ } else if (key.match(/^--no-.+/)) {
+ // check if key doesn't exist
+ key = key.match(/^--no-(.+)/)[1]
+ key = !argv[key]
+ } else {
+ // check if key exists
+ key = argv[key]
+ }
+
+ num = Number(value)
+ value = isNaN(num) ? value : num
+
+ if (typeof value === 'number') {
+ value = argv._.length >= value
+ } else if (value.match(/^--no-.+/)) {
+ value = value.match(/^--no-(.+)/)[1]
+ value = !argv[value]
+ } else {
+ value = argv[value]
+ }
+
+ if (key && !value) {
+ implyFail.push(origKey)
+ }
+ })
+
+ if (implyFail.length) {
+ var msg = __('Implications failed:') + '\n'
+
+ implyFail.forEach(function (key) {
+ msg += (' ' + key + ' -> ' + implied[key])
+ })
+
+ usage.fail(msg)
+ }
+ }
+
+ return self
+}
--- /dev/null
+{
+ "Commands:": "Commands:",
+ "Options:": "Options:",
+ "Examples:": "Examples:",
+ "boolean": "boolean",
+ "count": "count",
+ "string": "string",
+ "array": "array",
+ "required": "required",
+ "default:": "default:",
+ "choices:": "choices:",
+ "generated-value": "generated-value",
+ "Not enough non-option arguments: got %s, need at least %s": "Not enough non-option arguments: got %s, need at least %s",
+ "Too many non-option arguments: got %s, maximum of %s": "Too many non-option arguments: got %s, maximum of %s",
+ "Missing argument value: %s": {
+ "one": "Missing argument value: %s",
+ "other": "Missing argument values: %s"
+ },
+ "Missing required argument: %s": {
+ "one": "Missing required argument: %s",
+ "other": "Missing required arguments: %s"
+ },
+ "Unknown argument: %s": {
+ "one": "Unknown argument: %s",
+ "other": "Unknown arguments: %s"
+ },
+ "Invalid values:": "Invalid values:",
+ "Argument: %s, Given: %s, Choices: %s": "Argument: %s, Given: %s, Choices: %s",
+ "Argument check failed: %s": "Argument check failed: %s",
+ "Implications failed:": "Implications failed:",
+ "Not enough arguments following: %s": "Not enough arguments following: %s",
+ "Invalid JSON config file: %s": "Invalid JSON config file: %s",
+ "Path to JSON config file": "Path to JSON config file",
+ "Show help": "Show help",
+ "Show version number": "Show version number"
+}
--- /dev/null
+{
+ "Commands:": "Comandos:",
+ "Options:": "Opciones:",
+ "Examples:": "Ejemplos:",
+ "boolean": "boolean",
+ "count": "cuenta",
+ "string": "cadena de caracteres",
+ "array": "tabla",
+ "required": "requisito",
+ "default:": "defecto:",
+ "choices:": "selección:",
+ "generated-value": "valor-generado",
+ "Not enough non-option arguments: got %s, need at least %s": "Hacen falta argumentos no-opcionales: Número recibido %s, necesita por lo menos %s",
+ "Too many non-option arguments: got %s, maximum of %s": "Demasiados argumentos no-opcionales: Número recibido %s, máximo es %s",
+ "Missing argument value: %s": {
+ "one": "Falta argumento: %s",
+ "other": "Faltan argumentos: %s"
+ },
+ "Missing required argument: %s": {
+ "one": "Falta argumento requerido: %s",
+ "other": "Faltan argumentos requeridos: %s"
+ },
+ "Unknown argument: %s": {
+ "one": "Argumento desconocido: %s",
+ "other": "Argumentos desconocidos: %s"
+ },
+ "Invalid values:": "Valores inválidos:",
+ "Argument: %s, Given: %s, Choices: %s": "Argumento: %s, Recibido: %s, Selección: %s",
+ "Argument check failed: %s": "Verificación de argumento ha fracasado: %s",
+ "Implications failed:": "Implicaciones fracasadas:",
+ "Not enough arguments following: %s": "No hay suficientes argumentos después de: %s",
+ "Invalid JSON config file: %s": "Archivo de configuración JSON inválido: %s",
+ "Path to JSON config file": "Ruta al archivo de configuración JSON",
+ "Show help": "Muestra ayuda",
+ "Show version number": "Muestra número de versión"
+}
--- /dev/null
+{
+ "Commands:": "Commandes:",
+ "Options:": "Options:",
+ "Examples:": "Exemples:",
+ "boolean": "booléen",
+ "count": "comptage",
+ "string": "chaine de caractère",
+ "array": "tableau",
+ "required": "requis",
+ "default:": "défaut:",
+ "choices:": "choix:",
+ "generated-value": "valeur générée",
+ "Not enough non-option arguments: got %s, need at least %s": "Pas assez d'arguments non-option: reçu %s, besoin d'au moins %s",
+ "Too many non-option arguments: got %s, maximum of %s": "Trop d'arguments non-option: reçu %s, maximum %s",
+ "Missing argument value: %s": {
+ "one": "Argument manquant: %s",
+ "other": "Arguments manquants: %s"
+ },
+ "Missing required argument: %s": {
+ "one": "Argument requis manquant: %s",
+ "other": "Arguments requis manquants: %s"
+ },
+ "Unknown argument: %s": {
+ "one": "Argument inconnu: %s",
+ "other": "Arguments inconnus: %s"
+ },
+ "Invalid values:": "Valeurs invalides:",
+ "Argument: %s, Given: %s, Choices: %s": "Argument: %s, Donné: %s, Choix: %s",
+ "Argument check failed: %s": "Echec de la vérification de l'argument: %s",
+ "Implications failed:": "Implications échouées:",
+ "Not enough arguments following: %s": "Pas assez d'arguments suivant: %s",
+ "Invalid JSON config file: %s": "Fichier de configuration JSON invalide: %s",
+ "Path to JSON config file": "Chemin du fichier de configuration JSON",
+ "Show help": "Affiche de l'aide",
+ "Show version number": "Affiche le numéro de version"
+}
--- /dev/null
+{
+ "Commands:": "Choose yer command:",
+ "Options:": "Options for me hearties!",
+ "Examples:": "Ex. marks the spot:",
+ "required": "requi-yar-ed",
+ "Missing required argument: %s": {
+ "one": "Ye be havin' to set the followin' argument land lubber: %s",
+ "other": "Ye be havin' to set the followin' arguments land lubber: %s"
+ },
+ "Show help": "Parlay this here code of conduct",
+ "Show version number": "'Tis the version ye be askin' fer"
+}
--- /dev/null
+{
+ "Commands:": "Comandos:",
+ "Options:": "Opções:",
+ "Examples:": "Exemplos:",
+ "boolean": "boolean",
+ "count": "contagem",
+ "string": "cadeia de caracteres",
+ "array": "arranjo",
+ "required": "requerido",
+ "default:": "padrão:",
+ "choices:": "escolhas:",
+ "generated-value": "valor-gerado",
+ "Not enough non-option arguments: got %s, need at least %s": "Argumentos insuficientes não opcionais: Argumento %s, necessário pelo menos %s",
+ "Too many non-option arguments: got %s, maximum of %s": "Excesso de argumentos não opcionais: recebido %s, máximo de %s",
+ "Missing argument value: %s": {
+ "one": "Falta valor de argumento: %s",
+ "other": "Falta valores de argumento: %s"
+ },
+ "Missing required argument: %s": {
+ "one": "Falta argumento obrigatório: %s",
+ "other": "Faltando argumentos obrigatórios: %s"
+ },
+ "Unknown argument: %s": {
+ "one": "Argumento desconhecido: %s",
+ "other": "Argumentos desconhecidos: %s"
+ },
+ "Invalid values:": "Valores inválidos:",
+ "Argument: %s, Given: %s, Choices: %s": "Argumento: %s, Dado: %s, Escolhas: %s",
+ "Argument check failed: %s": "Verificação de argumento falhou: %s",
+ "Implications failed:": "Implicações falharam:",
+ "Not enough arguments following: %s": "Insuficientes argumentos a seguir: %s",
+ "Invalid JSON config file: %s": "Arquivo de configuração em JSON esta inválido: %s",
+ "Path to JSON config file": "Caminho para o arquivo de configuração em JSON",
+ "Show help": "Mostra ajuda",
+ "Show version number": "Mostra número de versão"
+}
--- /dev/null
+{
+ "_args": [
+ [
+ {
+ "raw": "yargs@3.19.0",
+ "scope": null,
+ "escapedName": "yargs",
+ "name": "yargs",
+ "rawSpec": "3.19.0",
+ "spec": "3.19.0",
+ "type": "version"
+ },
+ "/home/sources/5.0/crosswalk-tizen/wrt"
+ ]
+ ],
+ "_from": "yargs@3.19.0",
+ "_id": "yargs@3.19.0",
+ "_inCache": true,
+ "_location": "/yargs",
+ "_nodeVersion": "2.0.2",
+ "_npmUser": {
+ "name": "bcoe",
+ "email": "ben@npmjs.com"
+ },
+ "_npmVersion": "2.13.2",
+ "_phantomChildren": {},
+ "_requested": {
+ "raw": "yargs@3.19.0",
+ "scope": null,
+ "escapedName": "yargs",
+ "name": "yargs",
+ "rawSpec": "3.19.0",
+ "spec": "3.19.0",
+ "type": "version"
+ },
+ "_requiredBy": [
+ "#DEV:/"
+ ],
+ "_resolved": "https://registry.npmjs.org/yargs/-/yargs-3.19.0.tgz",
+ "_shasum": "35a5a841a6fe70f3fabbb88dd6d9ebfb56db5320",
+ "_shrinkwrap": null,
+ "_spec": "yargs@3.19.0",
+ "_where": "/home/sources/5.0/crosswalk-tizen/wrt",
+ "author": {
+ "name": "Alex Ford",
+ "email": "Alex.Ford@CodeTunnel.com",
+ "url": "http://CodeTunnel.com"
+ },
+ "bugs": {
+ "url": "https://github.com/bcoe/yargs/issues"
+ },
+ "contributors": [
+ {
+ "name": "Benjamin Coe",
+ "email": "ben@npmjs.com",
+ "url": "https://github.com/bcoe"
+ },
+ {
+ "name": "Andrew Goode",
+ "url": "https://github.com/nexdrew"
+ },
+ {
+ "name": "Chris Needham",
+ "email": "chris@chrisneedham.com",
+ "url": "http://chrisneedham.com"
+ },
+ {
+ "name": "James Nylen",
+ "email": "jnylen@gmail.com",
+ "url": "https://github.com/nylen"
+ },
+ {
+ "name": "Benjamin Horsleben",
+ "url": "https://github.com/fizker"
+ },
+ {
+ "name": "Lin Clark",
+ "url": "https://github.com/linclark"
+ },
+ {
+ "name": "Tim Schaub",
+ "url": "https://github.com/tschaub"
+ }
+ ],
+ "dependencies": {
+ "camelcase": "^1.0.2",
+ "cliui": "^2.1.0",
+ "decamelize": "^1.0.0",
+ "window-size": "^0.1.1",
+ "y18n": "^3.0.0"
+ },
+ "description": "Light-weight option parsing with an argv hash. No optstrings attached.",
+ "devDependencies": {
+ "chai": "^3.0.0",
+ "coveralls": "^2.11.2",
+ "hashish": "0.0.4",
+ "mocha": "^2.2.1",
+ "nyc": "^3.1.0",
+ "standard": "^5.0.2"
+ },
+ "directories": {},
+ "dist": {
+ "shasum": "35a5a841a6fe70f3fabbb88dd6d9ebfb56db5320",
+ "tarball": "https://registry.npmjs.org/yargs/-/yargs-3.19.0.tgz"
+ },
+ "engine": {
+ "node": ">=0.4"
+ },
+ "files": [
+ "index.js",
+ "lib",
+ "locales",
+ "completion.sh.hbs",
+ "LICENSE"
+ ],
+ "gitHead": "c17c3b41ddeab725d1c7d7646342bb85fc2280ef",
+ "homepage": "https://github.com/bcoe/yargs#readme",
+ "keywords": [
+ "argument",
+ "args",
+ "option",
+ "parser",
+ "parsing",
+ "cli",
+ "command"
+ ],
+ "license": "MIT",
+ "main": "./index.js",
+ "maintainers": [
+ {
+ "name": "chevex",
+ "email": "alex.ford@codetunnel.com"
+ },
+ {
+ "name": "bcoe",
+ "email": "ben@npmjs.com"
+ },
+ {
+ "name": "nylen",
+ "email": "jnylen@gmail.com"
+ },
+ {
+ "name": "abg",
+ "email": "andrewbgoode@gmail.com"
+ }
+ ],
+ "name": "yargs",
+ "optionalDependencies": {},
+ "readme": "ERROR: No README data found!",
+ "repository": {
+ "type": "git",
+ "url": "git+ssh://git@github.com/bcoe/yargs.git"
+ },
+ "scripts": {
+ "coverage": "nyc report --reporter=text-lcov | coveralls",
+ "test": "standard && nyc mocha --check-leaks"
+ },
+ "standard": {
+ "ignore": [
+ "**/example/**"
+ ],
+ "globals": [
+ "it"
+ ]
+ },
+ "version": "3.19.0"
+}