Template Upload

This commit is contained in:
SOUTHERNCO\x2mjbyrn
2017-05-17 13:45:25 -04:00
parent 415b9c25f3
commit 7efe7605b8
11476 changed files with 2170865 additions and 34 deletions

20
node_modules/update-notifier/check.js generated vendored Normal file
View File

@ -0,0 +1,20 @@
'use strict';
var updateNotifier = require('./');
var options = JSON.parse(process.argv[2]);
updateNotifier = new updateNotifier.UpdateNotifier(options);
updateNotifier.checkNpm().then(function (update) {
// only update the last update check time on success
updateNotifier.config.set('lastUpdateCheck', Date.now());
if (update.type && update.type !== 'latest') {
updateNotifier.config.set('update', update);
}
// Call process exit explicitly to terminate the child process
// Otherwise the child process will run forever (according to nodejs docs)
process.exit();
}).catch(function () {
process.exit(1);
});

113
node_modules/update-notifier/index.js generated vendored Normal file
View File

@ -0,0 +1,113 @@
'use strict';
var spawn = require('child_process').spawn;
var path = require('path');
var Configstore = require('configstore');
var chalk = require('chalk');
var semverDiff = require('semver-diff');
var latestVersion = require('latest-version');
var isNpm = require('is-npm');
var boxen = require('boxen');
var ONE_DAY = 1000 * 60 * 60 * 24;
function UpdateNotifier(options) {
this.options = options = options || {};
options.pkg = options.pkg || {};
// reduce pkg to the essential keys. with fallback to deprecated options
// TODO: remove deprecated options at some point far into the future
options.pkg = {
name: options.pkg.name || options.packageName,
version: options.pkg.version || options.packageVersion
};
if (!options.pkg.name || !options.pkg.version) {
throw new Error('pkg.name and pkg.version required');
}
this.packageName = options.pkg.name;
this.packageVersion = options.pkg.version;
this.updateCheckInterval = typeof options.updateCheckInterval === 'number' ? options.updateCheckInterval : ONE_DAY;
this.hasCallback = typeof options.callback === 'function';
this.callback = options.callback || function () {};
if (!this.hasCallback) {
this.config = new Configstore('update-notifier-' + this.packageName, {
optOut: false,
// init with the current time so the first check is only
// after the set interval, so not to bother users right away
lastUpdateCheck: Date.now()
});
}
}
UpdateNotifier.prototype.check = function () {
if (this.hasCallback) {
this.checkNpm().then(this.callback.bind(this, null)).catch(this.callback);
return;
}
if (this.config.get('optOut') || 'NO_UPDATE_NOTIFIER' in process.env || process.argv.indexOf('--no-update-notifier') !== -1) {
return;
}
this.update = this.config.get('update');
if (this.update) {
this.config.del('update');
}
// Only check for updates on a set interval
if (Date.now() - this.config.get('lastUpdateCheck') < this.updateCheckInterval) {
return;
}
// Spawn a detached process, passing the options as an environment property
spawn(process.execPath, [path.join(__dirname, 'check.js'), JSON.stringify(this.options)], {
detached: true,
stdio: 'ignore'
}).unref();
};
UpdateNotifier.prototype.checkNpm = function () {
return latestVersion(this.packageName).then(function (latestVersion) {
return {
latest: latestVersion,
current: this.packageVersion,
type: semverDiff(this.packageVersion, latestVersion) || 'latest',
name: this.packageName
};
}.bind(this));
};
UpdateNotifier.prototype.notify = function (opts) {
if (!process.stdout.isTTY || isNpm || !this.update) {
return this;
}
opts = opts || {};
var message = '\n' + boxen('Update available ' + chalk.dim(this.update.current) + chalk.reset(' → ') + chalk.green(this.update.latest) + ' \nRun ' + chalk.cyan('npm i -g ' + this.packageName) + ' to update', {
padding: 1,
margin: 1,
borderColor: 'yellow',
borderStyle: 'round'
});
if (opts.defer === undefined) {
process.on('exit', function () {
console.error(message);
});
} else {
console.error(message);
}
return this;
};
module.exports = function (options) {
var updateNotifier = new UpdateNotifier(options);
updateNotifier.check();
return updateNotifier;
};
module.exports.UpdateNotifier = UpdateNotifier;

15
node_modules/update-notifier/node_modules/.bin/mkdirp generated vendored Normal file
View File

@ -0,0 +1,15 @@
#!/bin/sh
basedir=`dirname "$0"`
case `uname` in
*CYGWIN*) basedir=`cygpath -w "$basedir"`;;
esac
if [ -x "$basedir/node" ]; then
"$basedir/node" "$basedir/../mkdirp/bin/cmd.js" "$@"
ret=$?
else
node "$basedir/../mkdirp/bin/cmd.js" "$@"
ret=$?
fi
exit $ret

View File

@ -0,0 +1,7 @@
@IF EXIST "%~dp0\node.exe" (
"%~dp0\node.exe" "%~dp0\..\mkdirp\bin\cmd.js" %*
) ELSE (
@SETLOCAL
@SET PATHEXT=%PATHEXT:;.JS;=;%
node "%~dp0\..\mkdirp\bin\cmd.js" %*
)

View File

@ -0,0 +1,4 @@
'use strict';
module.exports = function () {
return /[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-PRZcf-nqry=><]/g;
};

View File

@ -0,0 +1,21 @@
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.

View File

@ -0,0 +1,123 @@
{
"_args": [
[
"ansi-regex@^2.0.0",
"C:\\Users\\x2mjbyrn\\Source\\Repos\\Skeleton\\node_modules\\update-notifier\\node_modules\\has-ansi"
]
],
"_from": "ansi-regex@>=2.0.0-0 <3.0.0-0",
"_id": "ansi-regex@2.1.1",
"_inCache": true,
"_location": "/update-notifier/ansi-regex",
"_nodeVersion": "0.10.32",
"_npmOperationalInternal": {
"host": "packages-18-east.internal.npmjs.com",
"tmp": "tmp/ansi-regex-2.1.1.tgz_1484363378013_0.4482989883981645"
},
"_npmUser": {
"email": "i.am.qix@gmail.com",
"name": "qix"
},
"_npmVersion": "2.14.2",
"_phantomChildren": {},
"_requested": {
"name": "ansi-regex",
"raw": "ansi-regex@^2.0.0",
"rawSpec": "^2.0.0",
"scope": null,
"spec": ">=2.0.0-0 <3.0.0-0",
"type": "range"
},
"_requiredBy": [
"/update-notifier/has-ansi",
"/update-notifier/strip-ansi"
],
"_resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz",
"_shasum": "c3b33ab5ee360d86e0e628f0468ae7ef27d654df",
"_shrinkwrap": null,
"_spec": "ansi-regex@^2.0.0",
"_where": "C:\\Users\\x2mjbyrn\\Source\\Repos\\Skeleton\\node_modules\\update-notifier\\node_modules\\has-ansi",
"author": {
"email": "sindresorhus@gmail.com",
"name": "Sindre Sorhus",
"url": "sindresorhus.com"
},
"bugs": {
"url": "https://github.com/chalk/ansi-regex/issues"
},
"dependencies": {},
"description": "Regular expression for matching ANSI escape codes",
"devDependencies": {
"ava": "0.17.0",
"xo": "0.16.0"
},
"directories": {},
"dist": {
"shasum": "c3b33ab5ee360d86e0e628f0468ae7ef27d654df",
"tarball": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz"
},
"engines": {
"node": ">=0.10.0"
},
"files": [
"index.js"
],
"gitHead": "7c908e7b4eb6cd82bfe1295e33fdf6d166c7ed85",
"homepage": "https://github.com/chalk/ansi-regex#readme",
"installable": true,
"keywords": [
"256",
"ansi",
"cli",
"color",
"colors",
"colour",
"command-line",
"console",
"escape",
"find",
"formatting",
"match",
"pattern",
"re",
"regex",
"regexp",
"rgb",
"shell",
"string",
"styles",
"terminal",
"test",
"text",
"tty",
"xterm"
],
"license": "MIT",
"maintainers": [
{
"name": "qix",
"email": "i.am.qix@gmail.com"
},
{
"name": "sindresorhus",
"email": "sindresorhus@gmail.com"
}
],
"name": "ansi-regex",
"optionalDependencies": {},
"repository": {
"type": "git",
"url": "git+https://github.com/chalk/ansi-regex.git"
},
"scripts": {
"test": "xo && ava --verbose",
"view-supported": "node fixtures/view-codes.js"
},
"version": "2.1.1",
"xo": {
"rules": {
"guard-for-in": 0,
"no-loop-func": 0
}
}
}

View File

