nyc 10.3.2-candidate.0 → 10.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/node_modules/align-text/package.json +4 -3
- package/node_modules/amdefine/package.json +4 -3
- package/node_modules/ansi-regex/package.json +15 -7
- package/node_modules/ansi-styles/package.json +12 -5
- package/node_modules/append-transform/package.json +4 -3
- package/node_modules/archy/package.json +5 -4
- package/node_modules/arr-diff/package.json +4 -3
- package/node_modules/arr-flatten/package.json +4 -3
- package/node_modules/array-unique/package.json +4 -3
- package/node_modules/arrify/package.json +4 -3
- package/node_modules/async/package.json +4 -3
- package/node_modules/babel-code-frame/package.json +4 -3
- package/node_modules/babel-generator/package.json +4 -3
- package/node_modules/babel-messages/package.json +4 -3
- package/node_modules/babel-runtime/package.json +4 -3
- package/node_modules/babel-template/package.json +4 -3
- package/node_modules/babel-traverse/package.json +4 -3
- package/node_modules/babel-types/package.json +4 -3
- package/node_modules/babylon/package.json +4 -3
- package/node_modules/balanced-match/package.json +4 -3
- package/node_modules/brace-expansion/package.json +4 -3
- package/node_modules/braces/package.json +4 -3
- package/node_modules/builtin-modules/package.json +4 -3
- package/node_modules/caching-transform/package.json +4 -3
- package/node_modules/camelcase/package.json +5 -4
- package/node_modules/center-align/package.json +4 -3
- package/node_modules/chalk/package.json +13 -9
- package/node_modules/cliui/node_modules/wordwrap/package.json +4 -3
- package/node_modules/cliui/package.json +5 -4
- package/node_modules/code-point-at/package.json +4 -3
- package/node_modules/commondir/package.json +5 -4
- package/node_modules/concat-map/package.json +5 -4
- package/node_modules/convert-source-map/package.json +4 -3
- package/node_modules/core-js/package.json +2 -2
- package/node_modules/cross-spawn/package.json +4 -3
- package/node_modules/debug/package.json +4 -3
- package/node_modules/debug-log/package.json +4 -3
- package/node_modules/decamelize/package.json +4 -3
- package/node_modules/default-require-extensions/package.json +4 -3
- package/node_modules/detect-indent/package.json +5 -4
- package/node_modules/error-ex/package.json +10 -7
- package/node_modules/escape-string-regexp/package.json +11 -8
- package/node_modules/esutils/package.json +7 -9
- package/node_modules/expand-brackets/package.json +4 -3
- package/node_modules/expand-range/package.json +4 -3
- package/node_modules/extglob/package.json +4 -3
- package/node_modules/filename-regex/package.json +4 -3
- package/node_modules/fill-range/package.json +4 -3
- package/node_modules/find-cache-dir/package.json +4 -3
- package/node_modules/find-up/package.json +5 -4
- package/node_modules/for-in/package.json +4 -3
- package/node_modules/for-own/package.json +4 -3
- package/node_modules/foreground-child/package.json +4 -3
- package/node_modules/fs.realpath/package.json +4 -3
- package/node_modules/get-caller-file/package.json +5 -4
- package/node_modules/glob/package.json +4 -3
- package/node_modules/glob-base/package.json +4 -3
- package/node_modules/glob-parent/package.json +4 -3
- package/node_modules/globals/package.json +4 -3
- package/node_modules/graceful-fs/package.json +4 -3
- package/node_modules/handlebars/node_modules/source-map/package.json +4 -3
- package/node_modules/handlebars/package.json +4 -3
- package/node_modules/has-ansi/package.json +11 -8
- package/node_modules/has-flag/package.json +4 -3
- package/node_modules/hosted-git-info/package.json +4 -3
- package/node_modules/imurmurhash/package.json +2 -2
- package/node_modules/inflight/package.json +4 -3
- package/node_modules/inherits/package.json +4 -3
- package/node_modules/invariant/package.json +4 -3
- package/node_modules/invert-kv/package.json +5 -4
- package/node_modules/is-arrayish/package.json +4 -3
- package/node_modules/is-buffer/package.json +4 -3
- package/node_modules/is-builtin-module/package.json +5 -4
- package/node_modules/is-dotfile/package.json +4 -3
- package/node_modules/is-equal-shallow/package.json +4 -3
- package/node_modules/is-extendable/package.json +4 -3
- package/node_modules/is-extglob/package.json +4 -3
- package/node_modules/is-finite/package.json +4 -3
- package/node_modules/is-fullwidth-code-point/package.json +5 -4
- package/node_modules/is-glob/package.json +5 -4
- package/node_modules/is-number/package.json +4 -3
- package/node_modules/is-posix-bracket/package.json +4 -3
- package/node_modules/is-primitive/package.json +4 -3
- package/node_modules/is-utf8/package.json +4 -3
- package/node_modules/isarray/package.json +4 -3
- package/node_modules/isexe/package.json +4 -3
- package/node_modules/isobject/package.json +4 -3
- package/node_modules/istanbul-lib-coverage/package.json +4 -3
- package/node_modules/istanbul-lib-hook/package.json +4 -3
- package/node_modules/istanbul-lib-instrument/package.json +4 -3
- package/node_modules/istanbul-lib-report/node_modules/supports-color/package.json +15 -7
- package/node_modules/istanbul-lib-report/package.json +4 -3
- package/node_modules/istanbul-lib-source-maps/package.json +4 -3
- package/node_modules/istanbul-reports/package.json +4 -3
- package/node_modules/js-tokens/package.json +4 -3
- package/node_modules/jsesc/package.json +2 -2
- package/node_modules/kind-of/package.json +4 -3
- package/node_modules/lazy-cache/package.json +4 -3
- package/node_modules/lcid/package.json +5 -4
- package/node_modules/load-json-file/package.json +5 -4
- package/node_modules/lodash/package.json +4 -3
- package/node_modules/longest/package.json +4 -3
- package/node_modules/loose-envify/package.json +4 -3
- package/node_modules/lru-cache/package.json +4 -3
- package/node_modules/md5-hex/package.json +4 -3
- package/node_modules/md5-o-matic/package.json +4 -3
- package/node_modules/merge-source-map/package.json +4 -3
- package/node_modules/micromatch/package.json +4 -3
- package/node_modules/minimatch/package.json +4 -3
- package/node_modules/minimist/package.json +4 -3
- package/node_modules/mkdirp/package.json +4 -3
- package/node_modules/ms/package.json +4 -3
- package/node_modules/normalize-package-data/package.json +4 -3
- package/node_modules/normalize-path/package.json +4 -3
- package/node_modules/number-is-nan/package.json +4 -3
- package/node_modules/object-assign/package.json +4 -3
- package/node_modules/object.omit/package.json +4 -3
- package/node_modules/once/package.json +4 -3
- package/node_modules/optimist/package.json +5 -4
- package/node_modules/os-homedir/package.json +4 -3
- package/node_modules/os-locale/package.json +5 -4
- package/node_modules/parse-glob/package.json +4 -3
- package/node_modules/parse-json/package.json +5 -4
- package/node_modules/path-exists/package.json +5 -4
- package/node_modules/path-is-absolute/package.json +4 -3
- package/node_modules/path-parse/package.json +4 -3
- package/node_modules/path-type/package.json +5 -4
- package/node_modules/pify/package.json +5 -4
- package/node_modules/pinkie/package.json +5 -4
- package/node_modules/pinkie-promise/package.json +5 -4
- package/node_modules/pkg-dir/package.json +5 -4
- package/node_modules/preserve/package.json +4 -3
- package/node_modules/pseudomap/package.json +4 -3
- package/node_modules/randomatic/package.json +4 -3
- package/node_modules/read-pkg/package.json +5 -4
- package/node_modules/read-pkg-up/package.json +5 -4
- package/node_modules/regenerator-runtime/package.json +4 -3
- package/node_modules/regex-cache/package.json +4 -3
- package/node_modules/remove-trailing-separator/package.json +4 -3
- package/node_modules/repeat-element/package.json +4 -3
- package/node_modules/repeat-string/package.json +4 -3
- package/node_modules/repeating/package.json +4 -3
- package/node_modules/require-directory/package.json +4 -3
- package/node_modules/require-main-filename/package.json +4 -3
- package/node_modules/resolve-from/package.json +5 -4
- package/node_modules/right-align/package.json +4 -3
- package/node_modules/rimraf/package.json +4 -3
- package/node_modules/semver/package.json +4 -3
- package/node_modules/set-blocking/package.json +4 -3
- package/node_modules/signal-exit/package.json +4 -3
- package/node_modules/slide/package.json +5 -4
- package/node_modules/source-map/package.json +4 -3
- package/node_modules/spawn-wrap/node_modules/signal-exit/package.json +4 -3
- package/node_modules/spawn-wrap/package.json +4 -3
- package/node_modules/spdx-correct/package.json +4 -3
- package/node_modules/spdx-expression-parse/package.json +4 -3
- package/node_modules/spdx-license-ids/package.json +4 -3
- package/node_modules/string-width/package.json +4 -3
- package/node_modules/strip-ansi/package.json +16 -8
- package/node_modules/strip-bom/package.json +5 -4
- package/node_modules/supports-color/package.json +11 -8
- package/node_modules/test-exclude/package.json +4 -3
- package/node_modules/to-fast-properties/package.json +4 -3
- package/node_modules/trim-right/package.json +5 -4
- package/node_modules/uglify-js/node_modules/yargs/package.json +4 -3
- package/node_modules/uglify-js/package.json +7 -13
- package/node_modules/uglify-to-browserify/package.json +5 -4
- package/node_modules/validate-npm-package-license/package.json +4 -3
- package/node_modules/which/package.json +4 -3
- package/node_modules/which-module/package.json +4 -3
- package/node_modules/window-size/package.json +4 -3
- package/node_modules/wordwrap/package.json +4 -3
- package/node_modules/wrap-ansi/package.json +16 -11
- package/node_modules/wrappy/package.json +4 -3
- package/node_modules/write-file-atomic/package.json +4 -3
- package/node_modules/y18n/package.json +4 -3
- package/node_modules/yallist/package.json +4 -3
- package/node_modules/yargs/node_modules/camelcase/package.json +4 -3
- package/node_modules/yargs/node_modules/cliui/package.json +4 -3
- package/node_modules/yargs/package.json +4 -3
- package/node_modules/yargs-parser/node_modules/camelcase/package.json +4 -3
- package/node_modules/yargs-parser/package.json +4 -3
- package/package.json +1 -1
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
"spec": ">=0.1.3 <0.2.0",
|
|
11
11
|
"type": "range"
|
|
12
12
|
},
|
|
13
|
-
"/Users/benjamincoe/
|
|
13
|
+
"/Users/benjamincoe/oss/nyc/node_modules/center-align"
|
|
14
14
|
]
|
|
15
15
|
],
|
|
16
16
|
"_from": "align-text@>=0.1.3 <0.2.0",
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
"_shasum": "0cd90a561093f35d0a99256c22b7069433fad117",
|
|
46
46
|
"_shrinkwrap": null,
|
|
47
47
|
"_spec": "align-text@^0.1.3",
|
|
48
|
-
"_where": "/Users/benjamincoe/
|
|
48
|
+
"_where": "/Users/benjamincoe/oss/nyc/node_modules/center-align",
|
|
49
49
|
"author": {
|
|
50
50
|
"name": "Jon Schlinkert",
|
|
51
51
|
"url": "https://github.com/jonschlinkert"
|
|
@@ -105,7 +105,8 @@
|
|
|
105
105
|
],
|
|
106
106
|
"name": "align-text",
|
|
107
107
|
"optionalDependencies": {},
|
|
108
|
-
"readme": "
|
|
108
|
+
"readme": "# align-text [](http://badge.fury.io/js/align-text) [](https://travis-ci.org/jonschlinkert/align-text)\n\n> Align the text in a string.\n\n**Examples**\n\nAlign text values in an array:\n\n```js\nalign([1, 2, 3, 100]);\n//=> [' 1', ' 2', ' 3', '100']\n```\n\nOr [do stuff like this](./example.js):\n\n[](./example.js)\n\nVisit [the example](./example.js) to see how this works.\n\n## Install\n\nInstall with [npm](https://www.npmjs.com/)\n\n```sh\n$ npm i align-text --save\n```\n\n## Usage\n\n```js\nvar align = require('align-text');\nalign(text, callback_function_or_integer);\n```\n\n**Params**\n\n* `text` can be a **string or array**. If a string is passed, a string will be returned. If an array is passed, an array will be returned.\n* `callback|integer`: if an integer, the text will be indented by that amount. If a function, it must return an integer representing the amount of leading indentation to use as `align` loops over each line.\n\n**Example**\n\n```js\nalign(text, 4);\n```\n\nWould align:\n\n```\nabc\nabc\nabc\n```\n\nTo:\n\n```\n abc\n abc\n abc\n```\n\n## callback\n\n### params\n\nThe callback is used to determine the indentation of each line and gets the following params:\n\n* `len` the length of the \"current\" line\n* `longest` the length of the longest line\n* `line` the current line (string) being aligned\n* `lines` the array of all lines\n\n### return\n\nThe callback may return:\n\n* an integer that represents the number of spaces to use for padding,\n* or an object with the following properties:\n - `indent`: **{Number}** the amount of indentation to use. Default is `0` when an object is returned.\n - `character`: **{String}** the character to use for indentation. Default is `''` (empty string) when an object is returned.\n - `prefix`: **{String}** leading characters to use at the beginning of each line. `''` (empty string) when an object is returned.\n\n**Integer example:**\n\n```js\n// calculate half the difference between the length\n// of the current line and the longest line\nfunction centerAlign(len, longest, line, lines) {\n return Math.floor((longest - len) / 2);\n}\n```\n\n**Object example:**\n\n```js\nfunction centerAlign(len, longest, line, lines) {\n return {\n character: '\\t',\n indent: Math.floor((longest - len) / 2),\n prefix: '~ ',\n }\n}\n```\n\n## Usage examples\n\n### Center align\n\nUsing the `centerAlign` function from above:\n\n```js\nalign(text, centerAlign);\n```\n\nWould align this text:\n\n```js\nLorem ipsum dolor sit amet\nconsectetur adipiscin\nelit, sed do eiusmod tempor incididun\nut labore et dolor\nmagna aliqua. Ut enim ad mini\nveniam, quis\n```\n\nResulting in this:\n\n```\n Lorem ipsum dolor sit amet,\n consectetur adipiscing\nelit, sed do eiusmod tempor incididunt\n ut labore et dolore\n magna aliqua. Ut enim ad minim\n veniam, quis\n```\n\n**Customize**\n\nIf you wanted to add more padding on the left, just pass the number in the callback.\n\nFor example, to add 4 spaces before every line:\n\n```js\nfunction centerAlign(len, longest, line, lines) {\n return 4 + Math.floor((longest - len) / 2);\n}\n```\n\nWould result in:\n\n```\n Lorem ipsum dolor sit amet,\n consectetur adipiscing\n elit, sed do eiusmod tempor incididunt\n ut labore et dolore\n magna aliqua. Ut enim ad minim\n veniam, quis\n```\n\n### Bullets\n\n```js\nalign(text, function (len, max, line, lines) {\n return {prefix: ' - '};\n});\n```\n\nWould return:\n\n```\n- Lorem ipsum dolor sit amet,\n- consectetur adipiscing\n- elit, sed do eiusmod tempor incididunt\n- ut labore et dolore\n- magna aliqua. Ut enim ad minim\n- veniam, quis\n```\n\n### Different indent character\n\n```js\nalign(text, function (len, max, line, lines) {\n return { \n indent: Math.floor((max - len) / 2), \n character: '~', \n };\n});\n```\n\nWould return\n\n```\n~~~~~Lorem ipsum dolor sit amet,\n~~~~~~~~consectetur adipiscing\nelit, sed do eiusmod tempor incididunt\n~~~~~~~~~ut labore et dolore\n~~~~magna aliqua. Ut enim ad minim\n~~~~~~~~~~~~~veniam, quis\n```\n\n## Related projects\n\n* [center-align](https://github.com/jonschlinkert/center-align): Center-align the text in a string.\n* [justify](https://github.com/bahamas10/node-justify): Left or right (or both) justify text using a custom width and character\n* [longest](https://github.com/jonschlinkert/longest): Get the longest item in an array.\n* [right-align](https://github.com/jonschlinkert/right-align): Right-align the text in a string.\n* [repeat-string](https://github.com/jonschlinkert/repeat-string): Repeat the given string n times. Fastest implementation for repeating a string.\n* [word-wrap](https://github.com/jonschlinkert/word-wrap): Wrap words to a specified length.\n\n## Running tests\n\nInstall dev dependencies:\n\n```sh\n$ npm i -d && npm test\n```\n\n## Contributing\n\nPull requests and stars are always welcome. For bugs and feature requests, [please create an issue](https://github.com/jonschlinkert/align-text/issues/new)\n\n## Author\n\n**Jon Schlinkert**\n\n+ [github/jonschlinkert](https://github.com/jonschlinkert)\n+ [twitter/jonschlinkert](http://twitter.com/jonschlinkert)\n\n## License\n\nCopyright © 2015 [Jon Schlinkert](https://github.com/jonschlinkert)\nReleased under the MIT license.\n\n***\n\n_This file was generated by [verb-cli](https://github.com/assemble/verb-cli) on June 09, 2015._\n",
|
|
109
|
+
"readmeFilename": "README.md",
|
|
109
110
|
"repository": {
|
|
110
111
|
"type": "git",
|
|
111
112
|
"url": "git://github.com/jonschlinkert/align-text.git"
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
"spec": ">=0.0.4",
|
|
11
11
|
"type": "range"
|
|
12
12
|
},
|
|
13
|
-
"/Users/benjamincoe/
|
|
13
|
+
"/Users/benjamincoe/oss/nyc/node_modules/handlebars/node_modules/source-map"
|
|
14
14
|
]
|
|
15
15
|
],
|
|
16
16
|
"_from": "amdefine@>=0.0.4",
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
"_shasum": "4a5282ac164729e93619bcfd3ad151f817ce91f5",
|
|
45
45
|
"_shrinkwrap": null,
|
|
46
46
|
"_spec": "amdefine@>=0.0.4",
|
|
47
|
-
"_where": "/Users/benjamincoe/
|
|
47
|
+
"_where": "/Users/benjamincoe/oss/nyc/node_modules/handlebars/node_modules/source-map",
|
|
48
48
|
"author": {
|
|
49
49
|
"name": "James Burke",
|
|
50
50
|
"email": "jrburke@gmail.com",
|
|
@@ -76,7 +76,8 @@
|
|
|
76
76
|
],
|
|
77
77
|
"name": "amdefine",
|
|
78
78
|
"optionalDependencies": {},
|
|
79
|
-
"readme": "
|
|
79
|
+
"readme": "# amdefine\n\nA module that can be used to implement AMD's define() in Node. This allows you\nto code to the AMD API and have the module work in node programs without\nrequiring those other programs to use AMD.\n\n## Usage\n\n**1)** Update your package.json to indicate amdefine as a dependency:\n\n```javascript\n \"dependencies\": {\n \"amdefine\": \">=0.1.0\"\n }\n```\n\nThen run `npm install` to get amdefine into your project.\n\n**2)** At the top of each module that uses define(), place this code:\n\n```javascript\nif (typeof define !== 'function') { var define = require('amdefine')(module) }\n```\n\n**Only use these snippets** when loading amdefine. If you preserve the basic structure,\nwith the braces, it will be stripped out when using the [RequireJS optimizer](#optimizer).\n\nYou can add spaces, line breaks and even require amdefine with a local path, but\nkeep the rest of the structure to get the stripping behavior.\n\nAs you may know, because `if` statements in JavaScript don't have their own scope, the var\ndeclaration in the above snippet is made whether the `if` expression is truthy or not. If\nRequireJS is loaded then the declaration is superfluous because `define` is already already\ndeclared in the same scope in RequireJS. Fortunately JavaScript handles multiple `var`\ndeclarations of the same variable in the same scope gracefully.\n\nIf you want to deliver amdefine.js with your code rather than specifying it as a dependency\nwith npm, then just download the latest release and refer to it using a relative path:\n\n[Latest Version](https://github.com/jrburke/amdefine/raw/latest/amdefine.js)\n\n### amdefine/intercept\n\nConsider this very experimental.\n\nInstead of pasting the piece of text for the amdefine setup of a `define`\nvariable in each module you create or consume, you can use `amdefine/intercept`\ninstead. It will automatically insert the above snippet in each .js file loaded\nby Node.\n\n**Warning**: you should only use this if you are creating an application that\nis consuming AMD style defined()'d modules that are distributed via npm and want\nto run that code in Node.\n\nFor library code where you are not sure if it will be used by others in Node or\nin the browser, then explicitly depending on amdefine and placing the code\nsnippet above is suggested path, instead of using `amdefine/intercept`. The\nintercept module affects all .js files loaded in the Node app, and it is\ninconsiderate to modify global state like that unless you are also controlling\nthe top level app.\n\n#### Why distribute AMD-style modules via npm?\n\nnpm has a lot of weaknesses for front-end use (installed layout is not great,\nshould have better support for the `baseUrl + moduleID + '.js' style of loading,\nsingle file JS installs), but some people want a JS package manager and are\nwilling to live with those constraints. If that is you, but still want to author\nin AMD style modules to get dynamic require([]), better direct source usage and\npowerful loader plugin support in the browser, then this tool can help.\n\n#### amdefine/intercept usage\n\nJust require it in your top level app module (for example index.js, server.js):\n\n```javascript\nrequire('amdefine/intercept');\n```\n\nThe module does not return a value, so no need to assign the result to a local\nvariable.\n\nThen just require() code as you normally would with Node's require(). Any .js\nloaded after the intercept require will have the amdefine check injected in\nthe .js source as it is loaded. It does not modify the source on disk, just\nprepends some content to the text of the module as it is loaded by Node.\n\n#### How amdefine/intercept works\n\nIt overrides the `Module._extensions['.js']` in Node to automatically prepend\nthe amdefine snippet above. So, it will affect any .js file loaded by your\napp.\n\n## define() usage\n\nIt is best if you use the anonymous forms of define() in your module:\n\n```javascript\ndefine(function (require) {\n var dependency = require('dependency');\n});\n```\n\nor\n\n```javascript\ndefine(['dependency'], function (dependency) {\n\n});\n```\n\n## RequireJS optimizer integration. <a name=\"optimizer\"></name>\n\nVersion 1.0.3 of the [RequireJS optimizer](http://requirejs.org/docs/optimization.html)\nwill have support for stripping the `if (typeof define !== 'function')` check\nmentioned above, so you can include this snippet for code that runs in the\nbrowser, but avoid taking the cost of the if() statement once the code is\noptimized for deployment.\n\n## Node 0.4 Support\n\nIf you want to support Node 0.4, then add `require` as the second parameter to amdefine:\n\n```javascript\n//Only if you want Node 0.4. If using 0.5 or later, use the above snippet.\nif (typeof define !== 'function') { var define = require('amdefine')(module, require) }\n```\n\n## Limitations\n\n### Synchronous vs Asynchronous\n\namdefine creates a define() function that is callable by your code. It will\nexecute and trace dependencies and call the factory function *synchronously*,\nto keep the behavior in line with Node's synchronous dependency tracing.\n\nThe exception: calling AMD's callback-style require() from inside a factory\nfunction. The require callback is called on process.nextTick():\n\n```javascript\ndefine(function (require) {\n require(['a'], function(a) {\n //'a' is loaded synchronously, but\n //this callback is called on process.nextTick().\n });\n});\n```\n\n### Loader Plugins\n\nLoader plugins are supported as long as they call their load() callbacks\nsynchronously. So ones that do network requests will not work. However plugins\nlike [text](http://requirejs.org/docs/api.html#text) can load text files locally.\n\nThe plugin API's `load.fromText()` is **not supported** in amdefine, so this means\ntranspiler plugins like the [CoffeeScript loader plugin](https://github.com/jrburke/require-cs)\nwill not work. This may be fixable, but it is a bit complex, and I do not have\nenough node-fu to figure it out yet. See the source for amdefine.js if you want\nto get an idea of the issues involved.\n\n## Tests\n\nTo run the tests, cd to **tests** and run:\n\n```\nnode all.js\nnode all-intercept.js\n```\n\n## License\n\nNew BSD and MIT. Check the LICENSE file for all the details.\n",
|
|
80
|
+
"readmeFilename": "README.md",
|
|
80
81
|
"repository": {
|
|
81
82
|
"type": "git",
|
|
82
83
|
"url": "git+https://github.com/jrburke/amdefine.git"
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
"spec": ">=2.0.0 <3.0.0",
|
|
11
11
|
"type": "range"
|
|
12
12
|
},
|
|
13
|
-
"/Users/benjamincoe/
|
|
13
|
+
"/Users/benjamincoe/oss/nyc/node_modules/has-ansi"
|
|
14
14
|
]
|
|
15
15
|
],
|
|
16
16
|
"_from": "ansi-regex@>=2.0.0 <3.0.0",
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
"_shasum": "c3b33ab5ee360d86e0e628f0468ae7ef27d654df",
|
|
46
46
|
"_shrinkwrap": null,
|
|
47
47
|
"_spec": "ansi-regex@^2.0.0",
|
|
48
|
-
"_where": "/Users/benjamincoe/
|
|
48
|
+
"_where": "/Users/benjamincoe/oss/nyc/node_modules/has-ansi",
|
|
49
49
|
"author": {
|
|
50
50
|
"name": "Sindre Sorhus",
|
|
51
51
|
"email": "sindresorhus@gmail.com",
|
|
@@ -103,17 +103,25 @@
|
|
|
103
103
|
"license": "MIT",
|
|
104
104
|
"maintainers": [
|
|
105
105
|
{
|
|
106
|
-
"name": "
|
|
107
|
-
"email": "
|
|
106
|
+
"name": "Sindre Sorhus",
|
|
107
|
+
"email": "sindresorhus@gmail.com",
|
|
108
|
+
"url": "sindresorhus.com"
|
|
108
109
|
},
|
|
109
110
|
{
|
|
110
|
-
"name": "
|
|
111
|
-
"email": "
|
|
111
|
+
"name": "Joshua Appelman",
|
|
112
|
+
"email": "jappelman@xebia.com",
|
|
113
|
+
"url": "jbnicolai.com"
|
|
114
|
+
},
|
|
115
|
+
{
|
|
116
|
+
"name": "JD Ballard",
|
|
117
|
+
"email": "i.am.qix@gmail.com",
|
|
118
|
+
"url": "github.com/qix-"
|
|
112
119
|
}
|
|
113
120
|
],
|
|
114
121
|
"name": "ansi-regex",
|
|
115
122
|
"optionalDependencies": {},
|
|
116
|
-
"readme": "
|
|
123
|
+
"readme": "# ansi-regex [](https://travis-ci.org/chalk/ansi-regex)\n\n> Regular expression for matching [ANSI escape codes](http://en.wikipedia.org/wiki/ANSI_escape_code)\n\n\n## Install\n\n```\n$ npm install --save ansi-regex\n```\n\n\n## Usage\n\n```js\nconst ansiRegex = require('ansi-regex');\n\nansiRegex().test('\\u001b[4mcake\\u001b[0m');\n//=> true\n\nansiRegex().test('cake');\n//=> false\n\n'\\u001b[4mcake\\u001b[0m'.match(ansiRegex());\n//=> ['\\u001b[4m', '\\u001b[0m']\n```\n\n## FAQ\n\n### Why do you test for codes not in the ECMA 48 standard?\n\nSome 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.\n\nOn 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.\n\n\n## License\n\nMIT © [Sindre Sorhus](http://sindresorhus.com)\n",
|
|
124
|
+
"readmeFilename": "readme.md",
|
|
117
125
|
"repository": {
|
|
118
126
|
"type": "git",
|
|
119
127
|
"url": "git+https://github.com/chalk/ansi-regex.git"
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
"spec": ">=2.2.1 <3.0.0",
|
|
11
11
|
"type": "range"
|
|
12
12
|
},
|
|
13
|
-
"/Users/benjamincoe/
|
|
13
|
+
"/Users/benjamincoe/oss/nyc/node_modules/chalk"
|
|
14
14
|
]
|
|
15
15
|
],
|
|
16
16
|
"_from": "ansi-styles@>=2.2.1 <3.0.0",
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
"_shasum": "b432dd3358b634cf75e1e4664368240533c1ddbe",
|
|
45
45
|
"_shrinkwrap": null,
|
|
46
46
|
"_spec": "ansi-styles@^2.2.1",
|
|
47
|
-
"_where": "/Users/benjamincoe/
|
|
47
|
+
"_where": "/Users/benjamincoe/oss/nyc/node_modules/chalk",
|
|
48
48
|
"author": {
|
|
49
49
|
"name": "Sindre Sorhus",
|
|
50
50
|
"email": "sindresorhus@gmail.com",
|
|
@@ -96,13 +96,20 @@
|
|
|
96
96
|
"license": "MIT",
|
|
97
97
|
"maintainers": [
|
|
98
98
|
{
|
|
99
|
-
"name": "
|
|
100
|
-
"email": "sindresorhus@gmail.com"
|
|
99
|
+
"name": "Sindre Sorhus",
|
|
100
|
+
"email": "sindresorhus@gmail.com",
|
|
101
|
+
"url": "sindresorhus.com"
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
"name": "Joshua Appelman",
|
|
105
|
+
"email": "jappelman@xebia.com",
|
|
106
|
+
"url": "jbnicolai.com"
|
|
101
107
|
}
|
|
102
108
|
],
|
|
103
109
|
"name": "ansi-styles",
|
|
104
110
|
"optionalDependencies": {},
|
|
105
|
-
"readme": "
|
|
111
|
+
"readme": "# ansi-styles [](https://travis-ci.org/chalk/ansi-styles)\n\n> [ANSI escape codes](http://en.wikipedia.org/wiki/ANSI_escape_code#Colors_and_Styles) for styling strings in the terminal\n\nYou probably want the higher-level [chalk](https://github.com/chalk/chalk) module for styling your strings.\n\n\n\n\n## Install\n\n```\n$ npm install --save ansi-styles\n```\n\n\n## Usage\n\n```js\nvar ansi = require('ansi-styles');\n\nconsole.log(ansi.green.open + 'Hello world!' + ansi.green.close);\n```\n\n\n## API\n\nEach style has an `open` and `close` property.\n\n\n## Styles\n\n### Modifiers\n\n- `reset`\n- `bold`\n- `dim`\n- `italic` *(not widely supported)*\n- `underline`\n- `inverse`\n- `hidden`\n- `strikethrough` *(not widely supported)*\n\n### Colors\n\n- `black`\n- `red`\n- `green`\n- `yellow`\n- `blue`\n- `magenta`\n- `cyan`\n- `white`\n- `gray`\n\n### Background colors\n\n- `bgBlack`\n- `bgRed`\n- `bgGreen`\n- `bgYellow`\n- `bgBlue`\n- `bgMagenta`\n- `bgCyan`\n- `bgWhite`\n\n\n## Advanced usage\n\nBy 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.\n\n- `ansi.modifiers`\n- `ansi.colors`\n- `ansi.bgColors`\n\n\n###### Example\n\n```js\nconsole.log(ansi.colors.green.open);\n```\n\n\n## License\n\nMIT © [Sindre Sorhus](http://sindresorhus.com)\n",
|
|
112
|
+
"readmeFilename": "readme.md",
|
|
106
113
|
"repository": {
|
|
107
114
|
"type": "git",
|
|
108
115
|
"url": "git+https://github.com/chalk/ansi-styles.git"
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
"spec": ">=0.4.0 <0.5.0",
|
|
11
11
|
"type": "range"
|
|
12
12
|
},
|
|
13
|
-
"/Users/benjamincoe/
|
|
13
|
+
"/Users/benjamincoe/oss/nyc/node_modules/istanbul-lib-hook"
|
|
14
14
|
]
|
|
15
15
|
],
|
|
16
16
|
"_from": "append-transform@>=0.4.0 <0.5.0",
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
"_shasum": "d76ebf8ca94d276e247a36bad44a4b74ab611991",
|
|
41
41
|
"_shrinkwrap": null,
|
|
42
42
|
"_spec": "append-transform@^0.4.0",
|
|
43
|
-
"_where": "/Users/benjamincoe/
|
|
43
|
+
"_where": "/Users/benjamincoe/oss/nyc/node_modules/istanbul-lib-hook",
|
|
44
44
|
"author": {
|
|
45
45
|
"name": "James Talmage",
|
|
46
46
|
"email": "james@talmage.io",
|
|
@@ -92,7 +92,8 @@
|
|
|
92
92
|
],
|
|
93
93
|
"name": "append-transform",
|
|
94
94
|
"optionalDependencies": {},
|
|
95
|
-
"readme": "
|
|
95
|
+
"readme": "# append-transform [](https://travis-ci.org/jamestalmage/append-transform) [](https://coveralls.io/github/jamestalmage/append-transform?branch=master)\n\n> Install a transform to `require.extensions` that always runs last, even if additional extensions are added later.\n\nThe [typical require extension](https://gist.github.com/jamestalmage/df922691475cff66c7e6) looks something like this:\n\n```js\n var myTransform = require('my-transform');\n \n var oldExtension = require.extensions['.js'];\n require.extensions['.js'] = function (module, filename) {\n var oldCompile = module._compile;\n module._compile = function (code, filename) {\n code = myTransform(code);\n module._compile = oldCompile;\n module._compile(code, filename);\n }; \n oldExtension(module, filename);\n };\n```\n\nIn **almost** all cases, that is sufficient and is the method that should be used (check out [`pirates`](https://www.npmjs.com/package/pirates) for an easy way to do it correctly). In **rare** cases you must ensure your transform remains the last one, even if other transforms are added later. For example, `nyc` uses this module to ensure its transform is applied last so it can capture the final source-map information, and ensure any language extensions it can't understand are already transpiled (ES2015 via `babel` for instance).\n\n*WARNING:* You should be sure you *actually* need this, as it takes control away from the user. Your transform remains the last one applied, even as users continue to add more transforms. This is potentially confusing. Coverage libraries like `nyc` (and `istanbul` on which it relies) have valid reasons for doing this, but you should prefer conventional transform installation via [`pirates`](https://www.npmjs.com/package/pirates).\n\nReferences: \n - [Detailed Breakdown of How Require Extensions Work](https://gist.github.com/jamestalmage/df922691475cff66c7e6)\n - The [test suite](https://github.com/jamestalmage/append-transform/blob/master/test/execution-order.js) provides a good overview of how this library manipulates the order in which transforms are applied.\n\n## Install\n\n```\n$ npm install --save append-transform\n```\n\n\n## Usage\n\n```js\nvar appendTransform = require('append-transform');\nvar myTransform = require('my-transform');\n\nappendTransform(function (code, filename) {\n if (myTransform.shouldTransform(filename)) {\n code = myTransform.transform(code);\n }\n return code;\n});\n```\n\n## API\n\n### appendTransform(transformFn, [extension])\n\n#### transformFn\n\nType: `function(code: string, filename: string)` \n*Required*\n\nA callback that modifies the incoming `code` argument in some way, and returns the transformed result. `filename` is provided to filter which files the transform applies to. If a transform should not manipulate a particular file, just return `code` without modifying it. It is fairly common to avoid transforming files in `node_modules`. In that case you may want to use [`node-modules-regexp`](https://www.npmjs.com/package/node-modules-regexp) to help reliably detect `node_modules` paths and avoid transforming them.\n\n\n#### extension\n\nType: `string` \nDefault: `\".js\"`\n\nThe extension for the types of files this transform is capable of handling.\n\n## License\n\nMIT © [James Talmage](http://github.com/jamestalmage)\n",
|
|
96
|
+
"readmeFilename": "readme.md",
|
|
96
97
|
"repository": {
|
|
97
98
|
"type": "git",
|
|
98
99
|
"url": "git+https://github.com/jamestalmage/append-transform.git"
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
"spec": ">=1.0.0 <2.0.0",
|
|
11
11
|
"type": "range"
|
|
12
12
|
},
|
|
13
|
-
"/Users/benjamincoe/
|
|
13
|
+
"/Users/benjamincoe/oss/nyc"
|
|
14
14
|
]
|
|
15
15
|
],
|
|
16
16
|
"_from": "archy@>=1.0.0 <2.0.0",
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
"_shasum": "f9c8c13757cc1dd7bc379ac77b2c62a5c2868c40",
|
|
40
40
|
"_shrinkwrap": null,
|
|
41
41
|
"_spec": "archy@^1.0.0",
|
|
42
|
-
"_where": "/Users/benjamincoe/
|
|
42
|
+
"_where": "/Users/benjamincoe/oss/nyc",
|
|
43
43
|
"author": {
|
|
44
44
|
"name": "James Halliday",
|
|
45
45
|
"email": "mail@substack.net",
|
|
@@ -60,7 +60,7 @@
|
|
|
60
60
|
"tarball": "https://registry.npmjs.org/archy/-/archy-1.0.0.tgz"
|
|
61
61
|
},
|
|
62
62
|
"gitHead": "30223c16191e877bf027b15b12daf077b9b55b84",
|
|
63
|
-
"homepage": "https://github.com/substack/node-archy",
|
|
63
|
+
"homepage": "https://github.com/substack/node-archy#readme",
|
|
64
64
|
"keywords": [
|
|
65
65
|
"hierarchy",
|
|
66
66
|
"npm ls",
|
|
@@ -78,7 +78,8 @@
|
|
|
78
78
|
],
|
|
79
79
|
"name": "archy",
|
|
80
80
|
"optionalDependencies": {},
|
|
81
|
-
"readme": "
|
|
81
|
+
"readme": "# archy\n\nRender nested hierarchies `npm ls` style with unicode pipes.\n\n[](http://ci.testling.com/substack/node-archy)\n\n[](http://travis-ci.org/substack/node-archy)\n\n# example\n\n``` js\nvar archy = require('archy');\nvar s = archy({\n label : 'beep',\n nodes : [\n 'ity',\n {\n label : 'boop',\n nodes : [\n {\n label : 'o_O',\n nodes : [\n {\n label : 'oh',\n nodes : [ 'hello', 'puny' ]\n },\n 'human'\n ]\n },\n 'party\\ntime!'\n ]\n }\n ]\n});\nconsole.log(s);\n```\n\noutput\n\n```\nbeep\n├── ity\n└─┬ boop\n ├─┬ o_O\n │ ├─┬ oh\n │ │ ├── hello\n │ │ └── puny\n │ └── human\n └── party\n time!\n```\n\n# methods\n\nvar archy = require('archy')\n\n## archy(obj, prefix='', opts={})\n\nReturn a string representation of `obj` with unicode pipe characters like how\n`npm ls` looks.\n\n`obj` should be a tree of nested objects with `'label'` and `'nodes'` fields.\n`'label'` is a string of text to display at a node level and `'nodes'` is an\narray of the descendents of the current node.\n\nIf a node is a string, that string will be used as the `'label'` and an empty\narray of `'nodes'` will be used.\n\n`prefix` gets prepended to all the lines and is used by the algorithm to\nrecursively update.\n\nIf `'label'` has newlines they will be indented at the present indentation level\nwith the current prefix.\n\nTo disable unicode results in favor of all-ansi output set `opts.unicode` to\n`false`.\n\n# install\n\nWith [npm](http://npmjs.org) do:\n\n```\nnpm install archy\n```\n\n# license\n\nMIT\n",
|
|
82
|
+
"readmeFilename": "readme.markdown",
|
|
82
83
|
"repository": {
|
|
83
84
|
"type": "git",
|
|
84
85
|
"url": "git+ssh://git@github.com/substack/node-archy.git"
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
"spec": ">=2.0.0 <3.0.0",
|
|
11
11
|
"type": "range"
|
|
12
12
|
},
|
|
13
|
-
"/Users/benjamincoe/
|
|
13
|
+
"/Users/benjamincoe/oss/nyc/node_modules/micromatch"
|
|
14
14
|
]
|
|
15
15
|
],
|
|
16
16
|
"_from": "arr-diff@>=2.0.0 <3.0.0",
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
"_shasum": "8f3b827f955a8bd669697e4a4256ac3ceae356cf",
|
|
41
41
|
"_shrinkwrap": null,
|
|
42
42
|
"_spec": "arr-diff@^2.0.0",
|
|
43
|
-
"_where": "/Users/benjamincoe/
|
|
43
|
+
"_where": "/Users/benjamincoe/oss/nyc/node_modules/micromatch",
|
|
44
44
|
"author": {
|
|
45
45
|
"name": "Jon Schlinkert",
|
|
46
46
|
"url": "https://github.com/jonschlinkert"
|
|
@@ -98,7 +98,8 @@
|
|
|
98
98
|
],
|
|
99
99
|
"name": "arr-diff",
|
|
100
100
|
"optionalDependencies": {},
|
|
101
|
-
"readme": "
|
|
101
|
+
"readme": "# arr-diff [](https://www.npmjs.com/package/arr-diff) [](https://travis-ci.org/jonschlinkert/base)\n\n> Returns an array with only the unique values from the first array, by excluding all values from additional arrays using strict equality for comparisons.\n\n## Install\n\nInstall with [npm](https://www.npmjs.com/)\n\n```sh\n$ npm i arr-diff --save\n```\nInstall with [bower](http://bower.io/)\n\n```sh\n$ bower install arr-diff --save\n```\n\n## API\n\n### [diff](index.js#L33)\n\nReturn the difference between the first array and additional arrays.\n\n**Params**\n\n* `a` **{Array}**\n* `b` **{Array}**\n* `returns` **{Array}**\n\n**Example**\n\n```js\nvar diff = require('arr-diff');\n\nvar a = ['a', 'b', 'c', 'd'];\nvar b = ['b', 'c'];\n\nconsole.log(diff(a, b))\n//=> ['a', 'd']\n```\n\n## Related projects\n\n* [arr-flatten](https://www.npmjs.com/package/arr-flatten): Recursively flatten an array or arrays. This is the fastest implementation of array flatten. | [homepage](https://github.com/jonschlinkert/arr-flatten)\n* [array-filter](https://www.npmjs.com/package/array-filter): Array#filter for older browsers. | [homepage](https://github.com/juliangruber/array-filter)\n* [array-intersection](https://www.npmjs.com/package/array-intersection): Return an array with the unique values present in _all_ given arrays using strict equality… [more](https://www.npmjs.com/package/array-intersection) | [homepage](https://github.com/jonschlinkert/array-intersection)\n\n## Running tests\n\nInstall dev dependencies:\n\n```sh\n$ npm i -d && npm test\n```\n\n## Contributing\n\nPull requests and stars are always welcome. For bugs and feature requests, [please create an issue](https://github.com/jonschlinkert/arr-diff/issues/new).\n\n## Author\n\n**Jon Schlinkert**\n\n+ [github/jonschlinkert](https://github.com/jonschlinkert)\n+ [twitter/jonschlinkert](http://twitter.com/jonschlinkert)\n\n## License\n\nCopyright © 2015 [Jon Schlinkert](https://github.com/jonschlinkert)\nReleased under the MIT license.\n\n***\n\n_This file was generated by [verb](https://github.com/verbose/verb) on Sat Dec 05 2015 23:24:53 GMT-0500 (EST)._\n",
|
|
102
|
+
"readmeFilename": "README.md",
|
|
102
103
|
"repository": {
|
|
103
104
|
"type": "git",
|
|
104
105
|
"url": "git+https://github.com/jonschlinkert/arr-diff.git"
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
"spec": ">=1.0.1 <2.0.0",
|
|
11
11
|
"type": "range"
|
|
12
12
|
},
|
|
13
|
-
"/Users/benjamincoe/
|
|
13
|
+
"/Users/benjamincoe/oss/nyc/node_modules/arr-diff"
|
|
14
14
|
]
|
|
15
15
|
],
|
|
16
16
|
"_from": "arr-flatten@>=1.0.1 <2.0.0",
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
"_shasum": "a274ed85ac08849b6bd7847c4580745dc51adfb1",
|
|
45
45
|
"_shrinkwrap": null,
|
|
46
46
|
"_spec": "arr-flatten@^1.0.1",
|
|
47
|
-
"_where": "/Users/benjamincoe/
|
|
47
|
+
"_where": "/Users/benjamincoe/oss/nyc/node_modules/arr-diff",
|
|
48
48
|
"author": {
|
|
49
49
|
"name": "Jon Schlinkert",
|
|
50
50
|
"url": "https://github.com/jonschlinkert"
|
|
@@ -106,7 +106,8 @@
|
|
|
106
106
|
],
|
|
107
107
|
"name": "arr-flatten",
|
|
108
108
|
"optionalDependencies": {},
|
|
109
|
-
"readme": "
|
|
109
|
+
"readme": "# arr-flatten [](https://www.npmjs.com/package/arr-flatten) [](https://npmjs.org/package/arr-flatten) [](https://travis-ci.org/jonschlinkert/arr-flatten) [](https://ci.appveyor.com/project/jonschlinkert/arr-flatten)\n\n> Recursively flatten an array or arrays.\n\n## Install\n\nInstall with [npm](https://www.npmjs.com/):\n\n```sh\n$ npm install --save arr-flatten\n```\n\nInstall with [yarn](https://yarnpkg.com):\n\n```sh\n$ yarn add arr-flatten\n```\n\n## Install\n\nInstall with [bower](https://bower.io/)\n\n```sh\n$ bower install arr-flatten --save\n```\n\n## Usage\n\n```js\nvar flatten = require('arr-flatten');\n\nflatten(['a', ['b', ['c']], 'd', ['e']]);\n//=> ['a', 'b', 'c', 'd', 'e']\n```\n\n## Why another flatten utility?\n\nI wanted the fastest implementation I could find, with implementation choices that should work for 95% of use cases, but no cruft to cover the other 5%.\n\n## About\n\n### Related projects\n\n* [arr-filter](https://www.npmjs.com/package/arr-filter): Faster alternative to javascript's native filter method. | [homepage](https://github.com/jonschlinkert/arr-filter \"Faster alternative to javascript's native filter method.\")\n* [arr-union](https://www.npmjs.com/package/arr-union): Combines a list of arrays, returning a single array with unique values, using strict equality… [more](https://github.com/jonschlinkert/arr-union) | [homepage](https://github.com/jonschlinkert/arr-union \"Combines a list of arrays, returning a single array with unique values, using strict equality for comparisons.\")\n* [array-each](https://www.npmjs.com/package/array-each): Loop over each item in an array and call the given function on every element. | [homepage](https://github.com/jonschlinkert/array-each \"Loop over each item in an array and call the given function on every element.\")\n* [array-unique](https://www.npmjs.com/package/array-unique): Remove duplicate values from an array. Fastest ES5 implementation. | [homepage](https://github.com/jonschlinkert/array-unique \"Remove duplicate values from an array. Fastest ES5 implementation.\")\n\n### Contributing\n\nPull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new).\n\n### Building docs\n\n_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_\n\nTo generate the readme, run the following command:\n\n```sh\n$ npm install -g verbose/verb#dev verb-generate-readme && verb\n```\n\n### Running tests\n\nRunning and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command:\n\n```sh\n$ npm install && npm test\n```\n\n### Author\n\n**Jon Schlinkert**\n\n* [github/jonschlinkert](https://github.com/jonschlinkert)\n* [twitter/jonschlinkert](https://twitter.com/jonschlinkert)\n\n### License\n\nCopyright © 2017, [Jon Schlinkert](https://github.com/jonschlinkert).\nReleased under the [MIT License](LICENSE).\n\n***\n\n_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.5.0, on April 16, 2017._",
|
|
110
|
+
"readmeFilename": "README.md",
|
|
110
111
|
"repository": {
|
|
111
112
|
"type": "git",
|
|
112
113
|
"url": "git+https://github.com/jonschlinkert/arr-flatten.git"
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
"spec": ">=0.2.1 <0.3.0",
|
|
11
11
|
"type": "range"
|
|
12
12
|
},
|
|
13
|
-
"/Users/benjamincoe/
|
|
13
|
+
"/Users/benjamincoe/oss/nyc/node_modules/micromatch"
|
|
14
14
|
]
|
|
15
15
|
],
|
|
16
16
|
"_from": "array-unique@>=0.2.1 <0.3.0",
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
"_shasum": "a1d97ccafcbc2625cc70fadceb36a50c58b01a53",
|
|
41
41
|
"_shrinkwrap": null,
|
|
42
42
|
"_spec": "array-unique@^0.2.1",
|
|
43
|
-
"_where": "/Users/benjamincoe/
|
|
43
|
+
"_where": "/Users/benjamincoe/oss/nyc/node_modules/micromatch",
|
|
44
44
|
"author": {
|
|
45
45
|
"name": "Jon Schlinkert",
|
|
46
46
|
"url": "https://github.com/jonschlinkert"
|
|
@@ -82,7 +82,8 @@
|
|
|
82
82
|
],
|
|
83
83
|
"name": "array-unique",
|
|
84
84
|
"optionalDependencies": {},
|
|
85
|
-
"readme": "
|
|
85
|
+
"readme": "# array-unique [](http://badge.fury.io/js/array-unique) [](https://travis-ci.org/jonschlinkert/array-unique) \n\n> Return an array free of duplicate values. Fastest ES5 implementation.\n\n## Install with [npm](npmjs.org)\n\n```bash\nnpm i array-unique --save\n```\n\n## Usage\n\n```js\nvar unique = require('array-unique');\n\nunique(['a', 'b', 'c', 'c']);\n//=> ['a', 'b', 'c']\n```\n\n## Related\n* [arr-diff](https://github.com/jonschlinkert/arr-diff): Returns an array with only the unique values from the first array, by excluding all values from additional arrays using strict equality for comparisons.\n* [arr-union](https://github.com/jonschlinkert/arr-union): Returns an array of unique values using strict equality for comparisons.\n* [arr-flatten](https://github.com/jonschlinkert/arr-flatten): Recursively flatten an array or arrays. This is the fastest implementation of array flatten.\n* [arr-reduce](https://github.com/jonschlinkert/arr-reduce): Fast array reduce that also loops over sparse elements.\n* [arr-map](https://github.com/jonschlinkert/arr-map): Faster, node.js focused alternative to JavaScript's native array map.\n* [arr-pluck](https://github.com/jonschlinkert/arr-pluck): Retrieves the value of a specified property from all elements in the collection.\n\n## Run tests\nInstall dev dependencies.\n\n```bash\nnpm i -d && npm test\n```\n\n## Contributing\nPull requests and stars are always welcome. For bugs and feature requests, [please create an issue](https://github.com/jonschlinkert/array-unique/issues)\n\n## Author\n\n**Jon Schlinkert**\n \n+ [github/jonschlinkert](https://github.com/jonschlinkert)\n+ [twitter/jonschlinkert](http://twitter.com/jonschlinkert) \n\n## License\nCopyright (c) 2015 Jon Schlinkert \nReleased under the MIT license\n\n***\n\n_This file was generated by [verb-cli](https://github.com/assemble/verb-cli) on March 24, 2015._",
|
|
86
|
+
"readmeFilename": "README.md",
|
|
86
87
|
"repository": {
|
|
87
88
|
"type": "git",
|
|
88
89
|
"url": "git://github.com/jonschlinkert/array-unique.git"
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
"spec": ">=1.0.1 <2.0.0",
|
|
11
11
|
"type": "range"
|
|
12
12
|
},
|
|
13
|
-
"/Users/benjamincoe/
|
|
13
|
+
"/Users/benjamincoe/oss/nyc"
|
|
14
14
|
]
|
|
15
15
|
],
|
|
16
16
|
"_from": "arrify@>=1.0.1 <2.0.0",
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
"_shasum": "898508da2226f380df904728456849c1501a4b0d",
|
|
42
42
|
"_shrinkwrap": null,
|
|
43
43
|
"_spec": "arrify@^1.0.1",
|
|
44
|
-
"_where": "/Users/benjamincoe/
|
|
44
|
+
"_where": "/Users/benjamincoe/oss/nyc",
|
|
45
45
|
"author": {
|
|
46
46
|
"name": "Sindre Sorhus",
|
|
47
47
|
"email": "sindresorhus@gmail.com",
|
|
@@ -86,7 +86,8 @@
|
|
|
86
86
|
],
|
|
87
87
|
"name": "arrify",
|
|
88
88
|
"optionalDependencies": {},
|
|
89
|
-
"readme": "
|
|
89
|
+
"readme": "# arrify [](https://travis-ci.org/sindresorhus/arrify)\n\n> Convert a value to an array\n\n\n## Install\n\n```\n$ npm install --save arrify\n```\n\n\n## Usage\n\n```js\nconst arrify = require('arrify');\n\narrify('unicorn');\n//=> ['unicorn']\n\narrify(['unicorn']);\n//=> ['unicorn']\n\narrify(null);\n//=> []\n\narrify(undefined);\n//=> []\n```\n\n*Supplying `null` or `undefined` results in an empty array.*\n\n\n## License\n\nMIT © [Sindre Sorhus](http://sindresorhus.com)\n",
|
|
90
|
+
"readmeFilename": "readme.md",
|
|
90
91
|
"repository": {
|
|
91
92
|
"type": "git",
|
|
92
93
|
"url": "git+https://github.com/sindresorhus/arrify.git"
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
"spec": ">=1.4.0 <2.0.0",
|
|
11
11
|
"type": "range"
|
|
12
12
|
},
|
|
13
|
-
"/Users/benjamincoe/
|
|
13
|
+
"/Users/benjamincoe/oss/nyc/node_modules/handlebars"
|
|
14
14
|
]
|
|
15
15
|
],
|
|
16
16
|
"_from": "async@>=1.4.0 <2.0.0",
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
"_shasum": "ec6a61ae56480c0c3cb241c95618e20892f9672a",
|
|
41
41
|
"_shrinkwrap": null,
|
|
42
42
|
"_spec": "async@^1.4.0",
|
|
43
|
-
"_where": "/Users/benjamincoe/
|
|
43
|
+
"_where": "/Users/benjamincoe/oss/nyc/node_modules/handlebars",
|
|
44
44
|
"author": {
|
|
45
45
|
"name": "Caolan McMahon"
|
|
46
46
|
},
|
|
@@ -125,7 +125,8 @@
|
|
|
125
125
|
],
|
|
126
126
|
"name": "async",
|
|
127
127
|
"optionalDependencies": {},
|
|
128
|
-
"readme": "ERROR: No README data found!",
|
|
128
|
+
"readme": "# Async.js\n\n[](https://travis-ci.org/caolan/async)\n[](https://www.npmjs.org/package/async)\n[](https://coveralls.io/r/caolan/async?branch=master)\n[](https://gitter.im/caolan/async?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)\n\n\nAsync is a utility module which provides straight-forward, powerful functions\nfor working with asynchronous JavaScript. Although originally designed for\nuse with [Node.js](http://nodejs.org) and installable via `npm install async`,\nit can also be used directly in the browser.\n\nAsync is also installable via:\n\n- [bower](http://bower.io/): `bower install async`\n- [component](https://github.com/component/component): `component install\n caolan/async`\n- [jam](http://jamjs.org/): `jam install async`\n- [spm](http://spmjs.io/): `spm install async`\n\nAsync provides around 20 functions that include the usual 'functional'\nsuspects (`map`, `reduce`, `filter`, `each`…) as well as some common patterns\nfor asynchronous control flow (`parallel`, `series`, `waterfall`…). All these\nfunctions assume you follow the Node.js convention of providing a single\ncallback as the last argument of your `async` function.\n\n\n## Quick Examples\n\n```javascript\nasync.map(['file1','file2','file3'], fs.stat, function(err, results){\n // results is now an array of stats for each file\n});\n\nasync.filter(['file1','file2','file3'], fs.exists, function(results){\n // results now equals an array of the existing files\n});\n\nasync.parallel([\n function(){ ... },\n function(){ ... }\n], callback);\n\nasync.series([\n function(){ ... },\n function(){ ... }\n]);\n```\n\nThere are many more functions available so take a look at the docs below for a\nfull list. This module aims to be comprehensive, so if you feel anything is\nmissing please create a GitHub issue for it.\n\n## Common Pitfalls <sub>[(StackOverflow)](http://stackoverflow.com/questions/tagged/async.js)</sub>\n### Synchronous iteration functions\n\nIf you get an error like `RangeError: Maximum call stack size exceeded.` or other stack overflow issues when using async, you are likely using a synchronous iterator. By *synchronous* we mean a function that calls its callback on the same tick in the javascript event loop, without doing any I/O or using any timers. Calling many callbacks iteratively will quickly overflow the stack. If you run into this issue, just defer your callback with `async.setImmediate` to start a new call stack on the next tick of the event loop.\n\nThis can also arise by accident if you callback early in certain cases:\n\n```js\nasync.eachSeries(hugeArray, function iterator(item, callback) {\n if (inCache(item)) {\n callback(null, cache[item]); // if many items are cached, you'll overflow\n } else {\n doSomeIO(item, callback);\n }\n}, function done() {\n //...\n});\n```\n\nJust change it to:\n\n```js\nasync.eachSeries(hugeArray, function iterator(item, callback) {\n if (inCache(item)) {\n async.setImmediate(function () {\n callback(null, cache[item]);\n });\n } else {\n doSomeIO(item, callback);\n //...\n```\n\nAsync guards against synchronous functions in some, but not all, cases. If you are still running into stack overflows, you can defer as suggested above, or wrap functions with [`async.ensureAsync`](#ensureAsync) Functions that are asynchronous by their nature do not have this problem and don't need the extra callback deferral.\n\nIf JavaScript's event loop is still a bit nebulous, check out [this article](http://blog.carbonfive.com/2013/10/27/the-javascript-event-loop-explained/) or [this talk](http://2014.jsconf.eu/speakers/philip-roberts-what-the-heck-is-the-event-loop-anyway.html) for more detailed information about how it works.\n\n\n### Multiple callbacks\n\nMake sure to always `return` when calling a callback early, otherwise you will cause multiple callbacks and unpredictable behavior in many cases.\n\n```js\nasync.waterfall([\n function (callback) {\n getSomething(options, function (err, result) {\n if (err) {\n callback(new Error(\"failed getting something:\" + err.message));\n // we should return here\n }\n // since we did not return, this callback still will be called and\n // `processData` will be called twice\n callback(null, result);\n });\n },\n processData\n], done)\n```\n\nIt is always good practice to `return callback(err, result)` whenever a callback call is not the last statement of a function.\n\n\n### Binding a context to an iterator\n\nThis section is really about `bind`, not about `async`. If you are wondering how to\nmake `async` execute your iterators in a given context, or are confused as to why\na method of another library isn't working as an iterator, study this example:\n\n```js\n// Here is a simple object with an (unnecessarily roundabout) squaring method\nvar AsyncSquaringLibrary = {\n squareExponent: 2,\n square: function(number, callback){\n var result = Math.pow(number, this.squareExponent);\n setTimeout(function(){\n callback(null, result);\n }, 200);\n }\n};\n\nasync.map([1, 2, 3], AsyncSquaringLibrary.square, function(err, result){\n // result is [NaN, NaN, NaN]\n // This fails because the `this.squareExponent` expression in the square\n // function is not evaluated in the context of AsyncSquaringLibrary, and is\n // therefore undefined.\n});\n\nasync.map([1, 2, 3], AsyncSquaringLibrary.square.bind(AsyncSquaringLibrary), function(err, result){\n // result is [1, 4, 9]\n // With the help of bind we can attach a context to the iterator before\n // passing it to async. Now the square function will be executed in its\n // 'home' AsyncSquaringLibrary context and the value of `this.squareExponent`\n // will be as expected.\n});\n```\n\n## Download\n\nThe source is available for download from\n[GitHub](https://github.com/caolan/async/blob/master/lib/async.js).\nAlternatively, you can install using Node Package Manager (`npm`):\n\n npm install async\n\nAs well as using Bower:\n\n bower install async\n\n__Development:__ [async.js](https://github.com/caolan/async/raw/master/lib/async.js) - 29.6kb Uncompressed\n\n## In the Browser\n\nSo far it's been tested in IE6, IE7, IE8, FF3.6 and Chrome 5.\n\nUsage:\n\n```html\n<script type=\"text/javascript\" src=\"async.js\"></script>\n<script type=\"text/javascript\">\n\n async.map(data, asyncProcess, function(err, results){\n alert(results);\n });\n\n</script>\n```\n\n## Documentation\n\nSome functions are also available in the following forms:\n* `<name>Series` - the same as `<name>` but runs only a single async operation at a time\n* `<name>Limit` - the same as `<name>` but runs a maximum of `limit` async operations at a time\n\n### Collections\n\n* [`each`](#each), `eachSeries`, `eachLimit`\n* [`forEachOf`](#forEachOf), `forEachOfSeries`, `forEachOfLimit`\n* [`map`](#map), `mapSeries`, `mapLimit`\n* [`filter`](#filter), `filterSeries`, `filterLimit`\n* [`reject`](#reject), `rejectSeries`, `rejectLimit`\n* [`reduce`](#reduce), [`reduceRight`](#reduceRight)\n* [`detect`](#detect), `detectSeries`, `detectLimit`\n* [`sortBy`](#sortBy)\n* [`some`](#some), `someLimit`\n* [`every`](#every), `everyLimit`\n* [`concat`](#concat), `concatSeries`\n\n### Control Flow\n\n* [`series`](#seriestasks-callback)\n* [`parallel`](#parallel), `parallelLimit`\n* [`whilst`](#whilst), [`doWhilst`](#doWhilst)\n* [`until`](#until), [`doUntil`](#doUntil)\n* [`during`](#during), [`doDuring`](#doDuring)\n* [`forever`](#forever)\n* [`waterfall`](#waterfall)\n* [`compose`](#compose)\n* [`seq`](#seq)\n* [`applyEach`](#applyEach), `applyEachSeries`\n* [`queue`](#queue), [`priorityQueue`](#priorityQueue)\n* [`cargo`](#cargo)\n* [`auto`](#auto)\n* [`retry`](#retry)\n* [`iterator`](#iterator)\n* [`times`](#times), `timesSeries`, `timesLimit`\n\n### Utils\n\n* [`apply`](#apply)\n* [`nextTick`](#nextTick)\n* [`memoize`](#memoize)\n* [`unmemoize`](#unmemoize)\n* [`ensureAsync`](#ensureAsync)\n* [`constant`](#constant)\n* [`asyncify`](#asyncify)\n* [`wrapSync`](#wrapSync)\n* [`log`](#log)\n* [`dir`](#dir)\n* [`noConflict`](#noConflict)\n\n## Collections\n\n<a name=\"forEach\" />\n<a name=\"each\" />\n### each(arr, iterator, [callback])\n\nApplies the function `iterator` to each item in `arr`, in parallel.\nThe `iterator` is called with an item from the list, and a callback for when it\nhas finished. If the `iterator` passes an error to its `callback`, the main\n`callback` (for the `each` function) is immediately called with the error.\n\nNote, that since this function applies `iterator` to each item in parallel,\nthere is no guarantee that the iterator functions will complete in order.\n\n__Arguments__\n\n* `arr` - An array to iterate over.\n* `iterator(item, callback)` - A function to apply to each item in `arr`.\n The iterator is passed a `callback(err)` which must be called once it has\n completed. If no error has occurred, the `callback` should be run without\n arguments or with an explicit `null` argument. The array index is not passed\n to the iterator. If you need the index, use [`forEachOf`](#forEachOf).\n* `callback(err)` - *Optional* A callback which is called when all `iterator` functions\n have finished, or an error occurs.\n\n__Examples__\n\n\n```js\n// assuming openFiles is an array of file names and saveFile is a function\n// to save the modified contents of that file:\n\nasync.each(openFiles, saveFile, function(err){\n // if any of the saves produced an error, err would equal that error\n});\n```\n\n```js\n// assuming openFiles is an array of file names\n\nasync.each(openFiles, function(file, callback) {\n\n // Perform operation on file here.\n console.log('Processing file ' + file);\n\n if( file.length > 32 ) {\n console.log('This file name is too long');\n callback('File name too long');\n } else {\n // Do work to process file here\n console.log('File processed');\n callback();\n }\n}, function(err){\n // if any of the file processing produced an error, err would equal that error\n if( err ) {\n // One of the iterations produced an error.\n // All processing will now stop.\n console.log('A file failed to process');\n } else {\n console.log('All files have been processed successfully');\n }\n});\n```\n\n__Related__\n\n* eachSeries(arr, iterator, [callback])\n* eachLimit(arr, limit, iterator, [callback])\n\n---------------------------------------\n\n<a name=\"forEachOf\" />\n<a name=\"eachOf\" />\n\n### forEachOf(obj, iterator, [callback])\n\nLike `each`, except that it iterates over objects, and passes the key as the second argument to the iterator.\n\n__Arguments__\n\n* `obj` - An object or array to iterate over.\n* `iterator(item, key, callback)` - A function to apply to each item in `obj`.\nThe `key` is the item's key, or index in the case of an array. The iterator is\npassed a `callback(err)` which must be called once it has completed. If no\nerror has occurred, the callback should be run without arguments or with an\nexplicit `null` argument.\n* `callback(err)` - *Optional* A callback which is called when all `iterator` functions have finished, or an error occurs.\n\n__Example__\n\n```js\nvar obj = {dev: \"/dev.json\", test: \"/test.json\", prod: \"/prod.json\"};\nvar configs = {};\n\nasync.forEachOf(obj, function (value, key, callback) {\n fs.readFile(__dirname + value, \"utf8\", function (err, data) {\n if (err) return callback(err);\n try {\n configs[key] = JSON.parse(data);\n } catch (e) {\n return callback(e);\n }\n callback();\n })\n}, function (err) {\n if (err) console.error(err.message);\n // configs is now a map of JSON data\n doSomethingWith(configs);\n})\n```\n\n__Related__\n\n* forEachOfSeries(obj, iterator, [callback])\n* forEachOfLimit(obj, limit, iterator, [callback])\n\n---------------------------------------\n\n<a name=\"map\" />\n### map(arr, iterator, [callback])\n\nProduces a new array of values by mapping each value in `arr` through\nthe `iterator` function. The `iterator` is called with an item from `arr` and a\ncallback for when it has finished processing. Each of these callback takes 2 arguments:\nan `error`, and the transformed item from `arr`. If `iterator` passes an error to its\ncallback, the main `callback` (for the `map` function) is immediately called with the error.\n\nNote, that since this function applies the `iterator` to each item in parallel,\nthere is no guarantee that the `iterator` functions will complete in order.\nHowever, the results array will be in the same order as the original `arr`.\n\n__Arguments__\n\n* `arr` - An array to iterate over.\n* `iterator(item, callback)` - A function to apply to each item in `arr`.\n The iterator is passed a `callback(err, transformed)` which must be called once\n it has completed with an error (which can be `null`) and a transformed item.\n* `callback(err, results)` - *Optional* A callback which is called when all `iterator`\n functions have finished, or an error occurs. Results is an array of the\n transformed items from the `arr`.\n\n__Example__\n\n```js\nasync.map(['file1','file2','file3'], fs.stat, function(err, results){\n // results is now an array of stats for each file\n});\n```\n\n__Related__\n* mapSeries(arr, iterator, [callback])\n* mapLimit(arr, limit, iterator, [callback])\n\n---------------------------------------\n\n<a name=\"select\" />\n<a name=\"filter\" />\n### filter(arr, iterator, [callback])\n\n__Alias:__ `select`\n\nReturns a new array of all the values in `arr` which pass an async truth test.\n_The callback for each `iterator` call only accepts a single argument of `true` or\n`false`; it does not accept an error argument first!_ This is in-line with the\nway node libraries work with truth tests like `fs.exists`. This operation is\nperformed in parallel, but the results array will be in the same order as the\noriginal.\n\n__Arguments__\n\n* `arr` - An array to iterate over.\n* `iterator(item, callback)` - A truth test to apply to each item in `arr`.\n The `iterator` is passed a `callback(truthValue)`, which must be called with a\n boolean argument once it has completed.\n* `callback(results)` - *Optional* A callback which is called after all the `iterator`\n functions have finished.\n\n__Example__\n\n```js\nasync.filter(['file1','file2','file3'], fs.exists, function(results){\n // results now equals an array of the existing files\n});\n```\n\n__Related__\n\n* filterSeries(arr, iterator, [callback])\n* filterLimit(arr, limit, iterator, [callback])\n\n---------------------------------------\n\n<a name=\"reject\" />\n### reject(arr, iterator, [callback])\n\nThe opposite of [`filter`](#filter). Removes values that pass an `async` truth test.\n\n__Related__\n\n* rejectSeries(arr, iterator, [callback])\n* rejectLimit(arr, limit, iterator, [callback])\n\n---------------------------------------\n\n<a name=\"reduce\" />\n### reduce(arr, memo, iterator, [callback])\n\n__Aliases:__ `inject`, `foldl`\n\nReduces `arr` into a single value using an async `iterator` to return\neach successive step. `memo` is the initial state of the reduction.\nThis function only operates in series.\n\nFor performance reasons, it may make sense to split a call to this function into\na parallel map, and then use the normal `Array.prototype.reduce` on the results.\nThis function is for situations where each step in the reduction needs to be async;\nif you can get the data before reducing it, then it's probably a good idea to do so.\n\n__Arguments__\n\n* `arr` - An array to iterate over.\n* `memo` - The initial state of the reduction.\n* `iterator(memo, item, callback)` - A function applied to each item in the\n array to produce the next step in the reduction. The `iterator` is passed a\n `callback(err, reduction)` which accepts an optional error as its first\n argument, and the state of the reduction as the second. If an error is\n passed to the callback, the reduction is stopped and the main `callback` is\n immediately called with the error.\n* `callback(err, result)` - *Optional* A callback which is called after all the `iterator`\n functions have finished. Result is the reduced value.\n\n__Example__\n\n```js\nasync.reduce([1,2,3], 0, function(memo, item, callback){\n // pointless async:\n process.nextTick(function(){\n callback(null, memo + item)\n });\n}, function(err, result){\n // result is now equal to the last value of memo, which is 6\n});\n```\n\n---------------------------------------\n\n<a name=\"reduceRight\" />\n### reduceRight(arr, memo, iterator, [callback])\n\n__Alias:__ `foldr`\n\nSame as [`reduce`](#reduce), only operates on `arr` in reverse order.\n\n\n---------------------------------------\n\n<a name=\"detect\" />\n### detect(arr, iterator, [callback])\n\nReturns the first value in `arr` that passes an async truth test. The\n`iterator` is applied in parallel, meaning the first iterator to return `true` will\nfire the detect `callback` with that result. That means the result might not be\nthe first item in the original `arr` (in terms of order) that passes the test.\n\nIf order within the original `arr` is important, then look at [`detectSeries`](#detectSeries).\n\n__Arguments__\n\n* `arr` - An array to iterate over.\n* `iterator(item, callback)` - A truth test to apply to each item in `arr`.\n The iterator is passed a `callback(truthValue)` which must be called with a\n boolean argument once it has completed. **Note: this callback does not take an error as its first argument.**\n* `callback(result)` - *Optional* A callback which is called as soon as any iterator returns\n `true`, or after all the `iterator` functions have finished. Result will be\n the first item in the array that passes the truth test (iterator) or the\n value `undefined` if none passed. **Note: this callback does not take an error as its first argument.**\n\n__Example__\n\n```js\nasync.detect(['file1','file2','file3'], fs.exists, function(result){\n // result now equals the first file in the list that exists\n});\n```\n\n__Related__\n\n* detectSeries(arr, iterator, [callback])\n* detectLimit(arr, limit, iterator, [callback])\n\n---------------------------------------\n\n<a name=\"sortBy\" />\n### sortBy(arr, iterator, [callback])\n\nSorts a list by the results of running each `arr` value through an async `iterator`.\n\n__Arguments__\n\n* `arr` - An array to iterate over.\n* `iterator(item, callback)` - A function to apply to each item in `arr`.\n The iterator is passed a `callback(err, sortValue)` which must be called once it\n has completed with an error (which can be `null`) and a value to use as the sort\n criteria.\n* `callback(err, results)` - *Optional* A callback which is called after all the `iterator`\n functions have finished, or an error occurs. Results is the items from\n the original `arr` sorted by the values returned by the `iterator` calls.\n\n__Example__\n\n```js\nasync.sortBy(['file1','file2','file3'], function(file, callback){\n fs.stat(file, function(err, stats){\n callback(err, stats.mtime);\n });\n}, function(err, results){\n // results is now the original array of files sorted by\n // modified date\n});\n```\n\n__Sort Order__\n\nBy modifying the callback parameter the sorting order can be influenced:\n\n```js\n//ascending order\nasync.sortBy([1,9,3,5], function(x, callback){\n callback(null, x);\n}, function(err,result){\n //result callback\n} );\n\n//descending order\nasync.sortBy([1,9,3,5], function(x, callback){\n callback(null, x*-1); //<- x*-1 instead of x, turns the order around\n}, function(err,result){\n //result callback\n} );\n```\n\n---------------------------------------\n\n<a name=\"some\" />\n### some(arr, iterator, [callback])\n\n__Alias:__ `any`\n\nReturns `true` if at least one element in the `arr` satisfies an async test.\n_The callback for each iterator call only accepts a single argument of `true` or\n`false`; it does not accept an error argument first!_ This is in-line with the\nway node libraries work with truth tests like `fs.exists`. Once any iterator\ncall returns `true`, the main `callback` is immediately called.\n\n__Arguments__\n\n* `arr` - An array to iterate over.\n* `iterator(item, callback)` - A truth test to apply to each item in the array\n in parallel. The iterator is passed a `callback(truthValue)`` which must be\n called with a boolean argument once it has completed.\n* `callback(result)` - *Optional* A callback which is called as soon as any iterator returns\n `true`, or after all the iterator functions have finished. Result will be\n either `true` or `false` depending on the values of the async tests.\n\n **Note: the callbacks do not take an error as their first argument.**\n__Example__\n\n```js\nasync.some(['file1','file2','file3'], fs.exists, function(result){\n // if result is true then at least one of the files exists\n});\n```\n\n__Related__\n\n* someLimit(arr, limit, iterator, callback)\n\n---------------------------------------\n\n<a name=\"every\" />\n### every(arr, iterator, [callback])\n\n__Alias:__ `all`\n\nReturns `true` if every element in `arr` satisfies an async test.\n_The callback for each `iterator` call only accepts a single argument of `true` or\n`false`; it does not accept an error argument first!_ This is in-line with the\nway node libraries work with truth tests like `fs.exists`.\n\n__Arguments__\n\n* `arr` - An array to iterate over.\n* `iterator(item, callback)` - A truth test to apply to each item in the array\n in parallel. The iterator is passed a `callback(truthValue)` which must be\n called with a boolean argument once it has completed.\n* `callback(result)` - *Optional* A callback which is called as soon as any iterator returns\n `false`, or after all the iterator functions have finished. Result will be\n either `true` or `false` depending on the values of the async tests.\n\n **Note: the callbacks do not take an error as their first argument.**\n\n__Example__\n\n```js\nasync.every(['file1','file2','file3'], fs.exists, function(result){\n // if result is true then every file exists\n});\n```\n\n__Related__\n\n* everyLimit(arr, limit, iterator, callback)\n\n---------------------------------------\n\n<a name=\"concat\" />\n### concat(arr, iterator, [callback])\n\nApplies `iterator` to each item in `arr`, concatenating the results. Returns the\nconcatenated list. The `iterator`s are called in parallel, and the results are\nconcatenated as they return. There is no guarantee that the results array will\nbe returned in the original order of `arr` passed to the `iterator` function.\n\n__Arguments__\n\n* `arr` - An array to iterate over.\n* `iterator(item, callback)` - A function to apply to each item in `arr`.\n The iterator is passed a `callback(err, results)` which must be called once it\n has completed with an error (which can be `null`) and an array of results.\n* `callback(err, results)` - *Optional* A callback which is called after all the `iterator`\n functions have finished, or an error occurs. Results is an array containing\n the concatenated results of the `iterator` function.\n\n__Example__\n\n```js\nasync.concat(['dir1','dir2','dir3'], fs.readdir, function(err, files){\n // files is now a list of filenames that exist in the 3 directories\n});\n```\n\n__Related__\n\n* concatSeries(arr, iterator, [callback])\n\n\n## Control Flow\n\n<a name=\"series\" />\n### series(tasks, [callback])\n\nRun the functions in the `tasks` array in series, each one running once the previous\nfunction has completed. If any functions in the series pass an error to its\ncallback, no more functions are run, and `callback` is immediately called with the value of the error.\nOtherwise, `callback` receives an array of results when `tasks` have completed.\n\nIt is also possible to use an object instead of an array. Each property will be\nrun as a function, and the results will be passed to the final `callback` as an object\ninstead of an array. This can be a more readable way of handling results from\n[`series`](#series).\n\n**Note** that while many implementations preserve the order of object properties, the\n[ECMAScript Language Specification](http://www.ecma-international.org/ecma-262/5.1/#sec-8.6)\nexplicitly states that\n\n> The mechanics and order of enumerating the properties is not specified.\n\nSo if you rely on the order in which your series of functions are executed, and want\nthis to work on all platforms, consider using an array.\n\n__Arguments__\n\n* `tasks` - An array or object containing functions to run, each function is passed\n a `callback(err, result)` it must call on completion with an error `err` (which can\n be `null`) and an optional `result` value.\n* `callback(err, results)` - An optional callback to run once all the functions\n have completed. This function gets a results array (or object) containing all\n the result arguments passed to the `task` callbacks.\n\n__Example__\n\n```js\nasync.series([\n function(callback){\n // do some stuff ...\n callback(null, 'one');\n },\n function(callback){\n // do some more stuff ...\n callback(null, 'two');\n }\n],\n// optional callback\nfunction(err, results){\n // results is now equal to ['one', 'two']\n});\n\n\n// an example using an object instead of an array\nasync.series({\n one: function(callback){\n setTimeout(function(){\n callback(null, 1);\n }, 200);\n },\n two: function(callback){\n setTimeout(function(){\n callback(null, 2);\n }, 100);\n }\n},\nfunction(err, results) {\n // results is now equal to: {one: 1, two: 2}\n});\n```\n\n---------------------------------------\n\n<a name=\"parallel\" />\n### parallel(tasks, [callback])\n\nRun the `tasks` array of functions in parallel, without waiting until the previous\nfunction has completed. If any of the functions pass an error to its\ncallback, the main `callback` is immediately called with the value of the error.\nOnce the `tasks` have completed, the results are passed to the final `callback` as an\narray.\n\n**Note:** `parallel` is about kicking-off I/O tasks in parallel, not about parallel execution of code. If your tasks do not use any timers or perform any I/O, they will actually be executed in series. Any synchronous setup sections for each task will happen one after the other. JavaScript remains single-threaded.\n\nIt is also possible to use an object instead of an array. Each property will be\nrun as a function and the results will be passed to the final `callback` as an object\ninstead of an array. This can be a more readable way of handling results from\n[`parallel`](#parallel).\n\n\n__Arguments__\n\n* `tasks` - An array or object containing functions to run. Each function is passed\n a `callback(err, result)` which it must call on completion with an error `err`\n (which can be `null`) and an optional `result` value.\n* `callback(err, results)` - An optional callback to run once all the functions\n have completed successfully. This function gets a results array (or object) containing all\n the result arguments passed to the task callbacks.\n\n__Example__\n\n```js\nasync.parallel([\n function(callback){\n setTimeout(function(){\n callback(null, 'one');\n }, 200);\n },\n function(callback){\n setTimeout(function(){\n callback(null, 'two');\n }, 100);\n }\n],\n// optional callback\nfunction(err, results){\n // the results array will equal ['one','two'] even though\n // the second function had a shorter timeout.\n});\n\n\n// an example using an object instead of an array\nasync.parallel({\n one: function(callback){\n setTimeout(function(){\n callback(null, 1);\n }, 200);\n },\n two: function(callback){\n setTimeout(function(){\n callback(null, 2);\n }, 100);\n }\n},\nfunction(err, results) {\n // results is now equals to: {one: 1, two: 2}\n});\n```\n\n__Related__\n\n* parallelLimit(tasks, limit, [callback])\n\n---------------------------------------\n\n<a name=\"whilst\" />\n### whilst(test, fn, callback)\n\nRepeatedly call `fn`, while `test` returns `true`. Calls `callback` when stopped,\nor an error occurs.\n\n__Arguments__\n\n* `test()` - synchronous truth test to perform before each execution of `fn`.\n* `fn(callback)` - A function which is called each time `test` passes. The function is\n passed a `callback(err)`, which must be called once it has completed with an\n optional `err` argument.\n* `callback(err, [results])` - A callback which is called after the test\n function has failed and repeated execution of `fn` has stopped. `callback`\n will be passed an error and any arguments passed to the final `fn`'s callback.\n\n__Example__\n\n```js\nvar count = 0;\n\nasync.whilst(\n function () { return count < 5; },\n function (callback) {\n count++;\n setTimeout(function () {\n callback(null, count);\n }, 1000);\n },\n function (err, n) {\n // 5 seconds have passed, n = 5\n }\n);\n```\n\n---------------------------------------\n\n<a name=\"doWhilst\" />\n### doWhilst(fn, test, callback)\n\nThe post-check version of [`whilst`](#whilst). To reflect the difference in\nthe order of operations, the arguments `test` and `fn` are switched.\n\n`doWhilst` is to `whilst` as `do while` is to `while` in plain JavaScript.\n\n---------------------------------------\n\n<a name=\"until\" />\n### until(test, fn, callback)\n\nRepeatedly call `fn` until `test` returns `true`. Calls `callback` when stopped,\nor an error occurs. `callback` will be passed an error and any arguments passed\nto the final `fn`'s callback.\n\nThe inverse of [`whilst`](#whilst).\n\n---------------------------------------\n\n<a name=\"doUntil\" />\n### doUntil(fn, test, callback)\n\nLike [`doWhilst`](#doWhilst), except the `test` is inverted. Note the argument ordering differs from `until`.\n\n---------------------------------------\n\n<a name=\"during\" />\n### during(test, fn, callback)\n\nLike [`whilst`](#whilst), except the `test` is an asynchronous function that is passed a callback in the form of `function (err, truth)`. If error is passed to `test` or `fn`, the main callback is immediately called with the value of the error.\n\n__Example__\n\n```js\nvar count = 0;\n\nasync.during(\n function (callback) {\n return callback(null, count < 5);\n },\n function (callback) {\n count++;\n setTimeout(callback, 1000);\n },\n function (err) {\n // 5 seconds have passed\n }\n);\n```\n\n---------------------------------------\n\n<a name=\"doDuring\" />\n### doDuring(fn, test, callback)\n\nThe post-check version of [`during`](#during). To reflect the difference in\nthe order of operations, the arguments `test` and `fn` are switched.\n\nAlso a version of [`doWhilst`](#doWhilst) with asynchronous `test` function.\n\n---------------------------------------\n\n<a name=\"forever\" />\n### forever(fn, [errback])\n\nCalls the asynchronous function `fn` with a callback parameter that allows it to\ncall itself again, in series, indefinitely.\n\nIf an error is passed to the callback then `errback` is called with the\nerror, and execution stops, otherwise it will never be called.\n\n```js\nasync.forever(\n function(next) {\n // next is suitable for passing to things that need a callback(err [, whatever]);\n // it will result in this function being called again.\n },\n function(err) {\n // if next is called with a value in its first parameter, it will appear\n // in here as 'err', and execution will stop.\n }\n);\n```\n\n---------------------------------------\n\n<a name=\"waterfall\" />\n### waterfall(tasks, [callback])\n\nRuns the `tasks` array of functions in series, each passing their results to the next in\nthe array. However, if any of the `tasks` pass an error to their own callback, the\nnext function is not executed, and the main `callback` is immediately called with\nthe error.\n\n__Arguments__\n\n* `tasks` - An array of functions to run, each function is passed a\n `callback(err, result1, result2, ...)` it must call on completion. The first\n argument is an error (which can be `null`) and any further arguments will be\n passed as arguments in order to the next task.\n* `callback(err, [results])` - An optional callback to run once all the functions\n have completed. This will be passed the results of the last task's callback.\n\n\n\n__Example__\n\n```js\nasync.waterfall([\n function(callback) {\n callback(null, 'one', 'two');\n },\n function(arg1, arg2, callback) {\n // arg1 now equals 'one' and arg2 now equals 'two'\n callback(null, 'three');\n },\n function(arg1, callback) {\n // arg1 now equals 'three'\n callback(null, 'done');\n }\n], function (err, result) {\n // result now equals 'done'\n});\n```\nOr, with named functions:\n\n```js\nasync.waterfall([\n myFirstFunction,\n mySecondFunction,\n myLastFunction,\n], function (err, result) {\n // result now equals 'done'\n});\nfunction myFirstFunction(callback) {\n callback(null, 'one', 'two');\n}\nfunction mySecondFunction(arg1, arg2, callback) {\n // arg1 now equals 'one' and arg2 now equals 'two'\n callback(null, 'three');\n}\nfunction myLastFunction(arg1, callback) {\n // arg1 now equals 'three'\n callback(null, 'done');\n}\n```\n\nOr, if you need to pass any argument to the first function:\n\n```js\nasync.waterfall([\n async.apply(myFirstFunction, 'zero'),\n mySecondFunction,\n myLastFunction,\n], function (err, result) {\n // result now equals 'done'\n});\nfunction myFirstFunction(arg1, callback) {\n // arg1 now equals 'zero'\n callback(null, 'one', 'two');\n}\nfunction mySecondFunction(arg1, arg2, callback) {\n // arg1 now equals 'one' and arg2 now equals 'two'\n callback(null, 'three');\n}\nfunction myLastFunction(arg1, callback) {\n // arg1 now equals 'three'\n callback(null, 'done');\n}\n```\n\n---------------------------------------\n<a name=\"compose\" />\n### compose(fn1, fn2...)\n\nCreates a function which is a composition of the passed asynchronous\nfunctions. Each function consumes the return value of the function that\nfollows. Composing functions `f()`, `g()`, and `h()` would produce the result of\n`f(g(h()))`, only this version uses callbacks to obtain the return values.\n\nEach function is executed with the `this` binding of the composed function.\n\n__Arguments__\n\n* `functions...` - the asynchronous functions to compose\n\n\n__Example__\n\n```js\nfunction add1(n, callback) {\n setTimeout(function () {\n callback(null, n + 1);\n }, 10);\n}\n\nfunction mul3(n, callback) {\n setTimeout(function () {\n callback(null, n * 3);\n }, 10);\n}\n\nvar add1mul3 = async.compose(mul3, add1);\n\nadd1mul3(4, function (err, result) {\n // result now equals 15\n});\n```\n\n---------------------------------------\n<a name=\"seq\" />\n### seq(fn1, fn2...)\n\nVersion of the compose function that is more natural to read.\nEach function consumes the return value of the previous function.\nIt is the equivalent of [`compose`](#compose) with the arguments reversed.\n\nEach function is executed with the `this` binding of the composed function.\n\n__Arguments__\n\n* `functions...` - the asynchronous functions to compose\n\n\n__Example__\n\n```js\n// Requires lodash (or underscore), express3 and dresende's orm2.\n// Part of an app, that fetches cats of the logged user.\n// This example uses `seq` function to avoid overnesting and error\n// handling clutter.\napp.get('/cats', function(request, response) {\n var User = request.models.User;\n async.seq(\n _.bind(User.get, User), // 'User.get' has signature (id, callback(err, data))\n function(user, fn) {\n user.getCats(fn); // 'getCats' has signature (callback(err, data))\n }\n )(req.session.user_id, function (err, cats) {\n if (err) {\n console.error(err);\n response.json({ status: 'error', message: err.message });\n } else {\n response.json({ status: 'ok', message: 'Cats found', data: cats });\n }\n });\n});\n```\n\n---------------------------------------\n<a name=\"applyEach\" />\n### applyEach(fns, args..., callback)\n\nApplies the provided arguments to each function in the array, calling\n`callback` after all functions have completed. If you only provide the first\nargument, then it will return a function which lets you pass in the\narguments as if it were a single function call.\n\n__Arguments__\n\n* `fns` - the asynchronous functions to all call with the same arguments\n* `args...` - any number of separate arguments to pass to the function\n* `callback` - the final argument should be the callback, called when all\n functions have completed processing\n\n\n__Example__\n\n```js\nasync.applyEach([enableSearch, updateSchema], 'bucket', callback);\n\n// partial application example:\nasync.each(\n buckets,\n async.applyEach([enableSearch, updateSchema]),\n callback\n);\n```\n\n__Related__\n\n* applyEachSeries(tasks, args..., [callback])\n\n---------------------------------------\n\n<a name=\"queue\" />\n### queue(worker, [concurrency])\n\nCreates a `queue` object with the specified `concurrency`. Tasks added to the\n`queue` are processed in parallel (up to the `concurrency` limit). If all\n`worker`s are in progress, the task is queued until one becomes available.\nOnce a `worker` completes a `task`, that `task`'s callback is called.\n\n__Arguments__\n\n* `worker(task, callback)` - An asynchronous function for processing a queued\n task, which must call its `callback(err)` argument when finished, with an\n optional `error` as an argument. If you want to handle errors from an individual task, pass a callback to `q.push()`.\n* `concurrency` - An `integer` for determining how many `worker` functions should be\n run in parallel. If omitted, the concurrency defaults to `1`. If the concurrency is `0`, an error is thrown.\n\n__Queue objects__\n\nThe `queue` object returned by this function has the following properties and\nmethods:\n\n* `length()` - a function returning the number of items waiting to be processed.\n* `started` - a function returning whether or not any items have been pushed and processed by the queue\n* `running()` - a function returning the number of items currently being processed.\n* `workersList()` - a function returning the array of items currently being processed.\n* `idle()` - a function returning false if there are items waiting or being processed, or true if not.\n* `concurrency` - an integer for determining how many `worker` functions should be\n run in parallel. This property can be changed after a `queue` is created to\n alter the concurrency on-the-fly.\n* `push(task, [callback])` - add a new task to the `queue`. Calls `callback` once\n the `worker` has finished processing the task. Instead of a single task, a `tasks` array\n can be submitted. The respective callback is used for every task in the list.\n* `unshift(task, [callback])` - add a new task to the front of the `queue`.\n* `saturated` - a callback that is called when the `queue` length hits the `concurrency` limit,\n and further tasks will be queued.\n* `empty` - a callback that is called when the last item from the `queue` is given to a `worker`.\n* `drain` - a callback that is called when the last item from the `queue` has returned from the `worker`.\n* `paused` - a boolean for determining whether the queue is in a paused state\n* `pause()` - a function that pauses the processing of tasks until `resume()` is called.\n* `resume()` - a function that resumes the processing of queued tasks when the queue is paused.\n* `kill()` - a function that removes the `drain` callback and empties remaining tasks from the queue forcing it to go idle.\n\n__Example__\n\n```js\n// create a queue object with concurrency 2\n\nvar q = async.queue(function (task, callback) {\n console.log('hello ' + task.name);\n callback();\n}, 2);\n\n\n// assign a callback\nq.drain = function() {\n console.log('all items have been processed');\n}\n\n// add some items to the queue\n\nq.push({name: 'foo'}, function (err) {\n console.log('finished processing foo');\n});\nq.push({name: 'bar'}, function (err) {\n console.log('finished processing bar');\n});\n\n// add some items to the queue (batch-wise)\n\nq.push([{name: 'baz'},{name: 'bay'},{name: 'bax'}], function (err) {\n console.log('finished processing item');\n});\n\n// add some items to the front of the queue\n\nq.unshift({name: 'bar'}, function (err) {\n console.log('finished processing bar');\n});\n```\n\n\n---------------------------------------\n\n<a name=\"priorityQueue\" />\n### priorityQueue(worker, concurrency)\n\nThe same as [`queue`](#queue) only tasks are assigned a priority and completed in ascending priority order. There are two differences between `queue` and `priorityQueue` objects:\n\n* `push(task, priority, [callback])` - `priority` should be a number. If an array of\n `tasks` is given, all tasks will be assigned the same priority.\n* The `unshift` method was removed.\n\n---------------------------------------\n\n<a name=\"cargo\" />\n### cargo(worker, [payload])\n\nCreates a `cargo` object with the specified payload. Tasks added to the\ncargo will be processed altogether (up to the `payload` limit). If the\n`worker` is in progress, the task is queued until it becomes available. Once\nthe `worker` has completed some tasks, each callback of those tasks is called.\nCheck out [these](https://camo.githubusercontent.com/6bbd36f4cf5b35a0f11a96dcd2e97711ffc2fb37/68747470733a2f2f662e636c6f75642e6769746875622e636f6d2f6173736574732f313637363837312f36383130382f62626330636662302d356632392d313165322d393734662d3333393763363464633835382e676966) [animations](https://camo.githubusercontent.com/f4810e00e1c5f5f8addbe3e9f49064fd5d102699/68747470733a2f2f662e636c6f75642e6769746875622e636f6d2f6173736574732f313637363837312f36383130312f38346339323036362d356632392d313165322d383134662d3964336430323431336266642e676966) for how `cargo` and `queue` work.\n\nWhile [queue](#queue) passes only one task to one of a group of workers\nat a time, cargo passes an array of tasks to a single worker, repeating\nwhen the worker is finished.\n\n__Arguments__\n\n* `worker(tasks, callback)` - An asynchronous function for processing an array of\n queued tasks, which must call its `callback(err)` argument when finished, with\n an optional `err` argument.\n* `payload` - An optional `integer` for determining how many tasks should be\n processed per round; if omitted, the default is unlimited.\n\n__Cargo objects__\n\nThe `cargo` object returned by this function has the following properties and\nmethods:\n\n* `length()` - A function returning the number of items waiting to be processed.\n* `payload` - An `integer` for determining how many tasks should be\n process per round. This property can be changed after a `cargo` is created to\n alter the payload on-the-fly.\n* `push(task, [callback])` - Adds `task` to the `queue`. The callback is called\n once the `worker` has finished processing the task. Instead of a single task, an array of `tasks`\n can be submitted. The respective callback is used for every task in the list.\n* `saturated` - A callback that is called when the `queue.length()` hits the concurrency and further tasks will be queued.\n* `empty` - A callback that is called when the last item from the `queue` is given to a `worker`.\n* `drain` - A callback that is called when the last item from the `queue` has returned from the `worker`.\n* `idle()`, `pause()`, `resume()`, `kill()` - cargo inherits all of the same methods and event calbacks as [`queue`](#queue)\n\n__Example__\n\n```js\n// create a cargo object with payload 2\n\nvar cargo = async.cargo(function (tasks, callback) {\n for(var i=0; i<tasks.length; i++){\n console.log('hello ' + tasks[i].name);\n }\n callback();\n}, 2);\n\n\n// add some items\n\ncargo.push({name: 'foo'}, function (err) {\n console.log('finished processing foo');\n});\ncargo.push({name: 'bar'}, function (err) {\n console.log('finished processing bar');\n});\ncargo.push({name: 'baz'}, function (err) {\n console.log('finished processing baz');\n});\n```\n\n---------------------------------------\n\n<a name=\"auto\" />\n### auto(tasks, [concurrency], [callback])\n\nDetermines the best order for running the functions in `tasks`, based on their requirements. Each function can optionally depend on other functions being completed first, and each function is run as soon as its requirements are satisfied.\n\nIf any of the functions pass an error to their callback, the `auto` sequence will stop. Further tasks will not execute (so any other functions depending on it will not run), and the main `callback` is immediately called with the error. Functions also receive an object containing the results of functions which have completed so far.\n\nNote, all functions are called with a `results` object as a second argument,\nso it is unsafe to pass functions in the `tasks` object which cannot handle the\nextra argument.\n\nFor example, this snippet of code:\n\n```js\nasync.auto({\n readData: async.apply(fs.readFile, 'data.txt', 'utf-8')\n}, callback);\n```\n\nwill have the effect of calling `readFile` with the results object as the last\nargument, which will fail:\n\n```js\nfs.readFile('data.txt', 'utf-8', cb, {});\n```\n\nInstead, wrap the call to `readFile` in a function which does not forward the\n`results` object:\n\n```js\nasync.auto({\n readData: function(cb, results){\n fs.readFile('data.txt', 'utf-8', cb);\n }\n}, callback);\n```\n\n__Arguments__\n\n* `tasks` - An object. Each of its properties is either a function or an array of\n requirements, with the function itself the last item in the array. The object's key\n of a property serves as the name of the task defined by that property,\n i.e. can be used when specifying requirements for other tasks.\n The function receives two arguments: (1) a `callback(err, result)` which must be\n called when finished, passing an `error` (which can be `null`) and the result of\n the function's execution, and (2) a `results` object, containing the results of\n the previously executed functions.\n* `concurrency` - An optional `integer` for determining the maximum number of tasks that can be run in parallel. By default, as many as possible.\n* `callback(err, results)` - An optional callback which is called when all the\n tasks have been completed. It receives the `err` argument if any `tasks`\n pass an error to their callback. Results are always returned; however, if\n an error occurs, no further `tasks` will be performed, and the results\n object will only contain partial results.\n\n\n__Example__\n\n```js\nasync.auto({\n get_data: function(callback){\n console.log('in get_data');\n // async code to get some data\n callback(null, 'data', 'converted to array');\n },\n make_folder: function(callback){\n console.log('in make_folder');\n // async code to create a directory to store a file in\n // this is run at the same time as getting the data\n callback(null, 'folder');\n },\n write_file: ['get_data', 'make_folder', function(callback, results){\n console.log('in write_file', JSON.stringify(results));\n // once there is some data and the directory exists,\n // write the data to a file in the directory\n callback(null, 'filename');\n }],\n email_link: ['write_file', function(callback, results){\n console.log('in email_link', JSON.stringify(results));\n // once the file is written let's email a link to it...\n // results.write_file contains the filename returned by write_file.\n callback(null, {'file':results.write_file, 'email':'user@example.com'});\n }]\n}, function(err, results) {\n console.log('err = ', err);\n console.log('results = ', results);\n});\n```\n\nThis is a fairly trivial example, but to do this using the basic parallel and\nseries functions would look like this:\n\n```js\nasync.parallel([\n function(callback){\n console.log('in get_data');\n // async code to get some data\n callback(null, 'data', 'converted to array');\n },\n function(callback){\n console.log('in make_folder');\n // async code to create a directory to store a file in\n // this is run at the same time as getting the data\n callback(null, 'folder');\n }\n],\nfunction(err, results){\n async.series([\n function(callback){\n console.log('in write_file', JSON.stringify(results));\n // once there is some data and the directory exists,\n // write the data to a file in the directory\n results.push('filename');\n callback(null);\n },\n function(callback){\n console.log('in email_link', JSON.stringify(results));\n // once the file is written let's email a link to it...\n callback(null, {'file':results.pop(), 'email':'user@example.com'});\n }\n ]);\n});\n```\n\nFor a complicated series of `async` tasks, using the [`auto`](#auto) function makes adding\nnew tasks much easier (and the code more readable).\n\n\n---------------------------------------\n\n<a name=\"retry\" />\n### retry([opts = {times: 5, interval: 0}| 5], task, [callback])\n\nAttempts to get a successful response from `task` no more than `times` times before\nreturning an error. If the task is successful, the `callback` will be passed the result\nof the successful task. If all attempts fail, the callback will be passed the error and\nresult (if any) of the final attempt.\n\n__Arguments__\n\n* `opts` - Can be either an object with `times` and `interval` or a number.\n * `times` - The number of attempts to make before giving up. The default is `5`.\n * `interval` - The time to wait between retries, in milliseconds. The default is `0`.\n * If `opts` is a number, the number specifies the number of times to retry, with the default interval of `0`. \n* `task(callback, results)` - A function which receives two arguments: (1) a `callback(err, result)`\n which must be called when finished, passing `err` (which can be `null`) and the `result` of\n the function's execution, and (2) a `results` object, containing the results of\n the previously executed functions (if nested inside another control flow).\n* `callback(err, results)` - An optional callback which is called when the\n task has succeeded, or after the final failed attempt. It receives the `err` and `result` arguments of the last attempt at completing the `task`.\n\nThe [`retry`](#retry) function can be used as a stand-alone control flow by passing a callback, as shown below:\n\n```js\n// try calling apiMethod 3 times\nasync.retry(3, apiMethod, function(err, result) {\n // do something with the result\n});\n```\n\n```js\n// try calling apiMethod 3 times, waiting 200 ms between each retry \nasync.retry({times: 3, interval: 200}, apiMethod, function(err, result) {\n // do something with the result\n});\n```\n\n```js\n// try calling apiMethod the default 5 times no delay between each retry \nasync.retry(apiMethod, function(err, result) {\n // do something with the result\n});\n```\n\nIt can also be embedded within other control flow functions to retry individual methods\nthat are not as reliable, like this:\n\n```js\nasync.auto({\n users: api.getUsers.bind(api),\n payments: async.retry(3, api.getPayments.bind(api))\n}, function(err, results) {\n // do something with the results\n});\n```\n\n\n---------------------------------------\n\n<a name=\"iterator\" />\n### iterator(tasks)\n\nCreates an iterator function which calls the next function in the `tasks` array,\nreturning a continuation to call the next one after that. It's also possible to\n“peek” at the next iterator with `iterator.next()`.\n\nThis function is used internally by the `async` module, but can be useful when\nyou want to manually control the flow of functions in series.\n\n__Arguments__\n\n* `tasks` - An array of functions to run.\n\n__Example__\n\n```js\nvar iterator = async.iterator([\n function(){ sys.p('one'); },\n function(){ sys.p('two'); },\n function(){ sys.p('three'); }\n]);\n\nnode> var iterator2 = iterator();\n'one'\nnode> var iterator3 = iterator2();\n'two'\nnode> iterator3();\n'three'\nnode> var nextfn = iterator2.next();\nnode> nextfn();\n'three'\n```\n\n---------------------------------------\n\n<a name=\"apply\" />\n### apply(function, arguments..)\n\nCreates a continuation function with some arguments already applied.\n\nUseful as a shorthand when combined with other control flow functions. Any arguments\npassed to the returned function are added to the arguments originally passed\nto apply.\n\n__Arguments__\n\n* `function` - The function you want to eventually apply all arguments to.\n* `arguments...` - Any number of arguments to automatically apply when the\n continuation is called.\n\n__Example__\n\n```js\n// using apply\n\nasync.parallel([\n async.apply(fs.writeFile, 'testfile1', 'test1'),\n async.apply(fs.writeFile, 'testfile2', 'test2'),\n]);\n\n\n// the same process without using apply\n\nasync.parallel([\n function(callback){\n fs.writeFile('testfile1', 'test1', callback);\n },\n function(callback){\n fs.writeFile('testfile2', 'test2', callback);\n }\n]);\n```\n\nIt's possible to pass any number of additional arguments when calling the\ncontinuation:\n\n```js\nnode> var fn = async.apply(sys.puts, 'one');\nnode> fn('two', 'three');\none\ntwo\nthree\n```\n\n---------------------------------------\n\n<a name=\"nextTick\" />\n### nextTick(callback), setImmediate(callback)\n\nCalls `callback` on a later loop around the event loop. In Node.js this just\ncalls `process.nextTick`; in the browser it falls back to `setImmediate(callback)`\nif available, otherwise `setTimeout(callback, 0)`, which means other higher priority\nevents may precede the execution of `callback`.\n\nThis is used internally for browser-compatibility purposes.\n\n__Arguments__\n\n* `callback` - The function to call on a later loop around the event loop.\n\n__Example__\n\n```js\nvar call_order = [];\nasync.nextTick(function(){\n call_order.push('two');\n // call_order now equals ['one','two']\n});\ncall_order.push('one')\n```\n\n<a name=\"times\" />\n### times(n, iterator, [callback])\n\nCalls the `iterator` function `n` times, and accumulates results in the same manner\nyou would use with [`map`](#map).\n\n__Arguments__\n\n* `n` - The number of times to run the function.\n* `iterator` - The function to call `n` times.\n* `callback` - see [`map`](#map)\n\n__Example__\n\n```js\n// Pretend this is some complicated async factory\nvar createUser = function(id, callback) {\n callback(null, {\n id: 'user' + id\n })\n}\n// generate 5 users\nasync.times(5, function(n, next){\n createUser(n, function(err, user) {\n next(err, user)\n })\n}, function(err, users) {\n // we should now have 5 users\n});\n```\n\n__Related__\n\n* timesSeries(n, iterator, [callback])\n* timesLimit(n, limit, iterator, [callback])\n\n\n## Utils\n\n<a name=\"memoize\" />\n### memoize(fn, [hasher])\n\nCaches the results of an `async` function. When creating a hash to store function\nresults against, the callback is omitted from the hash and an optional hash\nfunction can be used.\n\nIf no hash function is specified, the first argument is used as a hash key, which may work reasonably if it is a string or a data type that converts to a distinct string. Note that objects and arrays will not behave reasonably. Neither will cases where the other arguments are significant. In such cases, specify your own hash function.\n\nThe cache of results is exposed as the `memo` property of the function returned\nby `memoize`.\n\n__Arguments__\n\n* `fn` - The function to proxy and cache results from.\n* `hasher` - An optional function for generating a custom hash for storing\n results. It has all the arguments applied to it apart from the callback, and\n must be synchronous.\n\n__Example__\n\n```js\nvar slow_fn = function (name, callback) {\n // do something\n callback(null, result);\n};\nvar fn = async.memoize(slow_fn);\n\n// fn can now be used as if it were slow_fn\nfn('some name', function () {\n // callback\n});\n```\n\n<a name=\"unmemoize\" />\n### unmemoize(fn)\n\nUndoes a [`memoize`](#memoize)d function, reverting it to the original, unmemoized\nform. Handy for testing.\n\n__Arguments__\n\n* `fn` - the memoized function\n\n---------------------------------------\n\n<a name=\"ensureAsync\" />\n### ensureAsync(fn)\n\nWrap an async function and ensure it calls its callback on a later tick of the event loop. If the function already calls its callback on a next tick, no extra deferral is added. This is useful for preventing stack overflows (`RangeError: Maximum call stack size exceeded`) and generally keeping [Zalgo](http://blog.izs.me/post/59142742143/designing-apis-for-asynchrony) contained.\n\n__Arguments__\n\n* `fn` - an async function, one that expects a node-style callback as its last argument\n\nReturns a wrapped function with the exact same call signature as the function passed in.\n\n__Example__\n\n```js\nfunction sometimesAsync(arg, callback) {\n if (cache[arg]) {\n return callback(null, cache[arg]); // this would be synchronous!!\n } else {\n doSomeIO(arg, callback); // this IO would be asynchronous\n }\n}\n\n// this has a risk of stack overflows if many results are cached in a row\nasync.mapSeries(args, sometimesAsync, done);\n\n// this will defer sometimesAsync's callback if necessary,\n// preventing stack overflows\nasync.mapSeries(args, async.ensureAsync(sometimesAsync), done);\n\n```\n\n---------------------------------------\n\n<a name=\"constant\">\n### constant(values...)\n\nReturns a function that when called, calls-back with the values provided. Useful as the first function in a `waterfall`, or for plugging values in to `auto`.\n\n__Example__\n\n```js\nasync.waterfall([\n async.constant(42),\n function (value, next) {\n // value === 42\n },\n //...\n], callback);\n\nasync.waterfall([\n async.constant(filename, \"utf8\"),\n fs.readFile,\n function (fileData, next) {\n //...\n }\n //...\n], callback);\n\nasync.auto({\n hostname: async.constant(\"https://server.net/\"),\n port: findFreePort,\n launchServer: [\"hostname\", \"port\", function (cb, options) {\n startServer(options, cb);\n }],\n //...\n}, callback);\n\n```\n\n---------------------------------------\n\n<a name=\"asyncify\">\n<a name=\"wrapSync\">\n### asyncify(func)\n\n__Alias:__ `wrapSync`\n\nTake a sync function and make it async, passing its return value to a callback. This is useful for plugging sync functions into a waterfall, series, or other async functions. Any arguments passed to the generated function will be passed to the wrapped function (except for the final callback argument). Errors thrown will be passed to the callback.\n\n__Example__\n\n```js\nasync.waterfall([\n async.apply(fs.readFile, filename, \"utf8\"),\n async.asyncify(JSON.parse),\n function (data, next) {\n // data is the result of parsing the text.\n // If there was a parsing error, it would have been caught.\n }\n], callback)\n```\n\nIf the function passed to `asyncify` returns a Promise, that promises's resolved/rejected state will be used to call the callback, rather than simply the synchronous return value. Example:\n\n```js\nasync.waterfall([\n async.apply(fs.readFile, filename, \"utf8\"),\n async.asyncify(function (contents) {\n return db.model.create(contents);\n }),\n function (model, next) {\n // `model` is the instantiated model object. \n // If there was an error, this function would be skipped.\n }\n], callback)\n```\n\nThis also means you can asyncify ES2016 `async` functions.\n\n```js\nvar q = async.queue(async.asyncify(async function (file) {\n var intermediateStep = await processFile(file);\n return await somePromise(intermediateStep)\n}));\n\nq.push(files);\n```\n\n---------------------------------------\n\n<a name=\"log\" />\n### log(function, arguments)\n\nLogs the result of an `async` function to the `console`. Only works in Node.js or\nin browsers that support `console.log` and `console.error` (such as FF and Chrome).\nIf multiple arguments are returned from the async function, `console.log` is\ncalled on each argument in order.\n\n__Arguments__\n\n* `function` - The function you want to eventually apply all arguments to.\n* `arguments...` - Any number of arguments to apply to the function.\n\n__Example__\n\n```js\nvar hello = function(name, callback){\n setTimeout(function(){\n callback(null, 'hello ' + name);\n }, 1000);\n};\n```\n```js\nnode> async.log(hello, 'world');\n'hello world'\n```\n\n---------------------------------------\n\n<a name=\"dir\" />\n### dir(function, arguments)\n\nLogs the result of an `async` function to the `console` using `console.dir` to\ndisplay the properties of the resulting object. Only works in Node.js or\nin browsers that support `console.dir` and `console.error` (such as FF and Chrome).\nIf multiple arguments are returned from the async function, `console.dir` is\ncalled on each argument in order.\n\n__Arguments__\n\n* `function` - The function you want to eventually apply all arguments to.\n* `arguments...` - Any number of arguments to apply to the function.\n\n__Example__\n\n```js\nvar hello = function(name, callback){\n setTimeout(function(){\n callback(null, {hello: name});\n }, 1000);\n};\n```\n```js\nnode> async.dir(hello, 'world');\n{hello: 'world'}\n```\n\n---------------------------------------\n\n<a name=\"noConflict\" />\n### noConflict()\n\nChanges the value of `async` back to its original value, returning a reference to the\n`async` object.\n",
|
|
129
|
+
"readmeFilename": "README.md",
|
|
129
130
|
"repository": {
|
|
130
131
|
"type": "git",
|
|
131
132
|
"url": "git+https://github.com/caolan/async.git"
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
"spec": ">=6.22.0 <7.0.0",
|
|
11
11
|
"type": "range"
|
|
12
12
|
},
|
|
13
|
-
"/Users/benjamincoe/
|
|
13
|
+
"/Users/benjamincoe/oss/nyc/node_modules/babel-traverse"
|
|
14
14
|
]
|
|
15
15
|
],
|
|
16
16
|
"_from": "babel-code-frame@>=6.22.0 <7.0.0",
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
"_shasum": "027620bee567a88c32561574e7fd0801d33118e4",
|
|
45
45
|
"_shrinkwrap": null,
|
|
46
46
|
"_spec": "babel-code-frame@^6.22.0",
|
|
47
|
-
"_where": "/Users/benjamincoe/
|
|
47
|
+
"_where": "/Users/benjamincoe/oss/nyc/node_modules/babel-traverse",
|
|
48
48
|
"author": {
|
|
49
49
|
"name": "Sebastian McKenzie",
|
|
50
50
|
"email": "sebmck@gmail.com"
|
|
@@ -92,7 +92,8 @@
|
|
|
92
92
|
],
|
|
93
93
|
"name": "babel-code-frame",
|
|
94
94
|
"optionalDependencies": {},
|
|
95
|
-
"readme": "
|
|
95
|
+
"readme": "# babel-code-frame\n\n> Generate errors that contain a code frame that point to source locations.\n\n## Install\n\n```sh\nnpm install --save-dev babel-code-frame\n```\n\n## Usage\n\n```js\nimport codeFrame from 'babel-code-frame';\n\nconst rawLines = `class Foo {\n constructor()\n}`;\nconst lineNumber = 2;\nconst colNumber = 16;\n\nconst result = codeFrame(rawLines, lineNumber, colNumber, { /* options */ });\n\nconsole.log(result);\n```\n\n```sh\n 1 | class Foo {\n> 2 | constructor()\n | ^\n 3 | }\n```\n\nIf the column number is not known, you may pass `null` instead.\n\n## Options\n\nname | type | default | description\n-----------------------|----------|-----------------|------------------------------------------------------\nhighlightCode | boolean | `false` | Syntax highlight the code as JavaScript for terminals\nlinesAbove | number | 2 | The number of lines to show above the error\nlinesBelow | number | 3 | The number of lines to show below the error\nforceColor | boolean | `false` | Forcibly syntax highlight the code as JavaScript (for non-terminals); overrides highlightCode\n",
|
|
96
|
+
"readmeFilename": "README.md",
|
|
96
97
|
"repository": {
|
|
97
98
|
"type": "git",
|
|
98
99
|
"url": "https://github.com/babel/babel/tree/master/packages/babel-code-frame"
|