@ -0,0 +1,39 @@
# ansi-regex [![Build Status](https://travis-ci.org/chalk/ansi-regex.svg?branch=master)](https://travis-ci.org/chalk/ansi-regex)
> Regular expression for matching [ANSI escape codes](http://en.wikipedia.org/wiki/ANSI_escape_code)
## Install
```
$ npm install --save ansi-regex
```
## Usage
```js
const ansiRegex = require('ansi-regex');
ansiRegex().test('\u001b[4mcake\u001b[0m');
//=> true
ansiRegex().test('cake');
//=> false
'\u001b[4mcake\u001b[0m'.match(ansiRegex());
//=> ['\u001b[4m', '\u001b[0m']
```
## FAQ
### Why do you test for codes not in the ECMA 48 standard?
Some of the codes we run as a test are codes that we acquired finding various lists of non-standard or manufacturer specific codes. If I recall correctly, we test for both standard and non-standard codes, as most of them follow the same or similar format and can be safely matched in strings without the risk of removing actual string content. There are a few non-standard control codes that do not follow the traditional format (i.e. they end in numbers) thus forcing us to exclude them from the test because we cannot reliably match them.
On the historical side, those ECMA standards were established in the early 90's whereas the VT100, for example, was designed in the mid/late 70's. At that point in time, control codes were still pretty ungoverned and engineers used them for a multitude of things, namely to activate hardware ports that may have been proprietary. Somewhere else you see a similar 'anarchy' of codes is in the x86 architecture for processors; there are a ton of "interrupts" that can mean different things on certain brands of processors, most of which have been phased out.
## License
MIT © [Sindre Sorhus](http://sindresorhus.com)

View File

@ -0,0 +1,65 @@
'use strict';
function assembleStyles () {
var styles = {
modifiers: {
reset: [0, 0],
bold: [1, 22], // 21 isn't widely supported and 22 does the same thing
dim: [2, 22],
italic: [3, 23],
underline: [4, 24],
inverse: [7, 27],
hidden: [8, 28],
strikethrough: [9, 29]
},
colors: {
black: [30, 39],
red: [31, 39],
green: [32, 39],
yellow: [33, 39],
blue: [34, 39],
magenta: [35, 39],
cyan: [36, 39],
white: [37, 39],
gray: [90, 39]
},
bgColors: {
bgBlack: [40, 49],
bgRed: [41, 49],
bgGreen: [42, 49],
bgYellow: [43, 49],
bgBlue: [44, 49],
bgMagenta: [45, 49],
bgCyan: [46, 49],
bgWhite: [47, 49]
}
};
// fix humans
styles.colors.grey = styles.colors.gray;
Object.keys(styles).forEach(function (groupName) {
var group = styles[groupName];
Object.keys(group).forEach(function (styleName) {
var style = group[styleName];
styles[styleName] = group[styleName] = {
open: '\u001b[' + style[0] + 'm',
close: '\u001b[' + style[1] + 'm'
};
});
Object.defineProperty(styles, groupName, {
value: group,
enumerable: false
});
});
return styles;
}
Object.defineProperty(module, 'exports', {
enumerable: true,
get: assembleStyles
});

View File

@ -0,0 +1,21 @@
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.

View File

@ -0,0 +1,105 @@
{
"_args": [
[
"ansi-styles@^2.2.1",
"C:\\Users\\x2mjbyrn\\Source\\Repos\\Skeleton\\node_modules\\update-notifier\\node_modules\\chalk"
]
],
"_from": "ansi-styles@>=2.2.1-0 <3.0.0-0",
"_id": "ansi-styles@2.2.1",
"_inCache": true,
"_location": "/update-notifier/ansi-styles",
"_nodeVersion": "4.3.0",
"_npmOperationalInternal": {
"host": "packages-12-west.internal.npmjs.com",
"tmp": "tmp/ansi-styles-2.2.1.tgz_1459197317833_0.9694824463222176"
},
"_npmUser": {
"email": "sindresorhus@gmail.com",
"name": "sindresorhus"
},
"_npmVersion": "3.8.3",
"_phantomChildren": {},
"_requested": {
"name": "ansi-styles",
"raw": "ansi-styles@^2.2.1",
"rawSpec": "^2.2.1",
"scope": null,
"spec": ">=2.2.1-0 <3.0.0-0",
"type": "range"
},
"_requiredBy": [
"/update-notifier/chalk"
],
"_resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz",
"_shasum": "b432dd3358b634cf75e1e4664368240533c1ddbe",
"_shrinkwrap": null,
"_spec": "ansi-styles@^2.2.1",
"_where": "C:\\Users\\x2mjbyrn\\Source\\Repos\\Skeleton\\node_modules\\update-notifier\\node_modules\\chalk",
"author": {
"email": "sindresorhus@gmail.com",
"name": "Sindre Sorhus",
"url": "sindresorhus.com"
},
"bugs": {
"url": "https://github.com/chalk/ansi-styles/issues"
},
"dependencies": {},
"description": "ANSI escape codes for styling strings in the terminal",
"devDependencies": {
"mocha": "*"
},
"directories": {},
"dist": {
"shasum": "b432dd3358b634cf75e1e4664368240533c1ddbe",
"tarball": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz"
},
"engines": {
"node": ">=0.10.0"
},
"files": [
"index.js"
],
"gitHead": "95c59b23be760108b6530ca1c89477c21b258032",
"homepage": "https://github.com/chalk/ansi-styles#readme",
"installable": true,
"keywords": [
"256",
"ansi",
"cli",
"color",
"colors",
"colour",
"command-line",
"console",
"escape",
"formatting",
"log",
"logging",
"rgb",
"shell",
"string",
"styles",
"terminal",
"text",
"tty",
"xterm"
],
"license": "MIT",
"maintainers": [
{
"name": "sindresorhus",
"email": "sindresorhus@gmail.com"
}
],
"name": "ansi-styles",
"optionalDependencies": {},
"repository": {
"type": "git",
"url": "git+https://github.com/chalk/ansi-styles.git"
},
"scripts": {
"test": "mocha"
},
"version": "2.2.1"
}

View File

@ -0,0 +1,86 @@
# ansi-styles [![Build Status](https://travis-ci.org/chalk/ansi-styles.svg?branch=master)](https://travis-ci.org/chalk/ansi-styles)
> [ANSI escape codes](http://en.wikipedia.org/wiki/ANSI_escape_code#Colors_and_Styles) for styling strings in the terminal
You probably want the higher-level [chalk](https://github.com/chalk/chalk) module for styling your strings.
![](screenshot.png)
## Install
```
$ npm install --save ansi-styles
```
## Usage
```js
var ansi = require('ansi-styles');
console.log(ansi.green.open + 'Hello world!' + ansi.green.close);
```
## API
Each style has an `open` and `close` property.
## Styles
### Modifiers
- `reset`
- `bold`
- `dim`
- `italic` *(not widely supported)*
- `underline`
- `inverse`
- `hidden`
- `strikethrough` *(not widely supported)*
### Colors
- `black`
- `red`
- `green`
- `yellow`
- `blue`
- `magenta`
- `cyan`
- `white`
- `gray`
### Background colors
- `bgBlack`
- `bgRed`
- `bgGreen`
- `bgYellow`
- `bgBlue`
- `bgMagenta`
- `bgCyan`
- `bgWhite`
## Advanced usage
By default you get a map of styles, but the styles are also available as groups. They are non-enumerable so they don't show up unless you access them explicitly. This makes it easier to expose only a subset in a higher-level module.
- `ansi.modifiers`
- `ansi.colors`
- `ansi.bgColors`
###### Example
```js
console.log(ansi.colors.green.open);
```
## License
MIT © [Sindre Sorhus](http://sindresorhus.com)

View File

@ -0,0 +1,45 @@
exports.single = {
topLeft: '┌',
topRight: '┐',
bottomRight: '┘',
bottomLeft: '└',
vertical: '│',
horizontal: '─'
};
exports.double = {
topLeft: '╔',
topRight: '╗',
bottomRight: '╝',
bottomLeft: '╚',
vertical: '║',
horizontal: '═'
};
exports.round = {
topLeft: '╭',
topRight: '╮',
bottomRight: '╯',
bottomLeft: '╰',
vertical: '│',
horizontal: '─'
};
// 1st: top and bottom, 2nd: left and right (as in CSS shorthands)
exports['single-double'] = {
topLeft: '╓',
topRight: '╖',
bottomRight: '╜',
bottomLeft: '╙',
vertical: '║',
horizontal: '─'
};
exports['double-single'] = {
topLeft: '╒',
topRight: '╕',
bottomRight: '╛',
bottomLeft: '╘',
vertical: '│',
horizontal: '═'
};

View File

@ -0,0 +1,111 @@
'use strict';
var stringWidth = require('string-width');
var repeating = require('repeating');
var chalk = require('chalk');
var objectAssign = require('object-assign');
var widestLine = require('widest-line');
var filledArray = require('filled-array');
var borderChars = require('./border-characters');
var getObject = function (detail) {
var obj;
if (typeof detail === 'number') {
obj = {
top: detail,
right: detail * 3,
bottom: detail,
left: detail * 3
};
} else {
obj = objectAssign({
top: 0,
right: 0,
bottom: 0,
left: 0
}, detail);
}
return obj;
};
var getBorderChars = function (borderStyle) {
var sides = [
'topLeft',
'topRight',
'bottomRight',
'bottomLeft',
'vertical',
'horizontal'
];
var chars;
if (typeof borderStyle === 'string') {
chars = borderChars[borderStyle];
if (!chars) {
throw new TypeError('Invalid border style: ' + borderStyle);
}
} else {
sides.forEach(function (key) {
if (!borderStyle[key] || typeof borderStyle[key] !== 'string') {
throw new TypeError('Invalid border style: ' + key);
}
});
chars = borderStyle;
}
return chars;
};
module.exports = function (text, opts) {
opts = objectAssign({
padding: 0,
borderStyle: 'single'
}, opts);
if (opts.borderColor && !chalk[opts.borderColor]) {
throw new Error(opts.borderColor + ' is not a valid borderColor');
}
var chars = getBorderChars(opts.borderStyle);
var padding = getObject(opts.padding);
var margin = getObject(opts.margin);
var colorizeBorder = function (x) {
return opts.borderColor ? chalk[opts.borderColor](x) : x;
};
var NL = '\n';
var PAD = ' ';
var lines = text.split(NL);
if (padding.top > 0) {
lines = filledArray('', padding.top).concat(lines);
}
if (padding.bottom > 0) {
lines = lines.concat(filledArray('', padding.bottom));
}
var contentWidth = widestLine(text) + padding.left + padding.right;
var paddingLeft = repeating(PAD, padding.left);
var marginLeft = repeating(PAD, margin.left);
var horizontal = repeating(chars.horizontal, contentWidth);
var top = colorizeBorder(repeating(NL, margin.top) + marginLeft + chars.topLeft + horizontal + chars.topRight);
var bottom = colorizeBorder(marginLeft + chars.bottomLeft + horizontal + chars.bottomRight + repeating(NL, margin.bottom));
var side = colorizeBorder(chars.vertical);
var middle = lines.map(function (line) {
var paddingRight = repeating(PAD, contentWidth - stringWidth(line) - padding.left);
return marginLeft + side + paddingLeft + line + paddingRight + side;
}).join(NL);
return top + NL + middle + NL + bottom;
};
module.exports._borderStyles = borderChars;

View File

@ -0,0 +1,21 @@
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.

View File

@ -0,0 +1,113 @@
{
"_args": [
[
{
"raw": "boxen@^0.3.1",
"scope": null,
"escapedName": "boxen",
"name": "boxen",
"rawSpec": "^0.3.1",
"spec": ">=0.3.1 <0.4.0",
"type": "range"
},
"C:\\Users\\x2mjbyrn\\Source\\Repos\\Skeleton\\node_modules\\update-notifier"
]
],
"_from": "boxen@>=0.3.1 <0.4.0",
"_id": "boxen@0.3.1",
"_inCache": true,
"_location": "/update-notifier/boxen",
"_nodeVersion": "4.2.4",
"_npmOperationalInternal": {
"host": "packages-5-east.internal.npmjs.com",
"tmp": "tmp/boxen-0.3.1.tgz_1455102193900_0.9651177956257015"
},
"_npmUser": {
"name": "sindresorhus",
"email": "sindresorhus@gmail.com"
},
"_npmVersion": "2.14.12",
"_phantomChildren": {},
"_requested": {
"raw": "boxen@^0.3.1",
"scope": null,
"escapedName": "boxen",
"name": "boxen",
"rawSpec": "^0.3.1",
"spec": ">=0.3.1 <0.4.0",
"type": "range"
},
"_requiredBy": [
"/update-notifier"
],
"_resolved": "https://registry.npmjs.org/boxen/-/boxen-0.3.1.tgz",
"_shasum": "a7d898243ae622f7abb6bb604d740a76c6a5461b",
"_shrinkwrap": null,
"_spec": "boxen@^0.3.1",
"_where": "C:\\Users\\x2mjbyrn\\Source\\Repos\\Skeleton\\node_modules\\update-notifier",
"author": {
"name": "Sindre Sorhus",
"email": "sindresorhus@gmail.com",
"url": "sindresorhus.com"
},
"bugs": {
"url": "https://github.com/sindresorhus/boxen/issues"
},
"dependencies": {
"chalk": "^1.1.1",
"filled-array": "^1.0.0",
"object-assign": "^4.0.1",
"repeating": "^2.0.0",
"string-width": "^1.0.1",
"widest-line": "^1.0.0"
},
"description": "Create boxes in the terminal",
"devDependencies": {
"ava": "*",
"xo": "*"
},
"directories": {},
"dist": {
"shasum": "a7d898243ae622f7abb6bb604d740a76c6a5461b",
"tarball": "https://registry.npmjs.org/boxen/-/boxen-0.3.1.tgz"
},
"engines": {
"node": ">=0.10.0"
},
"files": [
"index.js",
"border-characters.js"
],
"gitHead": "05c5f742a22962c4fc35344ecfba44f1e69528b3",
"homepage": "https://github.com/sindresorhus/boxen#readme",
"keywords": [
"cli",
"box",
"boxes",
"terminal",
"term",
"console",
"ascii",
"unicode",
"border",
"text"
],
"license": "MIT",
"maintainers": [
{
"name": "sindresorhus",
"email": "sindresorhus@gmail.com"
}
],
"name": "boxen",
"optionalDependencies": {},
"readme": "ERROR: No README data found!",
"repository": {
"type": "git",
"url": "git+https://github.com/sindresorhus/boxen.git"
},
"scripts": {
"test": "xo && ava"
},
"version": "0.3.1"
}

View File

@ -0,0 +1,139 @@
# <img src="screenshot.png" width="400" alt="boxen">
> Create boxes in the terminal
[![Build Status](https://travis-ci.org/sindresorhus/boxen.svg?branch=master)](https://travis-ci.org/sindresorhus/boxen)
## Install
```
$ npm install --save boxen
```
## Usage
```js
const boxen = require('boxen');
console.log(boxen('unicorn', {padding: 1}));
/*
┌─────────────┐
│ │
│ unicorn │
│ │
└─────────────┘
*/
console.log(boxen('unicorn', {padding: 1, margin: 1, borderStyle: 'double'}));
/*
╔═════════════╗
║ ║
║ unicorn ║
║ ║
╚═════════════╝
*/
```
## API
### boxen(input, [options])
#### input
Type: `string`
Text inside the box.
#### options
##### borderColor
Type: `string`<br>
Values: `black` `red` `green` `yellow` `blue` `magenta` `cyan` `white` `gray`
Color of the box border.
##### borderStyle
Type: `string` `object`<br>
Default: `single`<br>
Values:
- `single`
```
┌───┐
│foo│
└───┘
```
- `double`
```
╔═══╗
║foo║
╚═══╝
```
- `round` (`single` sides with round corners)
```
╭───╮
│foo│
╰───╯
```
- `single-double` (`single` on top and bottom, `double` on right and left)
```
╓───╖
║foo║
╙───╜
```
- `double-single` (`double` on top and bottom, `single` on right and left)
```
╒═══╕
│foo│
╘═══╛
```
Style of the box border.
Can be any of the above predefined styles or an object with the following keys:
```js
{
topLeft: '+',
topRight: '+',
bottomLeft: '+',
bottomRight: '+',
horizontal: '-',
vertical: '|'
}
```
##### padding
Type: `number` `object`<br>
Default: `0`
Space between the text and box border.
Accepts a number or an object with any of the `top`, `right`, `bottom`, `left` properties. When a number is specified, the left/right padding is 3 times the top/bottom to make it look nice.
##### margin
Type: `number` `object`<br>
Default: `0`
Space around the box.
Accepts a number or an object with any of the `top`, `right`, `bottom`, `left` properties. When a number is specified, the left/right margin is 3 times the top/bottom to make it look nice.
## Related
- [boxen-cli](https://github.com/sindresorhus/boxen-cli) - CLI for this module
## License
MIT © [Sindre Sorhus](http://sindresorhus.com)

View File

@ -0,0 +1,116 @@
'use strict';
var escapeStringRegexp = require('escape-string-regexp');
var ansiStyles = require('ansi-styles');
var stripAnsi = require('strip-ansi');
var hasAnsi = require('has-ansi');
var supportsColor = require('supports-color');
var defineProps = Object.defineProperties;
var isSimpleWindowsTerm = process.platform === 'win32' && !/^xterm/i.test(process.env.TERM);
function Chalk(options) {
// detect mode if not set manually
this.enabled = !options || options.enabled === undefined ? supportsColor : options.enabled;
}
// use bright blue on Windows as the normal blue color is illegible
if (isSimpleWindowsTerm) {
ansiStyles.blue.open = '\u001b[94m';
}
var styles = (function () {
var ret = {};
Object.keys(ansiStyles).forEach(function (key) {
ansiStyles[key].closeRe = new RegExp(escapeStringRegexp(ansiStyles[key].close), 'g');
ret[key] = {
get: function () {
return build.call(this, this._styles.concat(key));
}
};
});
return ret;
})();
var proto = defineProps(function chalk() {}, styles);
function build(_styles) {
var builder = function () {
return applyStyle.apply(builder, arguments);
};
builder._styles = _styles;
builder.enabled = this.enabled;
// __proto__ is used because we must return a function, but there is
// no way to create a function with a different prototype.
/* eslint-disable no-proto */
builder.__proto__ = proto;
return builder;
}
function applyStyle() {
// support varags, but simply cast to string in case there's only one arg
var args = arguments;
var argsLen = args.length;
var str = argsLen !== 0 && String(arguments[0]);
if (argsLen > 1) {
// don't slice `arguments`, it prevents v8 optimizations
for (var a = 1; a < argsLen; a++) {
str += ' ' + args[a];
}
}
if (!this.enabled || !str) {
return str;
}
var nestedStyles = this._styles;
var i = nestedStyles.length;
// Turns out that on Windows dimmed gray text becomes invisible in cmd.exe,
// see https://github.com/chalk/chalk/issues/58
// If we're on Windows and we're dealing with a gray color, temporarily make 'dim' a noop.
var originalDim = ansiStyles.dim.open;
if (isSimpleWindowsTerm && (nestedStyles.indexOf('gray') !== -1 || nestedStyles.indexOf('grey') !== -1)) {
ansiStyles.dim.open = '';
}
while (i--) {
var code = ansiStyles[nestedStyles[i]];
// Replace any instances already present with a re-opening code
// otherwise only the part of the string until said closing code
// will be colored, and the rest will simply be 'plain'.
str = code.open + str.replace(code.closeRe, code.open) + code.close;
}
// Reset the original 'dim' if we changed it to work around the Windows dimmed gray issue.
ansiStyles.dim.open = originalDim;
return str;
}
function init() {
var ret = {};
Object.keys(styles).forEach(function (name) {
ret[name] = {
get: function () {
return build.call(this, [name]);
}
};
});
return ret;
}
defineProps(Chalk.prototype, init());
module.exports = new Chalk();
module.exports.styles = ansiStyles;
module.exports.hasColor = hasAnsi;
module.exports.stripColor = stripAnsi;
module.exports.supportsColor = supportsColor;

View File

@ -0,0 +1,21 @@
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.

View File

@ -0,0 +1,131 @@
{
"_args": [
[
"chalk@^1.0.0",
"C:\\Users\\x2mjbyrn\\Source\\Repos\\Skeleton\\node_modules\\update-notifier"
]
],
"_from": "chalk@>=1.0.0-0 <2.0.0-0",
"_id": "chalk@1.1.3",
"_inCache": true,
"_location": "/update-notifier/chalk",
"_nodeVersion": "0.10.32",
"_npmOperationalInternal": {
"host": "packages-12-west.internal.npmjs.com",
"tmp": "tmp/chalk-1.1.3.tgz_1459210604109_0.3892582862172276"
},
"_npmUser": {
"email": "i.am.qix@gmail.com",
"name": "qix"
},
"_npmVersion": "2.14.2",
"_phantomChildren": {},
"_requested": {
"name": "chalk",
"raw": "chalk@^1.0.0",
"rawSpec": "^1.0.0",
"scope": null,
"spec": ">=1.0.0-0 <2.0.0-0",
"type": "range"
},
"_requiredBy": [
"/update-notifier"
],
"_resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz",
"_shasum": "a8115c55e4a702fe4d150abd3872822a7e09fc98",
"_shrinkwrap": null,
"_spec": "chalk@^1.0.0",
"_where": "C:\\Users\\x2mjbyrn\\Source\\Repos\\Skeleton\\node_modules\\update-notifier",
"bugs": {
"url": "https://github.com/chalk/chalk/issues"
},
"dependencies": {
"ansi-styles": "^2.2.1",
"escape-string-regexp": "^1.0.2",
"has-ansi": "^2.0.0",
"strip-ansi": "^3.0.0",
"supports-color": "^2.0.0"
},
"description": "Terminal string styling done right. Much color.",
"devDependencies": {
"coveralls": "^2.11.2",
"matcha": "^0.6.0",
"mocha": "*",
"nyc": "^3.0.0",
"require-uncached": "^1.0.2",
"resolve-from": "^1.0.0",
"semver": "^4.3.3",
"xo": "*"
},
"directories": {},
"dist": {
"shasum": "a8115c55e4a702fe4d150abd3872822a7e09fc98",
"tarball": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz"
},
"engines": {
"node": ">=0.10.0"
},
"files": [
"index.js"
],
"gitHead": "0d8d8c204eb87a4038219131ad4d8369c9f59d24",
"homepage": "https://github.com/chalk/chalk#readme",
"installable": true,
"keywords": [
"256",
"ansi",
"cli",
"color",
"colors",
"colour",
"command-line",
"console",
"formatting",
"log",
"logging",
"rgb",
"shell",
"str",
"string",
"style",
"styles",
"terminal",
"text",
"tty",
"xterm"
],
"license": "MIT",
"maintainers": [
{
"name": "qix",
"email": "i.am.qix@gmail.com"
},
{
"name": "sindresorhus",
"email": "sindresorhus@gmail.com"
},
{
"name": "unicorn",
"email": "sindresorhus+unicorn@gmail.com"
}
],
"name": "chalk",
"optionalDependencies": {},
"repository": {
"type": "git",
"url": "git+https://github.com/chalk/chalk.git"
},
"scripts": {
"bench": "matcha benchmark.js",
"coverage": "nyc npm test && nyc report",
"coveralls": "nyc npm test && nyc report --reporter=text-lcov | coveralls",
"test": "xo && mocha"
},
"version": "1.1.3",
"xo": {
"envs": [
"mocha",
"node"
]
}
}

View File

@ -0,0 +1,213 @@
<h1 align="center">
<br>
<br>
<img width="360" src="https://cdn.rawgit.com/chalk/chalk/19935d6484811c5e468817f846b7b3d417d7bf4a/logo.svg" alt="chalk">
<br>
<br>
<br>
</h1>
> Terminal string styling done right
[![Build Status](https://travis-ci.org/chalk/chalk.svg?branch=master)](https://travis-ci.org/chalk/chalk)
[![Coverage Status](https://coveralls.io/repos/chalk/chalk/badge.svg?branch=master)](https://coveralls.io/r/chalk/chalk?branch=master)
[![](http://img.shields.io/badge/unicorn-approved-ff69b4.svg)](https://www.youtube.com/watch?v=9auOCbH5Ns4)
[colors.js](https://github.com/Marak/colors.js) used to be the most popular string styling module, but it has serious deficiencies like extending `String.prototype` which causes all kinds of [problems](https://github.com/yeoman/yo/issues/68). Although there are other ones, they either do too much or not enough.
**Chalk is a clean and focused alternative.**
![](https://github.com/chalk/ansi-styles/raw/master/screenshot.png)
## Why
- Highly performant
- Doesn't extend `String.prototype`
- Expressive API
- Ability to nest styles
- Clean and focused
- Auto-detects color support
- Actively maintained
- [Used by ~4500 modules](https://www.npmjs.com/browse/depended/chalk) as of July 15, 2015
## Install
```
$ npm install --save chalk
```
## Usage
Chalk comes with an easy to use composable API where you just chain and nest the styles you want.
```js
var chalk = require('chalk');
// style a string
chalk.blue('Hello world!');
// combine styled and normal strings
chalk.blue('Hello') + 'World' + chalk.red('!');
// compose multiple styles using the chainable API
chalk.blue.bgRed.bold('Hello world!');
// pass in multiple arguments
chalk.blue('Hello', 'World!', 'Foo', 'bar', 'biz', 'baz');
// nest styles
chalk.red('Hello', chalk.underline.bgBlue('world') + '!');
// nest styles of the same type even (color, underline, background)
chalk.green(
'I am a green line ' +
chalk.blue.underline.bold('with a blue substring') +
' that becomes green again!'
);
```
Easily define your own themes.
```js
var chalk = require('chalk');
var error = chalk.bold.red;
console.log(error('Error!'));
```
Take advantage of console.log [string substitution](http://nodejs.org/docs/latest/api/console.html#console_console_log_data).
```js
var name = 'Sindre';
console.log(chalk.green('Hello %s'), name);
//=> Hello Sindre
```
## API
### chalk.`<style>[.<style>...](string, [string...])`
Example: `chalk.red.bold.underline('Hello', 'world');`
Chain [styles](#styles) and call the last one as a method with a string argument. Order doesn't matter, and later styles take precedent in case of a conflict. This simply means that `Chalk.red.yellow.green` is equivalent to `Chalk.green`.
Multiple arguments will be separated by space.
### chalk.enabled
Color support is automatically detected, but you can override it by setting the `enabled` property. You should however only do this in your own code as it applies globally to all chalk consumers.
If you need to change this in a reusable module create a new instance:
```js
var ctx = new chalk.constructor({enabled: false});
```
### chalk.supportsColor
Detect whether the terminal [supports color](https://github.com/chalk/supports-color). Used internally and handled for you, but exposed for convenience.
Can be overridden by the user with the flags `--color` and `--no-color`. For situations where using `--color` is not possible, add an environment variable `FORCE_COLOR` with any value to force color. Trumps `--no-color`.
### chalk.styles
Exposes the styles as [ANSI escape codes](https://github.com/chalk/ansi-styles).
Generally not useful, but you might need just the `.open` or `.close` escape code if you're mixing externally styled strings with your own.
```js
var chalk = require('chalk');
console.log(chalk.styles.red);
//=> {open: '\u001b[31m', close: '\u001b[39m'}
console.log(chalk.styles.red.open + 'Hello' + chalk.styles.red.close);
```
### chalk.hasColor(string)
Check whether a string [has color](https://github.com/chalk/has-ansi).
### chalk.stripColor(string)
[Strip color](https://github.com/chalk/strip-ansi) from a string.
Can be useful in combination with `.supportsColor` to strip color on externally styled text when it's not supported.
Example:
```js
var chalk = require('chalk');
var styledString = getText();
if (!chalk.supportsColor) {
styledString = chalk.stripColor(styledString);
}
```
## Styles
### Modifiers
- `reset`
- `bold`
- `dim`
- `italic` *(not widely supported)*
- `underline`
- `inverse`
- `hidden`
- `strikethrough` *(not widely supported)*
### Colors
- `black`
- `red`
- `green`
- `yellow`
- `blue` *(on Windows the bright version is used as normal blue is illegible)*
- `magenta`
- `cyan`
- `white`
- `gray`
### Background colors
- `bgBlack`
- `bgRed`
- `bgGreen`
- `bgYellow`
- `bgBlue`
- `bgMagenta`
- `bgCyan`
- `bgWhite`
## 256-colors
Chalk does not support anything other than the base eight colors, which guarantees it will work on all terminals and systems. Some terminals, specifically `xterm` compliant ones, will support the full range of 8-bit colors. For this the lower level [ansi-256-colors](https://github.com/jbnicolai/ansi-256-colors) package can be used.
## Windows
If you're on Windows, do yourself a favor and use [`cmder`](http://bliker.github.io/cmder/) instead of `cmd.exe`.
## Related
- [chalk-cli](https://github.com/chalk/chalk-cli) - CLI for this module
- [ansi-styles](https://github.com/chalk/ansi-styles/) - ANSI escape codes for styling strings in the terminal
- [supports-color](https://github.com/chalk/supports-color/) - Detect whether a terminal supports color
- [strip-ansi](https://github.com/chalk/strip-ansi) - Strip ANSI escape codes
- [has-ansi](https://github.com/chalk/has-ansi) - Check if a string has ANSI escape codes
- [ansi-regex](https://github.com/chalk/ansi-regex) - Regular expression for matching ANSI escape codes
- [wrap-ansi](https://github.com/chalk/wrap-ansi) - Wordwrap a string with ANSI escape codes
## License
MIT © [Sindre Sorhus](http://sindresorhus.com)

View File

@ -0,0 +1,111 @@
'use strict';
var path = require('path');
var fs = require('graceful-fs');
var osenv = require('osenv');
var assign = require('object-assign');
var mkdirp = require('mkdirp');
var uuid = require('uuid');
var xdgBasedir = require('xdg-basedir');
var osTmpdir = require('os-tmpdir');
var writeFileAtomic = require('write-file-atomic');
var dotProp = require('dot-prop');
var user = (osenv.user() || uuid.v4()).replace(/\\/g, '');
var configDir = xdgBasedir.config || path.join(osTmpdir(), user, '.config');
var permissionError = 'You don\'t have access to this file.';
var defaultPathMode = parseInt('0700', 8);
var writeFileOptions = {mode: parseInt('0600', 8)};
function Configstore(id, defaults, opts) {
opts = opts || {};
var pathPrefix = opts.globalConfigPath ?
path.join(id, 'config.json') :
path.join('configstore', id + '.json');
this.path = path.join(configDir, pathPrefix);
this.all = assign({}, defaults || {}, this.all || {});
}
Configstore.prototype = Object.create(Object.prototype, {
all: {
get: function () {
try {
return JSON.parse(fs.readFileSync(this.path, 'utf8'));
} catch (err) {
// create dir if it doesn't exist
if (err.code === 'ENOENT') {
mkdirp.sync(path.dirname(this.path), defaultPathMode);
return {};
}
// improve the message of permission errors
if (err.code === 'EACCES') {
err.message = err.message + '\n' + permissionError + '\n';
}
// empty the file if it encounters invalid JSON
if (err.name === 'SyntaxError') {
writeFileAtomic.sync(this.path, '', writeFileOptions);
return {};
}
throw err;
}
},
set: function (val) {
try {
// make sure the folder exists as it
// could have been deleted in the meantime
mkdirp.sync(path.dirname(this.path), defaultPathMode);
writeFileAtomic.sync(this.path, JSON.stringify(val, null, '\t'), writeFileOptions);
} catch (err) {
// improve the message of permission errors
if (err.code === 'EACCES') {
err.message = err.message + '\n' + permissionError + '\n';
}
throw err;
}
}
},
size: {
get: function () {
return Object.keys(this.all || {}).length;
}
}
});
Configstore.prototype.get = function (key) {
return dotProp.get(this.all, key);
};
Configstore.prototype.set = function (key, val) {
var config = this.all;
if (arguments.length === 1) {
Object.keys(key).forEach(function (k) {
dotProp.set(config, k, key[k]);
});
} else {
dotProp.set(config, key, val);
}
this.all = config;
};
Configstore.prototype.has = function (key) {
return dotProp.has(this.all, key);
};
Configstore.prototype.delete = Configstore.prototype.del = function (key) {
var config = this.all;
dotProp.delete(config, key);
this.all = config;
};
Configstore.prototype.clear = function () {
this.all = {};
};
module.exports = Configstore;

View File

@ -0,0 +1,150 @@
{
"_args": [
[
{
"raw": "configstore@^2.0.0",
"scope": null,
"escapedName": "configstore",
"name": "configstore",
"rawSpec": "^2.0.0",
"spec": ">=2.0.0 <3.0.0",
"type": "range"
},
"C:\\Users\\x2mjbyrn\\Source\\Repos\\Skeleton\\node_modules\\typings-core"
],
[
{
"raw": "configstore@^2.0.0",
"scope": null,
"escapedName": "configstore",
"name": "configstore",
"rawSpec": "^2.0.0",
"spec": ">=2.0.0 <3.0.0",
"type": "range"
},
"C:\\Users\\x2mjbyrn\\Source\\Repos\\Skeleton\\node_modules\\update-notifier"
]
],
"_from": "configstore@^2.0.0",
"_id": "configstore@2.1.0",
"_inCache": true,
"_location": "/update-notifier/configstore",
"_nodeVersion": "6.3.1",
"_npmOperationalInternal": {
"host": "packages-12-west.internal.npmjs.com",
"tmp": "tmp/configstore-2.1.0.tgz_1472703568293_0.01155238808132708"
},
"_npmUser": {
"name": "sboudrias",
"email": "admin@simonboudrias.com"
},
"_npmVersion": "3.10.3",
"_phantomChildren": {},
"_requested": {
"raw": "configstore@^2.0.0",
"scope": null,
"escapedName": "configstore",
"name": "configstore",
"rawSpec": "^2.0.0",
"spec": ">=2.0.0 <3.0.0",
"type": "range"
},
"_requiredBy": [
"/update-notifier"
],
"_resolved": "https://registry.npmjs.org/configstore/-/configstore-2.1.0.tgz",
"_shasum": "737a3a7036e9886102aa6099e47bb33ab1aba1a1",
"_shrinkwrap": null,
"_spec": "configstore@^2.0.0",
"_where": "C:\\Users\\x2mjbyrn\\Source\\Repos\\Skeleton\\node_modules\\update-notifier",
"author": {
"name": "Sindre Sorhus",
"email": "sindresorhus@gmail.com",
"url": "sindresorhus.com"
},
"bugs": {
"url": "https://github.com/yeoman/configstore/issues"
},
"dependencies": {
"dot-prop": "^3.0.0",
"graceful-fs": "^4.1.2",
"mkdirp": "^0.5.0",
"object-assign": "^4.0.1",
"os-tmpdir": "^1.0.0",
"osenv": "^0.1.0",
"uuid": "^2.0.1",
"write-file-atomic": "^1.1.2",
"xdg-basedir": "^2.0.0"
},
"description": "Easily load and save config without having to think about where and how",
"devDependencies": {
"ava": "*",
"path-exists": "^2.0.0",
"xo": "*"
},
"directories": {},
"dist": {
"shasum": "737a3a7036e9886102aa6099e47bb33ab1aba1a1",
"tarball": "https://registry.npmjs.org/configstore/-/configstore-2.1.0.tgz"
},
"engines": {
"node": ">=0.10.0"
},
"files": [
"index.js"
],
"gitHead": "1a02879cc302b661d998af5a6390817660eef359",
"homepage": "https://github.com/yeoman/configstore#readme",
"keywords": [
"config",
"store",
"storage",
"conf",
"configuration",
"settings",
"preferences",
"json",
"data",
"persist",
"persistent",
"save"
],
"license": "BSD-2-Clause",
"maintainers": [
{
"name": "sindresorhus",
"email": "sindresorhus@gmail.com"
},
{
"name": "addyosmani",
"email": "addyosmani@gmail.com"
},
{
"name": "passy",
"email": "phartig@rdrei.net"
},
{
"name": "sboudrias",
"email": "admin@simonboudrias.com"
},
{
"name": "eddiemonge",
"email": "eddie+npm@eddiemonge.com"
},
{
"name": "arthurvr",
"email": "contact@arthurverschaeve.be"
}
],
"name": "configstore",
"optionalDependencies": {},
"readme": "ERROR: No README data found!",
"repository": {
"type": "git",
"url": "git+https://github.com/yeoman/configstore.git"
},
"scripts": {
"test": "xo && ava"
},
"version": "2.1.0"
}

View File

@ -0,0 +1,114 @@
# configstore [![Build Status](https://travis-ci.org/yeoman/configstore.svg?branch=master)](https://travis-ci.org/yeoman/configstore)
> Easily load and persist config without having to think about where and how
Config is stored in a JSON file located in `$XDG_CONFIG_HOME` or `~/.config`.<br>
Example: `~/.config/configstore/some-id.json`
## Usage
```js
const Configstore = require('configstore');
const pkg = require('./package.json');
// create a Configstore instance with an unique ID e.g.
// package name and optionally some default values
const conf = new Configstore(pkg.name, {foo: 'bar'});
console.log(conf.get('foo'));
//=> 'bar'
conf.set('awesome', true);
console.log(conf.get('awesome'));
//=> true
// use dot-notation to access nested properties
conf.set('bar.baz', true);
console.log(conf.get('bar'));
//=> {baz: true}
conf.delete('awesome');
console.log(conf.get('awesome'));
//=> undefined
```
## API
### Configstore(packageName, [defaults], [options])
Returns a new instance.
#### packageName
Type: `string`
Name of your package.
#### defaults
Type: `Object`
Default config.
#### options
##### globalConfigPath
Type: `boolean`<br>
Default: `false`
Store the config at `$CONFIG/package-name/config.json` instead of the default `$CONFIG/configstore/package-name.json`. This is not recommended as you might end up conflicting with other tools, rendering the "without having to think" idea moot.
### Instance
You can use [dot-notation](https://github.com/sindresorhus/dot-prop) in a `key` to access nested properties.
### .set(key, value)
Set an item.
### .set(object)
Set multiple items at once.
### .get(key)
Get an item.
### .has(key)
Check if an item exists.
### .delete(key)
Delete an item.
### .clear()
Delete all items.
### .size
Get the item count.
### .path
Get the path to the config file. Can be used to show the user where the config file is located or even better open it for them.
### .all
Get all the config as an object or replace the current config with an object:
```js
conf.all = {
hello: 'world'
};
```
## License
[BSD license](http://opensource.org/licenses/bsd-license.php)<br>
Copyright Google

View File

@ -0,0 +1,4 @@
'use strict';
var ansiRegex = require('ansi-regex');
var re = new RegExp(ansiRegex().source); // remove the `g` flag
module.exports = re.test.bind(re);

View File

@ -0,0 +1,21 @@
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.

View File

@ -0,0 +1,109 @@
{
"_args": [
[
"has-ansi@^2.0.0",
"C:\\Users\\x2mjbyrn\\Source\\Repos\\Skeleton\\node_modules\\update-notifier\\node_modules\\chalk"
]
],
"_from": "has-ansi@>=2.0.0-0 <3.0.0-0",
"_id": "has-ansi@2.0.0",
"_inCache": true,
"_location": "/update-notifier/has-ansi",
"_nodeVersion": "0.12.5",
"_npmUser": {
"email": "sindresorhus@gmail.com",
"name": "sindresorhus"
},
"_npmVersion": "2.11.2",
"_phantomChildren": {},
"_requested": {
"name": "has-ansi",
"raw": "has-ansi@^2.0.0",
"rawSpec": "^2.0.0",
"scope": null,
"spec": ">=2.0.0-0 <3.0.0-0",
"type": "range"
},
"_requiredBy": [
"/update-notifier/chalk"
],
"_resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-2.0.0.tgz",
"_shasum": "34f5049ce1ecdf2b0649af3ef24e45ed35416d91",
"_shrinkwrap": null,
"_spec": "has-ansi@^2.0.0",
"_where": "C:\\Users\\x2mjbyrn\\Source\\Repos\\Skeleton\\node_modules\\update-notifier\\node_modules\\chalk",
"author": {
"email": "sindresorhus@gmail.com",
"name": "Sindre Sorhus",
"url": "sindresorhus.com"
},
"bugs": {
"url": "https://github.com/sindresorhus/has-ansi/issues"
},
"dependencies": {
"ansi-regex": "^2.0.0"
},
"description": "Check if a string has ANSI escape codes",
"devDependencies": {
"ava": "0.0.4"
},
"directories": {},
"dist": {
"shasum": "34f5049ce1ecdf2b0649af3ef24e45ed35416d91",
"tarball": "https://registry.npmjs.org/has-ansi/-/has-ansi-2.0.0.tgz"
},
"engines": {
"node": ">=0.10.0"
},
"files": [
"index.js"
],
"gitHead": "0722275e1bef139fcd09137da6e5550c3cd368b9",
"homepage": "https://github.com/sindresorhus/has-ansi",
"installable": true,
"keywords": [
"ansi",
"color",
"colors",
"colour",
"command-line",
"console",
"escape",
"find",
"has",
"match",
"pattern",
"re",
"regex",
"regexp",
"shell",
"string",
"styles",
"terminal",
"test",
"text",
"tty",
"xterm"
],
"license": "MIT",
"maintainers": [
{
"name": "sindresorhus",
"email": "sindresorhus@gmail.com"
},
{
"name": "jbnicolai",
"email": "jappelman@xebia.com"
}
],
"name": "has-ansi",
"optionalDependencies": {},
"repository": {
"type": "git",
"url": "https://github.com/sindresorhus/has-ansi"
},
"scripts": {
"test": "node test.js"
},
"version": "2.0.0"
}

View File

@ -0,0 +1,36 @@
# has-ansi [![Build Status](https://travis-ci.org/sindresorhus/has-ansi.svg?branch=master)](https://travis-ci.org/sindresorhus/has-ansi)
> Check if a string has [ANSI escape codes](http://en.wikipedia.org/wiki/ANSI_escape_code)
## Install
```
$ npm install --save has-ansi
```
## Usage
```js
var hasAnsi = require('has-ansi');
hasAnsi('\u001b[4mcake\u001b[0m');
//=> true
hasAnsi('cake');
//=> false
```
## Related
- [has-ansi-cli](https://github.com/sindresorhus/has-ansi-cli) - CLI for this module
- [strip-ansi](https://github.com/sindresorhus/strip-ansi) - Strip ANSI escape codes
- [ansi-regex](https://github.com/sindresorhus/ansi-regex) - Regular expression for matching ANSI escape codes
- [chalk](https://github.com/sindresorhus/chalk) - Terminal string styling done right
## License
MIT © [Sindre Sorhus](http://sindresorhus.com)

View File

@ -0,0 +1,4 @@
language: node_js
node_js:
- "0.8"
- "0.10"

View File

@ -0,0 +1,18 @@
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.

View File

@ -0,0 +1,2 @@
var argv = require('../')(process.argv.slice(2));
console.dir(argv);

View File

@ -0,0 +1,187 @@
module.exports = function (args, opts) {
if (!opts) opts = {};
var flags = { bools : {}, strings : {} };
[].concat(opts['boolean']).filter(Boolean).forEach(function (key) {
flags.bools[key] = true;
});
[].concat(opts.string).filter(Boolean).forEach(function (key) {
flags.strings[key] = true;
});
var aliases = {};
Object.keys(opts.alias || {}).forEach(function (key) {
aliases[key] = [].concat(opts.alias[key]);
aliases[key].forEach(function (x) {
aliases[x] = [key].concat(aliases[key].filter(function (y) {
return x !== y;
}));
});
});
var defaults = opts['default'] || {};
var argv = { _ : [] };
Object.keys(flags.bools).forEach(function (key) {
setArg(key, defaults[key] === undefined ? false : defaults[key]);
});
var notFlags = [];
if (args.indexOf('--') !== -1) {
notFlags = args.slice(args.indexOf('--')+1);
args = args.slice(0, args.indexOf('--'));
}
function setArg (key, val) {
var value = !flags.strings[key] && isNumber(val)
? Number(val) : val
;
setKey(argv, key.split('.'), value);
(aliases[key] || []).forEach(function (x) {
setKey(argv, x.split('.'), value);
});
}
for (var i = 0; i < args.length; i++) {
var arg = args[i];
if (/^--.+=/.test(arg)) {
// Using [\s\S] instead of . because js doesn't support the
// 'dotall' regex modifier. See:
// http://stackoverflow.com/a/1068308/13216
var m = arg.match(/^--([^=]+)=([\s\S]*)$/);
setArg(m[1], m[2]);
}
else if (/^--no-.+/.test(arg)) {
var key = arg.match(/^--no-(.+)/)[1];
setArg(key, false);
}
else if (/^--.+/.test(arg)) {
var key = arg.match(/^--(.+)/)[1];
var next = args[i + 1];
if (next !== undefined && !/^-/.test(next)
&& !flags.bools[key]
&& (aliases[key] ? !flags.bools[aliases[key]] : true)) {
setArg(key, next);
i++;
}
else if (/^(true|false)$/.test(next)) {
setArg(key, next === 'true');
i++;
}
else {
setArg(key, flags.strings[key] ? '' : true);
}
}
else if (/^-[^-]+/.test(arg)) {
var letters = arg.slice(1,-1).split('');
var broken = false;
for (var j = 0; j < letters.length; j++) {
var next = arg.slice(j+2);
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], flags.strings[letters[j]] ? '' : true);
}
}
var key = arg.slice(-1)[0];
if (!broken && key !== '-') {
if (args[i+1] && !/^(-|--)[^-]/.test(args[i+1])
&& !flags.bools[key]
&& (aliases[key] ? !flags.bools[aliases[key]] : true)) {
setArg(key, args[i+1]);
i++;
}
else if (args[i+1] && /true|false/.test(args[i+1])) {
setArg(key, args[i+1] === 'true');
i++;
}
else {
setArg(key, flags.strings[key] ? '' : true);
}
}
}
else {
argv._.push(
flags.strings['_'] || !isNumber(arg) ? arg : Number(arg)
);
}
}
Object.keys(defaults).forEach(function (key) {
if (!hasKey(argv, key.split('.'))) {
setKey(argv, key.split('.'), defaults[key]);
(aliases[key] || []).forEach(function (x) {
setKey(argv, x.split('.'), defaults[key]);
});
}
});
notFlags.forEach(function(key) {
argv._.push(key);
});
return argv;
};
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 (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 ];
}
}
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);
}
function longest (xs) {
return Math.max.apply(null, xs.map(function (x) { return x.length }));
}

View File

@ -0,0 +1,113 @@
{
"_args": [
[
{
"raw": "minimist@0.0.8",
"scope": null,
"escapedName": "minimist",
"name": "minimist",
"rawSpec": "0.0.8",
"spec": "0.0.8",
"type": "version"
},
"C:\\Users\\x2mjbyrn\\Source\\Repos\\Skeleton\\node_modules\\typings-core\\node_modules\\mkdirp"
],
[
{
"raw": "minimist@0.0.8",
"scope": null,
"escapedName": "minimist",
"name": "minimist",
"rawSpec": "0.0.8",
"spec": "0.0.8",
"type": "version"
},
"C:\\Users\\x2mjbyrn\\Source\\Repos\\Skeleton\\node_modules\\update-notifier\\node_modules\\mkdirp"
]
],
"_from": "minimist@0.0.8",
"_id": "minimist@0.0.8",
"_inCache": true,
"_location": "/update-notifier/minimist",
"_npmUser": {
"name": "substack",
"email": "mail@substack.net"
},
"_npmVersion": "1.4.3",
"_phantomChildren": {},
"_requested": {
"raw": "minimist@0.0.8",
"scope": null,
"escapedName": "minimist",
"name": "minimist",
"rawSpec": "0.0.8",
"spec": "0.0.8",
"type": "version"
},
"_requiredBy": [
"/update-notifier/mkdirp"
],
"_resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz",
"_shasum": "857fcabfc3397d2625b8228262e86aa7a011b05d",
"_shrinkwrap": null,
"_spec": "minimist@0.0.8",
"_where": "C:\\Users\\x2mjbyrn\\Source\\Repos\\Skeleton\\node_modules\\update-notifier\\node_modules\\mkdirp",
"author": {
"name": "James Halliday",
"email": "mail@substack.net",
"url": "http://substack.net"
},
"bugs": {
"url": "https://github.com/substack/minimist/issues"
},
"dependencies": {},
"description": "parse argument options",
"devDependencies": {
"tap": "~0.4.0",
"tape": "~1.0.4"
},
"directories": {},
"dist": {
"shasum": "857fcabfc3397d2625b8228262e86aa7a011b05d",
"tarball": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz"
},
"homepage": "https://github.com/substack/minimist",
"keywords": [
"argv",
"getopt",
"parser",
"optimist"
],
"license": "MIT",
"main": "index.js",
"maintainers": [
{
"name": "substack",
"email": "mail@substack.net"
}
],
"name": "minimist",
"optionalDependencies": {},
"readme": "ERROR: No README data found!",
"repository": {
"type": "git",
"url": "git://github.com/substack/minimist.git"
},
"scripts": {
"test": "tap test/*.js"
},
"testling": {
"files": "test/*.js",
"browsers": [
"ie/6..latest",
"ff/5",
"firefox/latest",
"chrome/10",
"chrome/latest",
"safari/5.1",
"safari/latest",
"opera/12"
]
},
"version": "0.0.8"
}

View File

@ -0,0 +1,73 @@
# minimist
parse argument options
This module is the guts of optimist's argument parser without all the
fanciful decoration.
[![browser support](https://ci.testling.com/substack/minimist.png)](http://ci.testling.com/substack/minimist)
[![build status](https://secure.travis-ci.org/substack/minimist.png)](http://travis-ci.org/substack/minimist)
# example
``` js
var argv = require('minimist')(process.argv.slice(2));
console.dir(argv);
```
```
$ node example/parse.js -a beep -b boop
{ _: [], a: 'beep', b: 'boop' }
```
```
$ node example/parse.js -x 3 -y 4 -n5 -abc --beep=boop foo bar baz
{ _: [ 'foo', 'bar', 'baz' ],
x: 3,
y: 4,
n: 5,
a: true,
b: true,
c: true,
beep: 'boop' }
```
# methods
``` js
var parseArgs = require('minimist')
```
## var argv = parseArgs(args, opts={})
Return an argument object `argv` populated with the array arguments from `args`.
`argv._` contains all the arguments that didn't have an option associated with
them.
Numeric-looking arguments will be returned as numbers unless `opts.string` or
`opts.boolean` is set for that argument name.
Any arguments after `'--'` will not be parsed and will end up in `argv._`.
options can be:
* `opts.string` - a string or array of strings argument names to always treat as
strings
* `opts.boolean` - a string or array of strings to always treat as booleans
* `opts.alias` - an object mapping string names to strings or arrays of string
argument names to use as aliases
* `opts.default` - an object mapping string argument names to default values
# install
With [npm](https://npmjs.org) do:
```
npm install minimist
```
# license
MIT

View File

@ -0,0 +1,24 @@
var parse = require('../');
var test = require('tape');
test('-', function (t) {
t.plan(5);
t.deepEqual(parse([ '-n', '-' ]), { n: '-', _: [] });
t.deepEqual(parse([ '-' ]), { _: [ '-' ] });
t.deepEqual(parse([ '-f-' ]), { f: '-', _: [] });
t.deepEqual(
parse([ '-b', '-' ], { boolean: 'b' }),
{ b: true, _: [ '-' ] }
);
t.deepEqual(
parse([ '-s', '-' ], { string: 's' }),
{ s: '-', _: [] }
);
});
test('-a -- b', function (t) {
t.plan(3);
t.deepEqual(parse([ '-a', '--', 'b' ]), { a: true, _: [ 'b' ] });
t.deepEqual(parse([ '--a', '--', 'b' ]), { a: true, _: [ 'b' ] });
t.deepEqual(parse([ '--a', '--', 'b' ]), { a: true, _: [ 'b' ] });
});

View File

@ -0,0 +1,20 @@
var test = require('tape');
var parse = require('../');
test('boolean default true', function (t) {
var argv = parse([], {
boolean: 'sometrue',
default: { sometrue: true }
});
t.equal(argv.sometrue, true);
t.end();
});
test('boolean default false', function (t) {
var argv = parse([], {
boolean: 'somefalse',
default: { somefalse: false }
});
t.equal(argv.somefalse, false);
t.end();
});

View File

@ -0,0 +1,16 @@
var parse = require('../');
var test = require('tape');
test('dotted alias', function (t) {
var argv = parse(['--a.b', '22'], {default: {'a.b': 11}, alias: {'a.b': 'aa.bb'}});
t.equal(argv.a.b, 22);
t.equal(argv.aa.bb, 22);
t.end();
});
test('dotted default', function (t) {
var argv = parse('', {default: {'a.b': 11}, alias: {'a.b': 'aa.bb'}});
t.equal(argv.a.b, 11);
t.equal(argv.aa.bb, 11);
t.end();
});

View File

@ -0,0 +1,31 @@
var test = require('tape');
var parse = require('../');
test('long opts', function (t) {
t.deepEqual(
parse([ '--bool' ]),
{ bool : true, _ : [] },
'long boolean'
);
t.deepEqual(
parse([ '--pow', 'xixxle' ]),
{ pow : 'xixxle', _ : [] },
'long capture sp'
);
t.deepEqual(
parse([ '--pow=xixxle' ]),
{ pow : 'xixxle', _ : [] },
'long capture eq'
);
t.deepEqual(
parse([ '--host', 'localhost', '--port', '555' ]),
{ host : 'localhost', port : 555, _ : [] },
'long captures sp'
);
t.deepEqual(
parse([ '--host=localhost', '--port=555' ]),
{ host : 'localhost', port : 555, _ : [] },
'long captures eq'
);
t.end();
});

View File

@ -0,0 +1,318 @@
var parse = require('../');
var test = require('tape');
test('parse args', function (t) {
t.deepEqual(
parse([ '--no-moo' ]),
{ moo : false, _ : [] },
'no'
);
t.deepEqual(
parse([ '-v', 'a', '-v', 'b', '-v', 'c' ]),
{ v : ['a','b','c'], _ : [] },
'multi'
);
t.end();
});
test('comprehensive', function (t) {
t.deepEqual(
parse([
'--name=meowmers', 'bare', '-cats', 'woo',
'-h', 'awesome', '--multi=quux',
'--key', 'value',
'-b', '--bool', '--no-meep', '--multi=baz',
'--', '--not-a-flag', 'eek'
]),
{
c : true,
a : true,
t : true,
s : 'woo',
h : 'awesome',
b : true,
bool : true,
key : 'value',
multi : [ 'quux', 'baz' ],
meep : false,
name : 'meowmers',
_ : [ 'bare', '--not-a-flag', 'eek' ]
}
);
t.end();
});
test('nums', function (t) {
var argv = parse([
'-x', '1234',
'-y', '5.67',
'-z', '1e7',
'-w', '10f',
'--hex', '0xdeadbeef',
'789'
]);
t.deepEqual(argv, {
x : 1234,
y : 5.67,
z : 1e7,
w : '10f',
hex : 0xdeadbeef,
_ : [ 789 ]
});
t.deepEqual(typeof argv.x, 'number');
t.deepEqual(typeof argv.y, 'number');
t.deepEqual(typeof argv.z, 'number');
t.deepEqual(typeof argv.w, 'string');
t.deepEqual(typeof argv.hex, 'number');
t.deepEqual(typeof argv._[0], 'number');
t.end();
});
test('flag boolean', function (t) {
var argv = parse([ '-t', 'moo' ], { boolean: 't' });
t.deepEqual(argv, { t : true, _ : [ 'moo' ] });
t.deepEqual(typeof argv.t, 'boolean');
t.end();
});
test('flag boolean value', function (t) {
var argv = parse(['--verbose', 'false', 'moo', '-t', 'true'], {
boolean: [ 't', 'verbose' ],
default: { verbose: true }
});
t.deepEqual(argv, {
verbose: false,
t: true,
_: ['moo']
});
t.deepEqual(typeof argv.verbose, 'boolean');
t.deepEqual(typeof argv.t, 'boolean');
t.end();
});
test('flag boolean default false', function (t) {
var argv = parse(['moo'], {
boolean: ['t', 'verbose'],
default: { verbose: false, t: false }
});
t.deepEqual(argv, {
verbose: false,
t: false,
_: ['moo']
});
t.deepEqual(typeof argv.verbose, 'boolean');
t.deepEqual(typeof argv.t, 'boolean');
t.end();
});
test('boolean groups', function (t) {
var argv = parse([ '-x', '-z', 'one', 'two', 'three' ], {
boolean: ['x','y','z']
});
t.deepEqual(argv, {
x : true,
y : false,
z : true,
_ : [ 'one', 'two', 'three' ]
});
t.deepEqual(typeof argv.x, 'boolean');
t.deepEqual(typeof argv.y, 'boolean');
t.deepEqual(typeof argv.z, 'boolean');
t.end();
});
test('newlines in params' , function (t) {
var args = parse([ '-s', "X\nX" ])
t.deepEqual(args, { _ : [], s : "X\nX" });
// reproduce in bash:
// VALUE="new
// line"
// node program.js --s="$VALUE"
args = parse([ "--s=X\nX" ])
t.deepEqual(args, { _ : [], s : "X\nX" });
t.end();
});
test('strings' , function (t) {
var s = parse([ '-s', '0001234' ], { string: 's' }).s;
t.equal(s, '0001234');
t.equal(typeof s, 'string');
var x = parse([ '-x', '56' ], { string: 'x' }).x;
t.equal(x, '56');
t.equal(typeof x, 'string');
t.end();
});
test('stringArgs', function (t) {
var s = parse([ ' ', ' ' ], { string: '_' })._;
t.same(s.length, 2);
t.same(typeof s[0], 'string');
t.same(s[0], ' ');
t.same(typeof s[1], 'string');
t.same(s[1], ' ');
t.end();
});
test('empty strings', function(t) {
var s = parse([ '-s' ], { string: 's' }).s;
t.equal(s, '');
t.equal(typeof s, 'string');
var str = parse([ '--str' ], { string: 'str' }).str;
t.equal(str, '');
t.equal(typeof str, 'string');
var letters = parse([ '-art' ], {
string: [ 'a', 't' ]
});
t.equal(letters.a, '');
t.equal(letters.r, true);
t.equal(letters.t, '');
t.end();
});
test('slashBreak', function (t) {
t.same(
parse([ '-I/foo/bar/baz' ]),
{ I : '/foo/bar/baz', _ : [] }
);
t.same(
parse([ '-xyz/foo/bar/baz' ]),
{ x : true, y : true, z : '/foo/bar/baz', _ : [] }
);
t.end();
});
test('alias', function (t) {
var argv = parse([ '-f', '11', '--zoom', '55' ], {
alias: { z: 'zoom' }
});
t.equal(argv.zoom, 55);
t.equal(argv.z, argv.zoom);
t.equal(argv.f, 11);
t.end();
});
test('multiAlias', function (t) {
var argv = parse([ '-f', '11', '--zoom', '55' ], {
alias: { z: [ 'zm', 'zoom' ] }
});
t.equal(argv.zoom, 55);
t.equal(argv.z, argv.zoom);
t.equal(argv.z, argv.zm);
t.equal(argv.f, 11);
t.end();
});
test('nested dotted objects', function (t) {
var argv = parse([
'--foo.bar', '3', '--foo.baz', '4',
'--foo.quux.quibble', '5', '--foo.quux.o_O',
'--beep.boop'
]);
t.same(argv.foo, {
bar : 3,
baz : 4,
quux : {
quibble : 5,
o_O : true
}
});
t.same(argv.beep, { boop : true });
t.end();
});
test('boolean and alias with chainable api', function (t) {
var aliased = [ '-h', 'derp' ];
var regular = [ '--herp', 'derp' ];
var opts = {
herp: { alias: 'h', boolean: true }
};
var aliasedArgv = parse(aliased, {
boolean: 'herp',
alias: { h: 'herp' }
});
var propertyArgv = parse(regular, {
boolean: 'herp',
alias: { h: 'herp' }
});
var expected = {
herp: true,
h: true,
'_': [ 'derp' ]
};
t.same(aliasedArgv, expected);
t.same(propertyArgv, expected);
t.end();
});
test('boolean and alias with options hash', function (t) {
var aliased = [ '-h', 'derp' ];
var regular = [ '--herp', 'derp' ];
var opts = {
alias: { 'h': 'herp' },
boolean: 'herp'
};
var aliasedArgv = parse(aliased, opts);
var propertyArgv = parse(regular, opts);
var expected = {
herp: true,
h: true,
'_': [ 'derp' ]
};
t.same(aliasedArgv, expected);
t.same(propertyArgv, expected);
t.end();
});
test('boolean and alias using explicit true', function (t) {
var aliased = [ '-h', 'true' ];
var regular = [ '--herp', 'true' ];
var opts = {
alias: { h: 'herp' },
boolean: 'h'
};
var aliasedArgv = parse(aliased, opts);
var propertyArgv = parse(regular, opts);
var expected = {
herp: true,
h: true,
'_': [ ]
};
t.same(aliasedArgv, expected);
t.same(propertyArgv, expected);
t.end();
});
// regression, see https://github.com/substack/node-optimist/issues/71
test('boolean and --x=true', function(t) {
var parsed = parse(['--boool', '--other=true'], {
boolean: 'boool'
});
t.same(parsed.boool, true);
t.same(parsed.other, 'true');
parsed = parse(['--boool', '--other=false'], {
boolean: 'boool'
});
t.same(parsed.boool, true);
t.same(parsed.other, 'false');
t.end();
});

View File

@ -0,0 +1,9 @@
var parse = require('../');
var test = require('tape');
test('parse with modifier functions' , function (t) {
t.plan(1);
var argv = parse([ '-b', '123' ], { boolean: 'b' });
t.deepEqual(argv, { b: true, _: ['123'] });
});

View File

@ -0,0 +1,67 @@
var parse = require('../');
var test = require('tape');
test('numeric short args', function (t) {
t.plan(2);
t.deepEqual(parse([ '-n123' ]), { n: 123, _: [] });
t.deepEqual(
parse([ '-123', '456' ]),
{ 1: true, 2: true, 3: 456, _: [] }
);
});
test('short', function (t) {
t.deepEqual(
parse([ '-b' ]),
{ b : true, _ : [] },
'short boolean'
);
t.deepEqual(
parse([ 'foo', 'bar', 'baz' ]),
{ _ : [ 'foo', 'bar', 'baz' ] },
'bare'
);
t.deepEqual(
parse([ '-cats' ]),
{ c : true, a : true, t : true, s : true, _ : [] },
'group'
);
t.deepEqual(
parse([ '-cats', 'meow' ]),
{ c : true, a : true, t : true, s : 'meow', _ : [] },
'short group next'
);
t.deepEqual(
parse([ '-h', 'localhost' ]),
{ h : 'localhost', _ : [] },
'short capture'
);
t.deepEqual(
parse([ '-h', 'localhost', '-p', '555' ]),
{ h : 'localhost', p : 555, _ : [] },
'short captures'
);
t.end();
});
test('mixed short bool and capture', function (t) {
t.same(
parse([ '-h', 'localhost', '-fp', '555', 'script.js' ]),
{
f : true, p : 555, h : 'localhost',
_ : [ 'script.js' ]
}
);
t.end();
});
test('short and long', function (t) {
t.deepEqual(
parse([ '-h', 'localhost', '-fp', '555', 'script.js' ]),
{
f : true, p : 555, h : 'localhost',
_ : [ 'script.js' ]
}
);
t.end();
});

View File

@ -0,0 +1,8 @@
var parse = require('../');
var test = require('tape');
test('whitespace should be whitespace' , function (t) {
t.plan(1);
var x = parse([ '-x', '\t' ]).x;
t.equal(x, '\t');
});

View File

@ -0,0 +1,8 @@
language: node_js
node_js:
- "0.8"
- "0.10"
- "0.12"
- "iojs"
before_install:
- npm install -g npm@~1.4.6

View File

@ -0,0 +1,21 @@
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.

View File

@ -0,0 +1,33 @@
#!/usr/bin/env node
var mkdirp = require('../');
var minimist = require('minimist');
var fs = require('fs');
var argv = minimist(process.argv.slice(2), {
alias: { m: 'mode', h: 'help' },
string: [ 'mode' ]
});
if (argv.help) {
fs.createReadStream(__dirname + '/usage.txt').pipe(process.stdout);
return;
}
var paths = argv._.slice();
var mode = argv.mode ? parseInt(argv.mode, 8) : undefined;
(function next () {
if (paths.length === 0) return;
var p = paths.shift();
if (mode === undefined) mkdirp(p, cb)
else mkdirp(p, mode, cb)
function cb (err) {
if (err) {
console.error(err.message);
process.exit(1);
}
else next();
}
})();

View File

@ -0,0 +1,12 @@
usage: mkdirp [DIR1,DIR2..] {OPTIONS}
Create each supplied directory including any necessary parent directories that
don't yet exist.
If the directory already exists, do nothing.
OPTIONS are:
-m, --mode If a directory needs to be created, set the mode as an octal
permission string.

View File

@ -0,0 +1,6 @@
var mkdirp = require('mkdirp');
mkdirp('/tmp/foo/bar/baz', function (err) {
if (err) console.error(err)
else console.log('pow!')
});

View File

@ -0,0 +1,98 @@
var path = require('path');
var fs = require('fs');
var _0777 = parseInt('0777', 8);
module.exports = mkdirP.mkdirp = mkdirP.mkdirP = mkdirP;
function mkdirP (p, opts, f, made) {
if (typeof opts === 'function') {
f = opts;
opts = {};
}
else if (!opts || typeof opts !== 'object') {
opts = { mode: opts };
}
var mode = opts.mode;
var xfs = opts.fs || fs;
if (mode === undefined) {
mode = _0777 & (~process.umask());
}
if (!made) made = null;
var cb = f || function () {};
p = path.resolve(p);
xfs.mkdir(p, mode, function (er) {
if (!er) {
made = made || p;
return cb(null, made);
}
switch (er.code) {
case 'ENOENT':
mkdirP(path.dirname(p), opts, function (er, made) {
if (er) cb(er, made);
else mkdirP(p, opts, cb, made);
});
break;
// In the case of any other error, just see if there's a dir
// there already. If so, then hooray! If not, then something
// is borked.
default:
xfs.stat(p, function (er2, stat) {
// if the stat fails, then that's super weird.
// let the original error be the failure reason.
if (er2 || !stat.isDirectory()) cb(er, made)
else cb(null, made);
});
break;
}
});
}
mkdirP.sync = function sync (p, opts, made) {
if (!opts || typeof opts !== 'object') {
opts = { mode: opts };
}
var mode = opts.mode;
var xfs = opts.fs || fs;
if (mode === undefined) {
mode = _0777 & (~process.umask());
}
if (!made) made = null;
p = path.resolve(p);
try {
xfs.mkdirSync(p, mode);
made = made || p;
}
catch (err0) {
switch (err0.code) {
case 'ENOENT' :
made = sync(path.dirname(p), opts, made);
sync(p, opts, made);
break;
// In the case of any other error, just see if there's a dir
// there already. If so, then hooray! If not, then something
// is borked.
default:
var stat;
try {
stat = xfs.statSync(p);
}
catch (err1) {
throw err0;
}
if (!stat.isDirectory()) throw err0;
break;
}
}
return made;
};

View File

@ -0,0 +1,105 @@
{
"_args": [
[
{
"raw": "mkdirp@^0.5.1",
"scope": null,
"escapedName": "mkdirp",
"name": "mkdirp",
"rawSpec": "^0.5.1",
"spec": ">=0.5.1 <0.6.0",
"type": "range"
},
"C:\\Users\\x2mjbyrn\\Source\\Repos\\Skeleton\\node_modules\\typings-core"
],
[
{
"raw": "mkdirp@^0.5.0",
"scope": null,
"escapedName": "mkdirp",
"name": "mkdirp",
"rawSpec": "^0.5.0",
"spec": ">=0.5.0 <0.6.0",
"type": "range"
},
"C:\\Users\\x2mjbyrn\\Source\\Repos\\Skeleton\\node_modules\\update-notifier\\node_modules\\configstore"
]
],
"_from": "mkdirp@^0.5.0",
"_id": "mkdirp@0.5.1",
"_inCache": true,
"_location": "/update-notifier/mkdirp",
"_nodeVersion": "2.0.0",
"_npmUser": {
"name": "substack",
"email": "substack@gmail.com"
},
"_npmVersion": "2.9.0",
"_phantomChildren": {},
"_requested": {
"raw": "mkdirp@^0.5.0",
"scope": null,
"escapedName": "mkdirp",
"name": "mkdirp",
"rawSpec": "^0.5.0",
"spec": ">=0.5.0 <0.6.0",
"type": "range"
},
"_requiredBy": [
"/update-notifier/configstore"
],
"_resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz",
"_shasum": "30057438eac6cf7f8c4767f38648d6697d75c903",
"_shrinkwrap": null,
"_spec": "mkdirp@^0.5.0",
"_where": "C:\\Users\\x2mjbyrn\\Source\\Repos\\Skeleton\\node_modules\\update-notifier\\node_modules\\configstore",
"author": {
"name": "James Halliday",
"email": "mail@substack.net",
"url": "http://substack.net"
},
"bin": {
"mkdirp": "bin/cmd.js"
},
"bugs": {
"url": "https://github.com/substack/node-mkdirp/issues"
},
"dependencies": {
"minimist": "0.0.8"
},
"description": "Recursively mkdir, like `mkdir -p`",
"devDependencies": {
"mock-fs": "2 >=2.7.0",
"tap": "1"
},
"directories": {},
"dist": {
"shasum": "30057438eac6cf7f8c4767f38648d6697d75c903",
"tarball": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz"
},
"gitHead": "d4eff0f06093aed4f387e88e9fc301cb76beedc7",
"homepage": "https://github.com/substack/node-mkdirp#readme",
"keywords": [
"mkdir",
"directory"
],
"license": "MIT",
"main": "index.js",
"maintainers": [
{
"name": "substack",
"email": "mail@substack.net"
}
],
"name": "mkdirp",
"optionalDependencies": {},
"readme": "ERROR: No README data found!",
"repository": {
"type": "git",
"url": "git+https://github.com/substack/node-mkdirp.git"
},
"scripts": {
"test": "tap test/*.js"
},
"version": "0.5.1"
}

View File

@ -0,0 +1,100 @@
# mkdirp
Like `mkdir -p`, but in node.js!
[![build status](https://secure.travis-ci.org/substack/node-mkdirp.png)](http://travis-ci.org/substack/node-mkdirp)
# example
## pow.js
```js
var mkdirp = require('mkdirp');
mkdirp('/tmp/foo/bar/baz', function (err) {
if (err) console.error(err)
else console.log('pow!')
});
```
Output
```
pow!
```
And now /tmp/foo/bar/baz exists, huzzah!
# methods
```js
var mkdirp = require('mkdirp');
```
## mkdirp(dir, opts, cb)
Create a new directory and any necessary subdirectories at `dir` with octal
permission string `opts.mode`. If `opts` is a non-object, it will be treated as
the `opts.mode`.
If `opts.mode` isn't specified, it defaults to `0777 & (~process.umask())`.
`cb(err, made)` fires with the error or the first directory `made`
that had to be created, if any.
You can optionally pass in an alternate `fs` implementation by passing in
`opts.fs`. Your implementation should have `opts.fs.mkdir(path, mode, cb)` and
`opts.fs.stat(path, cb)`.
## mkdirp.sync(dir, opts)
Synchronously create a new directory and any necessary subdirectories at `dir`
with octal permission string `opts.mode`. If `opts` is a non-object, it will be
treated as the `opts.mode`.
If `opts.mode` isn't specified, it defaults to `0777 & (~process.umask())`.
Returns the first directory that had to be created, if any.
You can optionally pass in an alternate `fs` implementation by passing in
`opts.fs`. Your implementation should have `opts.fs.mkdirSync(path, mode)` and
`opts.fs.statSync(path)`.
# usage
This package also ships with a `mkdirp` command.
```
usage: mkdirp [DIR1,DIR2..] {OPTIONS}
Create each supplied directory including any necessary parent directories that
don't yet exist.
If the directory already exists, do nothing.
OPTIONS are:
-m, --mode If a directory needs to be created, set the mode as an octal
permission string.
```
# install
With [npm](http://npmjs.org) do:
```
npm install mkdirp
```
to get the library, or
```
npm install -g mkdirp
```
to get the command.
# license
MIT

View File

@ -0,0 +1,41 @@
var mkdirp = require('../').mkdirp;
var path = require('path');
var fs = require('fs');
var test = require('tap').test;
var _0777 = parseInt('0777', 8);
var _0755 = parseInt('0755', 8);
var _0744 = parseInt('0744', 8);
var ps = [ '', 'tmp' ];
for (var i = 0; i < 25; i++) {
var dir = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
ps.push(dir);
}
var file = ps.join('/');
test('chmod-pre', function (t) {
var mode = _0744
mkdirp(file, mode, function (er) {
t.ifError(er, 'should not error');
fs.stat(file, function (er, stat) {
t.ifError(er, 'should exist');
t.ok(stat && stat.isDirectory(), 'should be directory');
t.equal(stat && stat.mode & _0777, mode, 'should be 0744');
t.end();
});
});
});
test('chmod', function (t) {
var mode = _0755
mkdirp(file, mode, function (er) {
t.ifError(er, 'should not error');
fs.stat(file, function (er, stat) {
t.ifError(er, 'should exist');
t.ok(stat && stat.isDirectory(), 'should be directory');
t.end();
});
});
});

View File

@ -0,0 +1,38 @@
var mkdirp = require('../').mkdirp;
var path = require('path');
var fs = require('fs');
var test = require('tap').test;
var _0755 = parseInt('0755', 8);
var ps = [ '', 'tmp' ];
for (var i = 0; i < 25; i++) {
var dir = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
ps.push(dir);
}
var file = ps.join('/');
// a file in the way
var itw = ps.slice(0, 3).join('/');
test('clobber-pre', function (t) {
console.error("about to write to "+itw)
fs.writeFileSync(itw, 'I AM IN THE WAY, THE TRUTH, AND THE LIGHT.');
fs.stat(itw, function (er, stat) {
t.ifError(er)
t.ok(stat && stat.isFile(), 'should be file')
t.end()
})
})
test('clobber', function (t) {
t.plan(2);
mkdirp(file, _0755, function (err) {
t.ok(err);
t.equal(err.code, 'ENOTDIR');
t.end();
});
});

View File

@ -0,0 +1,28 @@
var mkdirp = require('../');
var path = require('path');
var fs = require('fs');
var exists = fs.exists || path.exists;
var test = require('tap').test;
var _0777 = parseInt('0777', 8);
var _0755 = parseInt('0755', 8);
test('woo', function (t) {
t.plan(5);
var x = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
var y = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
var z = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
var file = '/tmp/' + [x,y,z].join('/');
mkdirp(file, _0755, function (err) {
t.ifError(err);
exists(file, function (ex) {
t.ok(ex, 'file created');
fs.stat(file, function (err, stat) {
t.ifError(err);
t.equal(stat.mode & _0777, _0755);
t.ok(stat.isDirectory(), 'target not a directory');
})
})
});
});

View File

@ -0,0 +1,29 @@
var mkdirp = require('../');
var path = require('path');
var test = require('tap').test;
var mockfs = require('mock-fs');
var _0777 = parseInt('0777', 8);
var _0755 = parseInt('0755', 8);
test('opts.fs', function (t) {
t.plan(5);
var x = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
var y = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
var z = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
var file = '/beep/boop/' + [x,y,z].join('/');
var xfs = mockfs.fs();
mkdirp(file, { fs: xfs, mode: _0755 }, function (err) {
t.ifError(err);
xfs.exists(file, function (ex) {
t.ok(ex, 'created file');
xfs.stat(file, function (err, stat) {
t.ifError(err);
t.equal(stat.mode & _0777, _0755);
t.ok(stat.isDirectory(), 'target not a directory');
});
});
});
});

View File

@ -0,0 +1,27 @@
var mkdirp = require('../');
var path = require('path');
var test = require('tap').test;
var mockfs = require('mock-fs');
var _0777 = parseInt('0777', 8);
var _0755 = parseInt('0755', 8);
test('opts.fs sync', function (t) {
t.plan(4);
var x = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
var y = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
var z = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
var file = '/beep/boop/' + [x,y,z].join('/');
var xfs = mockfs.fs();
mkdirp.sync(file, { fs: xfs, mode: _0755 });
xfs.exists(file, function (ex) {
t.ok(ex, 'created file');
xfs.stat(file, function (err, stat) {
t.ifError(err);
t.equal(stat.mode & _0777, _0755);
t.ok(stat.isDirectory(), 'target not a directory');
});
});
});

View File

@ -0,0 +1,32 @@
var mkdirp = require('../');
var path = require('path');
var fs = require('fs');
var exists = fs.exists || path.exists;
var test = require('tap').test;
var _0777 = parseInt('0777', 8);
var _0755 = parseInt('0755', 8);
test('async perm', function (t) {
t.plan(5);
var file = '/tmp/' + (Math.random() * (1<<30)).toString(16);
mkdirp(file, _0755, function (err) {
t.ifError(err);
exists(file, function (ex) {
t.ok(ex, 'file created');
fs.stat(file, function (err, stat) {
t.ifError(err);
t.equal(stat.mode & _0777, _0755);
t.ok(stat.isDirectory(), 'target not a directory');
})
})
});
});
test('async root perm', function (t) {
mkdirp('/tmp', _0755, function (err) {
if (err) t.fail(err);
t.end();
});
t.end();
});

View File

@ -0,0 +1,36 @@
var mkdirp = require('../');
var path = require('path');
var fs = require('fs');
var exists = fs.exists || path.exists;
var test = require('tap').test;
var _0777 = parseInt('0777', 8);
var _0755 = parseInt('0755', 8);
test('sync perm', function (t) {
t.plan(4);
var file = '/tmp/' + (Math.random() * (1<<30)).toString(16) + '.json';
mkdirp.sync(file, _0755);
exists(file, function (ex) {
t.ok(ex, 'file created');
fs.stat(file, function (err, stat) {
t.ifError(err);
t.equal(stat.mode & _0777, _0755);
t.ok(stat.isDirectory(), 'target not a directory');
});
});
});
test('sync root perm', function (t) {
t.plan(3);
var file = '/tmp';
mkdirp.sync(file, _0755);
exists(file, function (ex) {
t.ok(ex, 'file created');
fs.stat(file, function (err, stat) {
t.ifError(err);
t.ok(stat.isDirectory(), 'target not a directory');
})
});
});

View File

@ -0,0 +1,37 @@
var mkdirp = require('../').mkdirp;
var path = require('path');
var fs = require('fs');
var exists = fs.exists || path.exists;
var test = require('tap').test;
var _0777 = parseInt('0777', 8);
var _0755 = parseInt('0755', 8);
test('race', function (t) {
t.plan(10);
var ps = [ '', 'tmp' ];
for (var i = 0; i < 25; i++) {
var dir = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
ps.push(dir);
}
var file = ps.join('/');
var res = 2;
mk(file);
mk(file);
function mk (file, cb) {
mkdirp(file, _0755, function (err) {
t.ifError(err);
exists(file, function (ex) {
t.ok(ex, 'file created');
fs.stat(file, function (err, stat) {
t.ifError(err);
t.equal(stat.mode & _0777, _0755);
t.ok(stat.isDirectory(), 'target not a directory');
});
})
});
}
});

View File

@ -0,0 +1,32 @@
var mkdirp = require('../');
var path = require('path');
var fs = require('fs');
var exists = fs.exists || path.exists;
var test = require('tap').test;
var _0777 = parseInt('0777', 8);
var _0755 = parseInt('0755', 8);
test('rel', function (t) {
t.plan(5);
var x = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
var y = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
var z = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
var cwd = process.cwd();
process.chdir('/tmp');
var file = [x,y,z].join('/');
mkdirp(file, _0755, function (err) {
t.ifError(err);
exists(file, function (ex) {
t.ok(ex, 'file created');
fs.stat(file, function (err, stat) {
t.ifError(err);
process.chdir(cwd);
t.equal(stat.mode & _0777, _0755);
t.ok(stat.isDirectory(), 'target not a directory');
})
})
});
});

View File

@ -0,0 +1,25 @@
var mkdirp = require('../');
var path = require('path');
var fs = require('fs');
var test = require('tap').test;
test('return value', function (t) {
t.plan(4);
var x = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
var y = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
var z = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
var file = '/tmp/' + [x,y,z].join('/');
// should return the first dir created.
// By this point, it would be profoundly surprising if /tmp didn't
// already exist, since every other test makes things in there.
mkdirp(file, function (err, made) {
t.ifError(err);
t.equal(made, '/tmp/' + x);
mkdirp(file, function (err, made) {
t.ifError(err);
t.equal(made, null);
});
});
});

View File

@ -0,0 +1,24 @@
var mkdirp = require('../');
var path = require('path');
var fs = require('fs');
var test = require('tap').test;
test('return value', function (t) {
t.plan(2);
var x = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
var y = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
var z = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
var file = '/tmp/' + [x,y,z].join('/');
// should return the first dir created.
// By this point, it would be profoundly surprising if /tmp didn't
// already exist, since every other test makes things in there.
// Note that this will throw on failure, which will fail the test.
var made = mkdirp.sync(file);
t.equal(made, '/tmp/' + x);
// making the same file again should have no effect.
made = mkdirp.sync(file);
t.equal(made, null);
});

View File

@ -0,0 +1,19 @@
var mkdirp = require('../');
var path = require('path');
var fs = require('fs');
var test = require('tap').test;
var _0755 = parseInt('0755', 8);
test('root', function (t) {
// '/' on unix, 'c:/' on windows.
var file = path.resolve('/');
mkdirp(file, _0755, function (err) {
if (err) throw err
fs.stat(file, function (er, stat) {
if (er) throw er
t.ok(stat.isDirectory(), 'target is a directory');
t.end();
})
});
});

View File

@ -0,0 +1,32 @@
var mkdirp = require('../');
var path = require('path');
var fs = require('fs');
var exists = fs.exists || path.exists;
var test = require('tap').test;
var _0777 = parseInt('0777', 8);
var _0755 = parseInt('0755', 8);
test('sync', function (t) {
t.plan(4);
var x = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
var y = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
var z = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
var file = '/tmp/' + [x,y,z].join('/');
try {
mkdirp.sync(file, _0755);
} catch (err) {
t.fail(err);
return t.end();
}
exists(file, function (ex) {
t.ok(ex, 'file created');
fs.stat(file, function (err, stat) {
t.ifError(err);
t.equal(stat.mode & _0777, _0755);
t.ok(stat.isDirectory(), 'target not a directory');
});
});
});

View File

@ -0,0 +1,28 @@
var mkdirp = require('../');
var path = require('path');
var fs = require('fs');
var exists = fs.exists || path.exists;
var test = require('tap').test;
var _0777 = parseInt('0777', 8);
var _0755 = parseInt('0755', 8);
test('implicit mode from umask', function (t) {
t.plan(5);
var x = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
var y = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
var z = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
var file = '/tmp/' + [x,y,z].join('/');
mkdirp(file, function (err) {
t.ifError(err);
exists(file, function (ex) {
t.ok(ex, 'file created');
fs.stat(file, function (err, stat) {
t.ifError(err);
t.equal(stat.mode & _0777, _0777 & (~process.umask()));
t.ok(stat.isDirectory(), 'target not a directory');
});
})
});
});

View File

@ -0,0 +1,32 @@
var mkdirp = require('../');
var path = require('path');
var fs = require('fs');
var exists = fs.exists || path.exists;
var test = require('tap').test;
var _0777 = parseInt('0777', 8);
var _0755 = parseInt('0755', 8);
test('umask sync modes', function (t) {
t.plan(4);
var x = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
var y = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
var z = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
var file = '/tmp/' + [x,y,z].join('/');
try {
mkdirp.sync(file);
} catch (err) {
t.fail(err);
return t.end();
}
exists(file, function (ex) {
t.ok(ex, 'file created');
fs.stat(file, function (err, stat) {
t.ifError(err);
t.equal(stat.mode & _0777, (_0777 & (~process.umask())));
t.ok(stat.isDirectory(), 'target not a directory');
});
});
});

View File

@ -0,0 +1,6 @@
'use strict';
var ansiRegex = require('ansi-regex')();
module.exports = function (str) {
return typeof str === 'string' ? str.replace(ansiRegex, '') : str;
};

View File

@ -0,0 +1,21 @@
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.

View File

@ -0,0 +1,114 @@
{
"_args": [
[
"strip-ansi@^3.0.0",
"C:\\Users\\x2mjbyrn\\Source\\Repos\\Skeleton\\node_modules\\update-notifier\\node_modules\\chalk"
]
],
"_from": "strip-ansi@>=3.0.0-0 <4.0.0-0",
"_id": "strip-ansi@3.0.1",
"_inCache": true,
"_location": "/update-notifier/strip-ansi",
"_nodeVersion": "0.12.7",
"_npmOperationalInternal": {
"host": "packages-9-west.internal.npmjs.com",
"tmp": "tmp/strip-ansi-3.0.1.tgz_1456057278183_0.28958667791448534"
},
"_npmUser": {
"email": "jappelman@xebia.com",
"name": "jbnicolai"
},
"_npmVersion": "2.11.3",
"_phantomChildren": {},
"_requested": {
"name": "strip-ansi",
"raw": "strip-ansi@^3.0.0",
"rawSpec": "^3.0.0",
"scope": null,
"spec": ">=3.0.0-0 <4.0.0-0",
"type": "range"
},
"_requiredBy": [
"/update-notifier/chalk"
],
"_resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz",
"_shasum": "6a385fb8853d952d5ff05d0e8aaf94278dc63dcf",
"_shrinkwrap": null,
"_spec": "strip-ansi@^3.0.0",
"_where": "C:\\Users\\x2mjbyrn\\Source\\Repos\\Skeleton\\node_modules\\update-notifier\\node_modules\\chalk",
"author": {
"email": "sindresorhus@gmail.com",
"name": "Sindre Sorhus",
"url": "sindresorhus.com"
},
"bugs": {
"url": "https://github.com/chalk/strip-ansi/issues"
},
"dependencies": {
"ansi-regex": "^2.0.0"
},
"description": "Strip ANSI escape codes",
"devDependencies": {
"ava": "*",
"xo": "*"
},
"directories": {},
"dist": {
"shasum": "6a385fb8853d952d5ff05d0e8aaf94278dc63dcf",
"tarball": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz"
},
"engines": {
"node": ">=0.10.0"
},
"files": [
"index.js"
],
"gitHead": "8270705c704956da865623e564eba4875c3ea17f",
"homepage": "https://github.com/chalk/strip-ansi",
"installable": true,
"keywords": [
"256",
"ansi",
"color",
"colors",
"colour",
"command-line",
"console",
"escape",
"formatting",
"log",
"logging",
"remove",
"rgb",
"shell",
"string",
"strip",
"styles",
"terminal",
"text",
"trim",
"tty",
"xterm"
],
"license": "MIT",
"maintainers": [
{
"name": "sindresorhus",
"email": "sindresorhus@gmail.com"
},
{
"name": "jbnicolai",
"email": "jappelman@xebia.com"
}
],
"name": "strip-ansi",
"optionalDependencies": {},
"repository": {
"type": "git",
"url": "https://github.com/chalk/strip-ansi"
},
"scripts": {
"test": "xo && ava"
},
"version": "3.0.1"
}

View File

@ -0,0 +1,33 @@
# strip-ansi [![Build Status](https://travis-ci.org/chalk/strip-ansi.svg?branch=master)](https://travis-ci.org/chalk/strip-ansi)
> Strip [ANSI escape codes](http://en.wikipedia.org/wiki/ANSI_escape_code)
## Install
```
$ npm install --save strip-ansi
```
## Usage
```js
var stripAnsi = require('strip-ansi');
stripAnsi('\u001b[4mcake\u001b[0m');
//=> 'cake'
```
## Related
- [strip-ansi-cli](https://github.com/chalk/strip-ansi-cli) - CLI for this module
- [has-ansi](https://github.com/chalk/has-ansi) - Check if a string has ANSI escape codes
- [ansi-regex](https://github.com/chalk/ansi-regex) - Regular expression for matching ANSI escape codes
- [chalk](https://github.com/chalk/chalk) - Terminal string styling done right
## License
MIT © [Sindre Sorhus](http://sindresorhus.com)

View File

@ -0,0 +1,50 @@
'use strict';
var argv = process.argv;
var terminator = argv.indexOf('--');
var hasFlag = function (flag) {
flag = '--' + flag;
var pos = argv.indexOf(flag);
return pos !== -1 && (terminator !== -1 ? pos < terminator : true);
};
module.exports = (function () {
if ('FORCE_COLOR' in process.env) {
return true;
}
if (hasFlag('no-color') ||
hasFlag('no-colors') ||
hasFlag('color=false')) {
return false;
}
if (hasFlag('color') ||
hasFlag('colors') ||
hasFlag('color=true') ||
hasFlag('color=always')) {
return true;
}
if (process.stdout && !process.stdout.isTTY) {
return false;
}
if (process.platform === 'win32') {
return true;
}
if ('COLORTERM' in process.env) {
return true;
}
if (process.env.TERM === 'dumb') {
return false;
}
if (/^screen|^xterm|^vt100|color|ansi|cygwin|linux/i.test(process.env.TERM)) {
return true;
}
return false;
})();

View File

@ -0,0 +1,21 @@
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.

View File

@ -0,0 +1,104 @@
{
"_args": [
[
"supports-color@^2.0.0",
"C:\\Users\\x2mjbyrn\\Source\\Repos\\Skeleton\\node_modules\\update-notifier\\node_modules\\chalk"
]
],
"_from": "supports-color@>=2.0.0-0 <3.0.0-0",
"_id": "supports-color@2.0.0",
"_inCache": true,
"_location": "/update-notifier/supports-color",
"_nodeVersion": "0.12.5",
"_npmUser": {
"email": "sindresorhus@gmail.com",
"name": "sindresorhus"
},
"_npmVersion": "2.11.2",
"_phantomChildren": {},
"_requested": {
"name": "supports-color",
"raw": "supports-color@^2.0.0",
"rawSpec": "^2.0.0",
"scope": null,
"spec": ">=2.0.0-0 <3.0.0-0",
"type": "range"
},
"_requiredBy": [
"/update-notifier/chalk"
],
"_resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz",
"_shasum": "535d045ce6b6363fa40117084629995e9df324c7",
"_shrinkwrap": null,
"_spec": "supports-color@^2.0.0",
"_where": "C:\\Users\\x2mjbyrn\\Source\\Repos\\Skeleton\\node_modules\\update-notifier\\node_modules\\chalk",
"author": {
"email": "sindresorhus@gmail.com",
"name": "Sindre Sorhus",
"url": "sindresorhus.com"
},
"bugs": {
"url": "https://github.com/chalk/supports-color/issues"
},
"dependencies": {},
"description": "Detect whether a terminal supports color",
"devDependencies": {
"mocha": "*",
"require-uncached": "^1.0.2"
},
"directories": {},
"dist": {
"shasum": "535d045ce6b6363fa40117084629995e9df324c7",
"tarball": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz"
},
"engines": {
"node": ">=0.8.0"
},
"files": [
"index.js"
],
"gitHead": "8400d98ade32b2adffd50902c06d9e725a5c6588",
"homepage": "https://github.com/chalk/supports-color",
"installable": true,
"keywords": [
"256",
"ansi",
"capability",
"cli",
"color",
"colors",
"colour",
"command-line",
"console",
"detect",
"rgb",
"shell",
"styles",
"support",
"supports",
"terminal",
"tty",
"xterm"
],
"license": "MIT",
"maintainers": [
{
"name": "sindresorhus",
"email": "sindresorhus@gmail.com"
},
{
"name": "jbnicolai",
"email": "jappelman@xebia.com"
}
],
"name": "supports-color",
"optionalDependencies": {},
"repository": {
"type": "git",
"url": "https://github.com/chalk/supports-color"
},
"scripts": {
"test": "mocha"
},
"version": "2.0.0"
}

View File

@ -0,0 +1,36 @@
# supports-color [![Build Status](https://travis-ci.org/chalk/supports-color.svg?branch=master)](https://travis-ci.org/chalk/supports-color)
> Detect whether a terminal supports color
## Install
```
$ npm install --save supports-color
```
## Usage
```js
var supportsColor = require('supports-color');
if (supportsColor) {
console.log('Terminal supports color');
}
```
It obeys the `--color` and `--no-color` CLI flags.
For situations where using `--color` is not possible, add an environment variable `FORCE_COLOR` with any value to force color. Trumps `--no-color`.
## Related
- [supports-color-cli](https://github.com/chalk/supports-color-cli) - CLI for this module
- [chalk](https://github.com/chalk/chalk) - Terminal string styling done right
## License
MIT © [Sindre Sorhus](http://sindresorhus.com)

127
node_modules/update-notifier/package.json generated vendored Normal file
View File

@ -0,0 +1,127 @@
{
"_args": [
[
"update-notifier@^0.6.0",
"C:\\Users\\x2mjbyrn\\Source\\Repos\\Skeleton\\node_modules\\typings"
]
],
"_from": "update-notifier@>=0.6.0-0 <0.7.0-0",
"_id": "update-notifier@0.6.3",
"_inCache": true,
"_location": "/update-notifier",
"_nodeVersion": "5.2.0",
"_npmOperationalInternal": {
"host": "packages-12-west.internal.npmjs.com",
"tmp": "tmp/update-notifier-0.6.3.tgz_1458188611750_0.477853721473366"
},
"_npmUser": {
"email": "admin@simonboudrias.com",
"name": "sboudrias"
},
"_npmVersion": "3.5.3",
"_phantomChildren": {
"escape-string-regexp": "1.0.5"
},
"_requested": {
"name": "update-notifier",
"raw": "update-notifier@^0.6.0",
"rawSpec": "^0.6.0",
"scope": null,
"spec": ">=0.6.0-0 <0.7.0-0",
"type": "range"
},
"_requiredBy": [
"/typings"
],
"_resolved": "https://registry.npmjs.org/update-notifier/-/update-notifier-0.6.3.tgz",
"_shasum": "776dec8daa13e962a341e8a1d98354306b67ae08",
"_shrinkwrap": null,
"_spec": "update-notifier@^0.6.0",
"_where": "C:\\Users\\x2mjbyrn\\Source\\Repos\\Skeleton\\node_modules\\typings",
"author": {
"email": "sindresorhus@gmail.com",
"name": "Sindre Sorhus",
"url": "sindresorhus.com"
},
"bugs": {
"url": "https://github.com/yeoman/update-notifier/issues"
},
"dependencies": {
"boxen": "^0.3.1",
"chalk": "^1.0.0",
"configstore": "^2.0.0",
"is-npm": "^1.0.0",
"latest-version": "^2.0.0",
"semver-diff": "^2.0.0"
},
"description": "Update notifications for your CLI app",
"devDependencies": {
"mocha": "*",
"xo": "*"
},
"directories": {},
"dist": {
"shasum": "776dec8daa13e962a341e8a1d98354306b67ae08",
"tarball": "https://registry.npmjs.org/update-notifier/-/update-notifier-0.6.3.tgz"
},
"engines": {
"node": ">=0.10.0"
},
"files": [
"check.js",
"index.js"
],
"gitHead": "4896088fe3c03e69ad462e9b27c67abc94e9e8e7",
"homepage": "https://github.com/yeoman/update-notifier#readme",
"installable": true,
"keywords": [
"check",
"checker",
"cli",
"module",
"notifier",
"notify",
"npm",
"package",
"update",
"updater",
"version"
],
"license": "BSD-2-Clause",
"maintainers": [
{
"name": "sindresorhus",
"email": "sindresorhus@gmail.com"
},
{
"name": "addyosmani",
"email": "addyosmani@gmail.com"
},
{
"name": "passy",
"email": "phartig@rdrei.net"
},
{
"name": "sboudrias",
"email": "admin@simonboudrias.com"
},
{
"name": "eddiemonge",
"email": "eddie+npm@eddiemonge.com"
},
{
"name": "arthurvr",
"email": "contact@arthurverschaeve.be"
}
],
"name": "update-notifier",
"optionalDependencies": {},
"repository": {
"type": "git",
"url": "git+https://github.com/yeoman/update-notifier.git"
},
"scripts": {
"test": "xo && mocha --timeout 20000"
},
"version": "0.6.3"
}

149
node_modules/update-notifier/readme.md generated vendored Normal file
View File

@ -0,0 +1,149 @@
# update-notifier [![Build Status](https://travis-ci.org/yeoman/update-notifier.svg?branch=master)](https://travis-ci.org/yeoman/update-notifier)
> Update notifications for your CLI app
![](screenshot.png)
Inform users of your package of updates in a non-intrusive way.
#### Table of Contents
- [Examples](#examples)
- [How](#how)
- [API](#api)
- [About](#about)
## Examples
### Simple example
```js
const updateNotifier = require('update-notifier');
const pkg = require('./package.json');
updateNotifier({pkg}).notify();
```
### Comprehensive example
```js
const updateNotifier = require('update-notifier');
const pkg = require('./package.json');
// Checks for available update and returns an instance
const notifier = updateNotifier({pkg});
// Notify using the built-in convenience method
notifier.notify();
// `notifier.update` contains some useful info about the update
console.log(notifier.update);
/*
{
latest: '1.0.1',
current: '1.0.0',
type: 'patch', // possible values: latest, major, minor, patch, prerelease, build
name: 'pageres'
}
*/
```
### Example with settings and custom message
```js
const notifier = updateNotifier({
pkg,
updateCheckInterval: 1000 * 60 * 60 * 24 * 7 // 1 week
});
console.log(`Update available: ${notifier.update.latest}`);
```
## How
Whenever you initiate the update notifier and it's not within the interval threshold, it will asynchronously check with npm in the background for available updates, then persist the result. The next time the notifier is initiated the result will be loaded into the `.update` property. This prevents any impact on your package startup performance.
The check process is done in a unref'ed [child process](http://nodejs.org/api/child_process.html#child_process_child_process_spawn_command_args_options). This means that if you call `process.exit`, the check will still be performed in its own process.
## API
### updateNotifier(options)
Checks if there is an available update. Accepts settings defined below. Returns an object with update info if there is an available update, otherwise `undefined`.
### options
#### pkg
Type: `object`
##### name
*Required*
Type: `string`
##### version
*Required*
Type: `string`
#### updateCheckInterval
Type: `number`
Default: 1000 * 60 * 60 * 24 (1 day)
How often to check for updates.
#### callback(error, update)
Type: `function`
Passing a callback here will make it check for an update directly and report right away. Not recommended as you won't get the benefits explained in [`How`](#how).
`update` is equal to `notifier.update`
### updateNotifier.notify([options])
Convenience method to display a notification message *(see screenshot)*.
Only notifies if there is an update and the process is [TTY](http://nodejs.org/api/tty.html).
#### options.defer
Type: `boolean`
Default: `true`
Defer showing the notification to after the process has exited.
### User settings
Users of your module have the ability to opt-out of the update notifier by changing the `optOut` property to `true` in `~/.config/configstore/update-notifier-[your-module-name].yml`. The path is available in `notifier.config.path`.
Users can also opt-out by [setting the environment variable](https://github.com/sindresorhus/guides/blob/master/set-environment-variables.md) `NO_UPDATE_NOTIFIER` with any value or by using the `--no-update-notifier` flag on a per run basis.
## About
The idea for this module came from the desire to apply the browser update strategy to CLI tools, where everyone is always on the latest version. We first tried automatic updating, which we discovered wasn't popular. This is the second iteration of that idea, but limited to just update notifications.
There are a bunch projects using it:
- [Yeoman](http://yeoman.io) - Modern workflows for modern webapps
- [AVA](https://github.com/sindresorhus/ava) - Simple concurrent test runner
- [XO](https://github.com/sindresorhus/xo) - JavaScript happiness style linter
- [Pageres](https://github.com/sindresorhus/pageres) - Capture website screenshots
- [Node GH](http://nodegh.io) - GitHub command line tool
- [Bower](http://bower.io) - A package manager for the web
- [Hoodie CLI](http://hood.ie) - Hoodie command line tool
- [Roots](http://roots.cx) - A toolkit for advanced front-end development
[And 600+ more...](https://www.npmjs.org/browse/depended/update-notifier)
## License
[BSD license](http://opensource.org/licenses/bsd-license.php) and copyright Google