Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

OS-4691: normalize package.json's under src/img/node_modules to reduc…

…e noise in 'make update_modules'
commit 2af7be92f8fd38dd516d35554e3bd5004bc04074 1 parent f2cb5fe
@trentm trentm authored
Showing with 83 additions and 324 deletions.
  1. +1 −10 src/img/node_modules/assert-plus/package.json
  2. +1 −7 src/img/node_modules/async/package.json
  3. +3 −10 src/img/node_modules/backoff/node_modules/precond/package.json
  4. +1 −6 src/img/node_modules/backoff/package.json
  5. +1 −6 src/img/node_modules/bunyan/package.json
  6. +1 −6 src/img/node_modules/cmdln/node_modules/dashdash/package.json
  7. +1 −6 src/img/node_modules/cmdln/package.json
  8. +1 −11 src/img/node_modules/docker-registry-client/node_modules/strsplit/package.json
  9. +1 −7 src/img/node_modules/docker-registry-client/node_modules/tough-cookie/node_modules/punycode/package.json
  10. +1 −7 src/img/node_modules/docker-registry-client/node_modules/tough-cookie/package.json
  11. +1 −7 src/img/node_modules/docker-registry-client/package.json
  12. +1 −6 src/img/node_modules/extsprintf/package.json
  13. +1 −7 src/img/node_modules/findit/package.json
  14. +1 −7 src/img/node_modules/imgmanifest/package.json
  15. +1 −7 src/img/node_modules/mkdirp/package.json
  16. +1 −8 src/img/node_modules/node-uuid/package.json
  17. +7 −21 src/img/node_modules/nodeunit/package.json
  18. +1 −10 src/img/node_modules/once/node_modules/wrappy/package.json
  19. +1 −10 src/img/node_modules/once/package.json
  20. +1 −10 src/img/node_modules/progbar/node_modules/sprintf/package.json
  21. +1 −7 src/img/node_modules/progbar/package.json
  22. +1 −9 src/img/node_modules/restify/node_modules/keep-alive-agent/package.json
  23. +4 −13 src/img/node_modules/restify/node_modules/lru-cache/package.json
  24. +1 −27 src/img/node_modules/restify/node_modules/mime/package.json
  25. +1 −7 src/img/node_modules/restify/node_modules/semver/package.json
  26. +3 −7 src/img/node_modules/restify/node_modules/tunnel-agent/package.json
  27. +4 −16 src/img/node_modules/restify/package.json
  28. +1 −7 src/img/node_modules/rimraf/package.json
  29. +6 −6 src/img/node_modules/sdc-clients/node_modules/async/package.json
  30. +1 −9 src/img/node_modules/sdc-clients/node_modules/lru-cache/package.json
  31. +2 −7 src/img/node_modules/sdc-clients/node_modules/ssh-agent/node_modules/ctype/package.json
  32. +2 −12 src/img/node_modules/sdc-clients/node_modules/ssh-agent/package.json
  33. +1 −7 src/img/node_modules/sdc-clients/package.json
  34. +1 −7 src/img/node_modules/tabula/package.json
  35. +1 −7 src/img/node_modules/vasync/package.json
  36. +1 −7 src/img/node_modules/verror/package.json
  37. +24 −0 src/img/tools/update-node-modules.sh
View
11 src/img/node_modules/assert-plus/package.json
@@ -6,7 +6,6 @@
"name": "assert-plus",
"description": "Extra assertions on top of node's assert module",
"version": "0.1.5",
- "license": "MIT",
"main": "./assert.js",
"devDependencies": {},
"optionalDependencies": {},
@@ -17,16 +16,8 @@
"engines": {
"node": ">=0.8"
},
- "readme": "# node-assert-plus\n\nThis library is a super small wrapper over node's assert module that has two\nthings: (1) the ability to disable assertions with the environment variable\nNODE_NDEBUG, and (2) some API wrappers for argument testing. Like\n`assert.string(myArg, 'myArg')`. As a simple example, most of my code looks\nlike this:\n\n var assert = require('assert-plus');\n\n function fooAccount(options, callback) {\n\t assert.object(options, 'options');\n\t\tassert.number(options.id, 'options.id);\n\t\tassert.bool(options.isManager, 'options.isManager');\n\t\tassert.string(options.name, 'options.name');\n\t\tassert.arrayOfString(options.email, 'options.email');\n\t\tassert.func(callback, 'callback');\n\n // Do stuff\n\t\tcallback(null, {});\n }\n\n# API\n\nAll methods that *aren't* part of node's core assert API are simply assumed to\ntake an argument, and then a string 'name' that's not a message; `AssertionError`\nwill be thrown if the assertion fails with a message like:\n\n AssertionError: foo (string) is required\n\tat test (/home/mark/work/foo/foo.js:3:9)\n\tat Object.<anonymous> (/home/mark/work/foo/foo.js:15:1)\n\tat Module._compile (module.js:446:26)\n\tat Object..js (module.js:464:10)\n\tat Module.load (module.js:353:31)\n\tat Function._load (module.js:311:12)\n\tat Array.0 (module.js:484:10)\n\tat EventEmitter._tickCallback (node.js:190:38)\n\nfrom:\n\n function test(foo) {\n\t assert.string(foo, 'foo');\n }\n\nThere you go. You can check that arrays are of a homogenous type with `Arrayof$Type`:\n\n function test(foo) {\n\t assert.arrayOfString(foo, 'foo');\n }\n\nYou can assert IFF an argument is not `undefined` (i.e., an optional arg):\n\n assert.optionalString(foo, 'foo');\n\nLastly, you can opt-out of assertion checking altogether by setting the\nenvironment variable `NODE_NDEBUG=1`. This is pseudo-useful if you have\nlots of assertions, and don't want to pay `typeof ()` taxes to v8 in\nproduction.\n\nThe complete list of APIs is:\n\n* assert.bool\n* assert.buffer\n* assert.func\n* assert.number\n* assert.object\n* assert.string\n* assert.arrayOfBool\n* assert.arrayOfFunc\n* assert.arrayOfNumber\n* assert.arrayOfObject\n* assert.arrayOfString\n* assert.optionalBool\n* assert.optionalBuffer\n* assert.optionalFunc\n* assert.optionalNumber\n* assert.optionalObject\n* assert.optionalString\n* assert.optionalArrayOfBool\n* assert.optionalArrayOfFunc\n* assert.optionalArrayOfNumber\n* assert.optionalArrayOfObject\n* assert.optionalArrayOfString\n* assert.AssertionError\n* assert.fail\n* assert.ok\n* assert.equal\n* assert.notEqual\n* assert.deepEqual\n* assert.notDeepEqual\n* assert.strictEqual\n* assert.notStrictEqual\n* assert.throws\n* assert.doesNotThrow\n* assert.ifError\n\n# Installation\n\n npm install assert-plus\n\n## License\n\nThe MIT License (MIT)\nCopyright (c) 2012 Mark Cavage\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of\nthis software and associated documentation files (the \"Software\"), to deal in\nthe Software without restriction, including without limitation the rights to\nuse, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\nthe Software, and to permit persons to whom the Software is furnished to do so,\nsubject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n\n## Bugs\n\nSee <https://github.com/mcavage/node-assert-plus/issues>.\n",
- "readmeFilename": "README.md",
"bugs": {
"url": "https://github.com/mcavage/node-assert-plus/issues"
},
- "homepage": "https://github.com/mcavage/node-assert-plus",
- "dependencies": {},
- "_id": "assert-plus@0.1.5",
- "_shasum": "4ea19697383c52cd0b85c676308be0faf7bb5e80",
- "_resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-0.1.5.tgz",
- "_from": "assert-plus@0.1.5",
- "scripts": {}
+ "dependencies": {}
}
View
8 src/img/node_modules/async/package.json
@@ -35,11 +35,5 @@
"scripts": {
"test": "nodeunit test/test-async.js"
},
- "readme": "# Async.js\n\n[![Build Status via Travis CI](https://travis-ci.org/caolan/async.svg?branch=master)](https://travis-ci.org/caolan/async)\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), it can also be used directly in the\nbrowser. Also supports [component](https://github.com/component/component).\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\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](http://github.com/caolan/async).\nAlternatively, you can install using Node Package Manager (`npm`):\n\n npm 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\n### Collections\n\n* [`each`](#each)\n* [`eachSeries`](#eachSeries)\n* [`eachLimit`](#eachLimit)\n* [`map`](#map)\n* [`mapSeries`](#mapSeries)\n* [`mapLimit`](#mapLimit)\n* [`filter`](#filter)\n* [`filterSeries`](#filterSeries)\n* [`reject`](#reject)\n* [`rejectSeries`](#rejectSeries)\n* [`reduce`](#reduce)\n* [`reduceRight`](#reduceRight)\n* [`detect`](#detect)\n* [`detectSeries`](#detectSeries)\n* [`sortBy`](#sortBy)\n* [`some`](#some)\n* [`every`](#every)\n* [`concat`](#concat)\n* [`concatSeries`](#concatSeries)\n\n### Control Flow\n\n* [`series`](#seriestasks-callback)\n* [`parallel`](#parallel)\n* [`parallelLimit`](#parallellimittasks-limit-callback)\n* [`whilst`](#whilst)\n* [`doWhilst`](#doWhilst)\n* [`until`](#until)\n* [`doUntil`](#doUntil)\n* [`forever`](#forever)\n* [`waterfall`](#waterfall)\n* [`compose`](#compose)\n* [`seq`](#seq)\n* [`applyEach`](#applyEach)\n* [`applyEachSeries`](#applyEachSeries)\n* [`queue`](#queue)\n* [`priorityQueue`](#priorityQueue)\n* [`cargo`](#cargo)\n* [`auto`](#auto)\n* [`retry`](#retry)\n* [`iterator`](#iterator)\n* [`apply`](#apply)\n* [`nextTick`](#nextTick)\n* [`times`](#times)\n* [`timesSeries`](#timesSeries)\n\n### Utils\n\n* [`memoize`](#memoize)\n* [`unmemoize`](#unmemoize)\n* [`log`](#log)\n* [`dir`](#dir)\n* [`noConflict`](#noConflict)\n\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 occured, the `callback` should be run without \n arguments or with an explicit `null` argument.\n* `callback(err)` - 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---------------------------------------\n\n<a name=\"forEachSeries\" />\n<a name=\"eachSeries\" />\n### eachSeries(arr, iterator, callback)\n\nThe same as [`each`](#each), only `iterator` is applied to each item in `arr` in\nseries. The next `iterator` is only called once the current one has completed. \nThis means the `iterator` functions will complete in order.\n\n\n---------------------------------------\n\n<a name=\"forEachLimit\" />\n<a name=\"eachLimit\" />\n### eachLimit(arr, limit, iterator, callback)\n\nThe same as [`each`](#each), only no more than `limit` `iterator`s will be simultaneously \nrunning at any time.\n\nNote that the items in `arr` are not processed in batches, so there is no guarantee that \nthe first `limit` `iterator` functions will complete before any others are started.\n\n__Arguments__\n\n* `arr` - An array to iterate over.\n* `limit` - The maximum number of `iterator`s to run at any time.\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 occured, the callback should be run without \n arguments or with an explicit `null` argument.\n* `callback(err)` - A callback which is called when all `iterator` functions\n have finished, or an error occurs.\n\n__Example__\n\n```js\n// Assume documents is an array of JSON objects and requestApi is a\n// function that interacts with a rate-limited REST api.\n\nasync.eachLimit(documents, 20, requestApi, function(err){\n // if any of the saves produced an error, err would equal that error\n});\n```\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 this \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)` - 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---------------------------------------\n\n<a name=\"mapSeries\" />\n### mapSeries(arr, iterator, callback)\n\nThe same as [`map`](#map), only the `iterator` is applied to each item in `arr` in\nseries. The next `iterator` is only called once the current one has completed. \nThe results array will be in the same order as the original.\n\n\n---------------------------------------\n\n<a name=\"mapLimit\" />\n### mapLimit(arr, limit, iterator, callback)\n\nThe same as [`map`](#map), only no more than `limit` `iterator`s will be simultaneously \nrunning at any time.\n\nNote that the items are not processed in batches, so there is no guarantee that \nthe first `limit` `iterator` functions will complete before any others are started.\n\n__Arguments__\n\n* `arr` - An array to iterate over.\n* `limit` - The maximum number of `iterator`s to run at any time.\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)` - A callback which is called when all `iterator`\n calls have finished, or an error occurs. The result is an array of the\n transformed items from the original `arr`.\n\n__Example__\n\n```js\nasync.mapLimit(['file1','file2','file3'], 1, fs.stat, function(err, results){\n // results is now an array of stats for each file\n});\n```\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)` - 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---------------------------------------\n\n<a name=\"selectSeries\" />\n<a name=\"filterSeries\" />\n### filterSeries(arr, iterator, callback)\n\n__Alias:__ `selectSeries`\n\nThe same as [`filter`](#filter) only the `iterator` is applied to each item in `arr` in\nseries. The next `iterator` is only called once the current one has completed. \nThe results array will be in the same order as the original.\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---------------------------------------\n\n<a name=\"rejectSeries\" />\n### rejectSeries(arr, iterator, callback)\n\nThe same as [`reject`](#reject), only the `iterator` is applied to each item in `arr`\nin series.\n\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)` - 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.\n* `callback(result)` - 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.\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---------------------------------------\n\n<a name=\"detectSeries\" />\n### detectSeries(arr, iterator, callback)\n\nThe same as [`detect`](#detect), only the `iterator` is applied to each item in `arr`\nin series. This means the result is always the first in the original `arr` (in\nterms of array order) that passes the truth test.\n\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)` - 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(err, x);\n}, function(err,result){\n //result callback\n} );\n\n//descending order\nasync.sortBy([1,9,3,5], function(x, callback){\n callback(err, 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)` - 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__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---------------------------------------\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)` - A callback which is called after all the `iterator`\n functions have finished. Result will be either `true` or `false` depending on\n the values of the async tests.\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---------------------------------------\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)` - 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---------------------------------------\n\n<a name=\"concatSeries\" />\n### concatSeries(arr, iterator, callback)\n\nSame as [`concat`](#concat), but executes in series instead of parallel.\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 Specifcation](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\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. 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---------------------------------------\n\n<a name=\"parallelLimit\" />\n### parallelLimit(tasks, limit, [callback])\n\nThe same as [`parallel`](#parallel), only `tasks` are executed in parallel \nwith a maximum of `limit` tasks executing at any time.\n\nNote that the `tasks` are not executed in batches, so there is no guarantee that \nthe first `limit` tasks will complete before any others are started.\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* `limit` - The maximum number of `tasks` to run at any time.\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---------------------------------------\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)` - A callback which is called after the test fails and repeated\n execution of `fn` has stopped.\n\n__Example__\n\n```js\nvar count = 0;\n\nasync.whilst(\n function () { return count < 5; },\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=\"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.\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=\"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```\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 following function consumes the return value of the latter function. \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 function handleError(err, data, callback) {\n if (err) {\n console.error(err);\n response.json({ status: 'error', message: err.message });\n }\n else {\n callback(data);\n }\n }\n var User = request.models.User;\n async.seq(\n _.bind(User.get, User), // 'User.get' has signature (id, callback(err, data))\n handleError,\n function(user, fn) {\n user.getCats(fn); // 'getCats' has signature (callback(err, data))\n },\n handleError,\n function(cats) {\n response.json({ status: 'ok', message: 'Cats found', data: cats });\n }\n )(req.session.user_id);\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---------------------------------------\n\n<a name=\"applyEachSeries\" />\n### applyEachSeries(arr, iterator, callback)\n\nThe same as [`applyEach`](#applyEach) only the functions are applied in series.\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.\n* `concurrency` - An `integer` for determining how many `worker` functions should be\n run in parallel.\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* `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 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 bar');\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 [this animation](https://camo.githubusercontent.com/6bbd36f4cf5b35a0f11a96dcd2e97711ffc2fb37/68747470733a2f2f662e636c6f75642e6769746875622e636f6d2f6173736574732f313637363837312f36383130382f62626330636662302d356632392d313165322d393734662d3333393763363464633835382e676966) 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\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, [callback])\n\nDetermines the best order for running the functions in `tasks`, based on their \nrequirements. Each function can optionally depend on other functions being completed \nfirst, and each function is run as soon as its requirements are satisfied. \n\nIf any of the functions pass an error to their callback, it will not \ncomplete (so any other functions depending on it will not run), and the main \n`callback` is immediately called with the error. Functions also receive an \nobject 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* `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([times = 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 successfull task. If all attemps fail, the callback will be passed the error and\nresult (if any) of the final attempt.\n\n__Arguments__\n\n* `times` - An integer indicating how many times to attempt the `task` before giving up. Defaults to 5.\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\ncallback, as shown below:\n\n```js\nasync.retry(3, apiMethod, function(err, result) {\n // do something with the result\n});\n```\n\nIt can also be embeded 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)\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, callback)\n\nCalls the `callback` 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* `callback` - The function to call `n` times.\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<a name=\"timesSeries\" />\n### timesSeries(n, callback)\n\nThe same as [`times`](#times), only the iterator is applied to each item in `arr` in\nseries. The next `iterator` is only called once the current one has completed. \nThe results array will be in the same order as the original.\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\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` - Tn 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<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",
- "readmeFilename": "README.md",
- "homepage": "https://github.com/caolan/async",
- "_id": "async@0.9.0",
- "_shasum": "ac3613b1da9bed1b47510bb4651b8931e47146c7",
- "_from": "async@0.9.0",
- "_resolved": "https://registry.npmjs.org/async/-/async-0.9.0.tgz"
+ "homepage": "https://github.com/caolan/async"
}
View
13 src/img/node_modules/backoff/node_modules/precond/package.json
@@ -22,8 +22,8 @@
"jshint": "2.5"
},
"scripts": {
- "pretest": "jshint lib/ examples/ index.js",
- "test": "nodeunit tests/"
+ "pretest": "node_modules/.bin/jshint lib/ examples/ index.js",
+ "test": "node_modules/.bin/nodeunit tests/"
},
"engines": {
"node": ">= 0.6"
@@ -32,14 +32,7 @@
"index.js",
"lib"
],
- "readme": "# Preconditions for Node.js\n[![Build Status](https://secure.travis-ci.org/MathieuTurcotte/node-precond.png?branch=master)](https://travis-ci.org/MathieuTurcotte/node-precond)\n[![NPM version](https://badge.fury.io/js/precond.png)](http://badge.fury.io/js/precond)\n\nPrecondition checks for Node.js inspired by [Guava's precondition checking\nutilities](https://code.google.com/p/guava-libraries/wiki/PreconditionsExplained).\n\n## Installation\n\n```\nnpm install precond\n```\n\n## Unit tests\n\n```\nnpm test\n```\n\n## Overview\n\nPrecond provides a set of functions to verify arguments and state correctness\n\nIt lets you rewrite constructs like the following\n\n```js\nif (!this.isConnected) {\n throw new Error('Client should be connected before calling X.');\n}\n```\n\ninto a more compact and declarative check bellow.\n\n```js\nprecond.checkState(this.isConnected, 'Client should be ...');\n```\n\n**Note that even though the throw statement is wrapped in a function, the call\nstack will still start from the calling function. So the previous examples would\nboth produce the same stack trace.**\n\nAll arguments after the message will be used to format the actual error\nmessage that will be thrown.\n\nThe following precondition checks are provded:\n\n- checkArgument(value, [messageFormat, [formatArgs, ...]])\n- checkState(value, [messageFormat, [formatArgs, ...]])\n- checkIsDef(value, [messageFormat, [formatArgs, ...]]) -> value\n- checkIsDefAndNotNull(value, [messageFormat, [formatArgs, ...]]) -> value\n- checkIsString(value, [messageFormat, [formatArgs, ...]]) -> value\n- checkIsArray(value, [messageFormat, [formatArgs, ...]]) -> value\n- checkIsNumber(value, [messageFormat, [formatArgs, ...]]) -> value\n- checkIsBoolean(value, [messageFormat, [formatArgs, ...]]) -> value\n- checkIsFunction(value, [messageFormat, [formatArgs, ...]]) -> value\n- checkIsObject(value, [messageFormat, [formatArgs, ...]]) -> value\n\n## API\n\n### Static functions\n\n#### precond.checkArgument(value, [messageFormat, [formatArgs, ...]])\n\n- value: the value that is required to be truthy\n- messageFormat: error message format template\n- formatArgs: arguments to be substituted into the message template\n\nEnsures that value is true. Throws an `IllegalArgumentError` if value\nis false.\n\n#### precond.checkState(value, [messageFormat, [formatArgs, ...]])\n\n- value: the value that is required to be truthy\n- messageFormat: error message format template\n- formatArgs: arguments to be substituted into the message template\n\nEnsures that value is true. Throws an `IllegalStateError` if value\nis false.\n\n#### precond.checkIsDef(value, [messageFormat, [formatArgs, ...]])\n\n- value: the value that is required to be defined\n- messageFormat: error message format template\n- formatArgs: arguments to be substituted into the message template\n\nEnsures that value is defined (could be null). Throws an\n`IllegalArgumentError` if value is undefined. Returns the value of\nthe value that was validated.\n\n#### precond.checkIsDefAndNotNull(value, [messageFormat, [formatArgs, ...]])\n\n- value: the value that is required to be defined and not null\n- messageFormat: error message format template\n- formatArgs: arguments to be substituted into the message template\n\nEnsures that value is defined and not null. Throws an\n`IllegalArgumentError` if value is undefined or null. Returns the value of\nthe value that was validated.\n\n#### precond.checkIsString(value, [messageFormat, [formatArgs, ...]])\n\n- value: the value that is required to be a string\n- messageFormat: error message format template\n- formatArgs: arguments to be substituted into the message template\n\nEnsures that value is a string or a String object. Throws an\n`IllegalArgumentError` if value isn't a string. Returns the value of\nthe value that was validated.\n\n#### precond.checkIsArray(value, [messageFormat, [formatArgs, ...]])\n\n- value: the value that is required to be an array\n- messageFormat: error message format template\n- formatArgs: arguments to be substituted into the message template\n\nEnsures that value is an array. Throws an `IllegalArgumentError` if\nvalue isn't an array. Returns the value of the value that was\nvalidated.\n\n#### precond.checkIsNumber(value, [messageFormat, [formatArgs, ...]])\n\n- value: the value that is required to be a number\n- messageFormat: error message format template\n- formatArgs: arguments to be substituted into the message template\n\nEnsures that value is a number. Throws an `IllegalArgumentError` if\nvalue isn't a number. Returns the value of the value that was\nvalidated.\n\n#### precond.checkIsBoolean(value, [messageFormat, [formatArgs, ...]])\n\n- value: the value that is required to be a boolean\n- messageFormat: error message format template\n- formatArgs: arguments to be substituted into the message template\n\nEnsures that value is a boolean. Throws an `IllegalArgumentError` if\nvalue isn't a boolean. Returns the value of the value that was\nvalidated.\n\n#### precond.checkIsFunction(value, [messageFormat, [formatArgs, ...]])\n\n- value: the value that is required to be a function\n- messageFormat: error message format template\n- formatArgs: arguments to be substituted into the message template\n\nEnsures that value is a function. Throws an `IllegalArgumentError` if\nvalue isn't a function. Returns the value of the value that was\nvalidated.\n\n#### precond.checkIsObject(value, [messageFormat, [formatArgs, ...]])\n\n- value: the value that is required to be an object\n- messageFormat: error message format template\n- formatArgs: arguments to be substituted into the message template\n\nEnsures that value is an object. Throws an `IllegalArgumentError` if\nvalue isn't an object. Returns the value of the value that was\nvalidated.\n\n### Class precond.IllegalArgumentError\n\nExtends `Error` and is thrown to signal illegal arguments.\n\n### Class precond.IllegalStateError\n\nExtends `Error` and is thrown to signal that the program or object has reached\nan illegal state.\n\n## License\n\nThis code is free to use under the terms of the [MIT license](http://mturcotte.mit-license.org/).\n",
- "readmeFilename": "README.md",
"bugs": {
"url": "https://github.com/MathieuTurcotte/node-precond/issues"
- },
- "homepage": "https://github.com/MathieuTurcotte/node-precond",
- "_id": "precond@0.2.3",
- "_shasum": "aa9591bcaa24923f1e0f4849d240f47efc1075ac",
- "_from": "precond@0.2",
- "_resolved": "https://registry.npmjs.org/precond/-/precond-0.2.3.tgz"
+ }
}
View
7 src/img/node_modules/backoff/package.json
@@ -36,12 +36,7 @@
"index.js",
"lib"
],
- "readme": "# Backoff for Node.js\n[![Build Status](https://secure.travis-ci.org/MathieuTurcotte/node-backoff.png?branch=master)](http://travis-ci.org/MathieuTurcotte/node-backoff)\n[![NPM version](https://badge.fury.io/js/backoff.png)](http://badge.fury.io/js/backoff)\n\nFibonacci and exponential backoffs for Node.js.\n\n## Installation\n\n```\nnpm install backoff\n```\n\n## Unit tests\n\n```\nnpm test\n```\n\n## Usage\n\n### Object Oriented\n\nThe usual way to instantiate a new `Backoff` object is to use one predefined\nfactory method: `backoff.fibonacci([options])`, `backoff.exponential([options])`.\n\n`Backoff` inherits from `EventEmitter`. When a backoff starts, a `backoff`\nevent is emitted and, when a backoff ends, a `ready` event is emitted.\nHandlers for these two events are called with the current backoff number and\ndelay.\n\n``` js\nvar backoff = require('backoff');\n\nvar fibonacciBackoff = backoff.fibonacci({\n randomisationFactor: 0,\n initialDelay: 10,\n maxDelay: 300\n});\n\nfibonacciBackoff.failAfter(10);\n\nfibonacciBackoff.on('backoff', function(number, delay) {\n // Do something when backoff starts, e.g. show to the\n // user the delay before next reconnection attempt.\n console.log(number + ' ' + delay + 'ms');\n});\n\nfibonacciBackoff.on('ready', function(number, delay) {\n // Do something when backoff ends, e.g. retry a failed\n // operation (DNS lookup, API call, etc.). If it fails\n // again then backoff, otherwise reset the backoff\n // instance.\n fibonacciBackoff.backoff();\n});\n\nfibonacciBackoff.on('fail', function() {\n // Do something when the maximum number of backoffs is\n // reached, e.g. ask the user to check its connection.\n console.log('fail');\n});\n\nfibonacciBackoff.backoff();\n```\n\nThe previous example would print the following.\n\n```\n0 10ms\n1 10ms\n2 20ms\n3 30ms\n4 50ms\n5 80ms\n6 130ms\n7 210ms\n8 300ms\n9 300ms\nfail\n```\n\nNote that `Backoff` objects are meant to be instantiated once and reused\nseveral times by calling `reset` after a successful \"retry\".\n\n### Functional\n\nIt's also possible to avoid some boilerplate code when invoking an asynchronous\nfunction in a backoff loop by using `backoff.call(fn, [args, ...], callback)`.\n\nTypical usage looks like the following.\n\n``` js\nvar call = backoff.call(get, 'https://duplika.ca/', function(err, res) {\n console.log('Num retries: ' + call.getNumRetries());\n\n if (err) {\n console.log('Error: ' + err.message);\n } else {\n console.log('Status: ' + res.statusCode);\n }\n});\n\ncall.setStrategy(new backoff.ExponentialStrategy());\ncall.failAfter(10);\ncall.start();\n```\n\n## API\n\n### backoff.fibonacci([options])\n\nConstructs a Fibonacci backoff (10, 10, 20, 30, 50, etc.).\n\nSee bellow for options description.\n\n### backoff.exponential([options])\n\nConstructs an exponential backoff (10, 20, 40, 80, etc.).\n\nThe options are the following.\n\n- randomisationFactor: defaults to 0, must be between 0 and 1\n- initialDelay: defaults to 100 ms\n- maxDelay: defaults to 10000 ms\n\nWith these values, the backoff delay will increase from 100 ms to 10000 ms. The\nrandomisation factor controls the range of randomness and must be between 0\nand 1. By default, no randomisation is applied on the backoff delay.\n\n### backoff.call(fn, [args, ...], callback)\n\n- fn: function to call in a backoff handler, i.e. the wrapped function\n- args: function's arguments\n- callback: function's callback accepting an error as its first argument\n\nConstructs a `FunctionCall` instance for the given function. The wrapped\nfunction will get retried until it succeds or reaches the maximum number\nof backoffs. In both cases, the callback function will be invoked with the\nlast result returned by the wrapped function.\n\nIt is the caller's responsability to initiate the call by invoking the\n`start` method on the returned `FunctionCall` instance.\n\n### Class Backoff\n\n#### new Backoff(strategy)\n\n- strategy: the backoff strategy to use\n\nConstructs a new backoff object from a specific backoff strategy. The backoff\nstrategy must implement the `BackoffStrategy`interface defined bellow.\n\n#### backoff.failAfter(numberOfBackoffs)\n\n- numberOfBackoffs: maximum number of backoffs before the fail event gets\nemitted, must be greater than 0\n\nSets a limit on the maximum number of backoffs that can be performed before\na fail event gets emitted and the backoff instance is reset. By default, there\nis no limit on the number of backoffs that can be performed.\n\n#### backoff.backoff([err])\n\nStarts a backoff operation. If provided, the error parameter will be emitted\nas the last argument of the `backoff` and `fail` events to let the listeners\nknow why the backoff operation was attempted.\n\nAn error will be thrown an error if a backoff operation is already in progress.\n\nIn practice, this method should be called after a failed attempt to perform a\nsensitive operation (connecting to a database, downloading a resource over the\nnetwork, etc.).\n\n#### backoff.reset()\n\nResets the backoff delay to the initial backoff delay and stop any backoff\noperation in progress. After reset, a backoff instance can and should be\nreused.\n\nIn practice, this method should be called after having successfully completed\nthe sensitive operation guarded by the backoff instance or if the client code\nrequest to stop any reconnection attempt.\n\n#### Event: 'backoff'\n\n- number: number of backoffs since last reset, starting at 0\n- delay: backoff delay in milliseconds\n- err: optional error parameter passed to `backoff.backoff([err])`\n\nEmitted when a backoff operation is started. Signals to the client how long\nthe next backoff delay will be.\n\n#### Event: 'ready'\n\n- number: number of backoffs since last reset, starting at 0\n- delay: backoff delay in milliseconds\n\nEmitted when a backoff operation is done. Signals that the failing operation\nshould be retried.\n\n#### Event: 'fail'\n\n- err: optional error parameter passed to `backoff.backoff([err])`\n\nEmitted when the maximum number of backoffs is reached. This event will only\nbe emitted if the client has set a limit on the number of backoffs by calling\n`backoff.failAfter(numberOfBackoffs)`. The backoff instance is automatically\nreset after this event is emitted.\n\n### Interface BackoffStrategy\n\nA backoff strategy must provide the following methods.\n\n#### strategy.next()\n\nComputes and returns the next backoff delay.\n\n#### strategy.reset()\n\nResets the backoff delay to its initial value.\n\n### Class ExponentialStrategy\n\nExponential (10, 20, 40, 80, etc.) backoff strategy implementation.\n\n#### new ExponentialStrategy([options])\n\nThe options are the following.\n\n- randomisationFactor: defaults to 0, must be between 0 and 1\n- initialDelay: defaults to 100 ms\n- maxDelay: defaults to 10000 ms\n\n### Class FibonacciStrategy\n\nFibonnaci (10, 10, 20, 30, 50, etc.) backoff strategy implementation.\n\n#### new FibonacciStrategy([options])\n\nThe options are the following.\n\n- randomisationFactor: defaults to 0, must be between 0 and 1\n- initialDelay: defaults to 100 ms\n- maxDelay: defaults to 10000 ms\n\n### Class FunctionCall\n\nThis class manages the calling of an asynchronous function within a backoff\nloop.\n\nThis class should rarely be instantiated directly since the factory method\n`backoff.call(fn, [args, ...], callback)` offers a more convenient and safer\nway to create `FunctionCall` instances.\n\n#### new FunctionCall(fn, args, callback)\n\n- fn: asynchronous function to call\n- args: an array containing fn's args\n- callback: fn's callback\n\nConstructs a function handler for the given asynchronous function.\n\n#### call.isPending()\n\nReturns whether the call is pending, i.e. hasn't been started.\n\n#### call.isRunning()\n\nReturns whether the call is in progress.\n\n#### call.isCompleted()\n\nReturns whether the call is completed.\n\n#### call.isAborted()\n\nReturns whether the call is aborted.\n\n#### call.setStrategy(strategy)\n\n- strategy: strategy instance to use, defaults to `FibonacciStrategy`.\n\nSets the backoff strategy to use. This method should be called before\n`call.start()` otherwise an exception will be thrown.\n\n#### call.failAfter(maxNumberOfBackoffs)\n\n- maxNumberOfBackoffs: maximum number of backoffs before the call is aborted\n\nSets the maximum number of backoffs before the call is aborted. By default,\nthere is no limit on the number of backoffs that can be performed.\n\nThis method should be called before `call.start()` otherwise an exception will\nbe thrown..\n\n#### call.getLastResult()\n\nRetrieves the last intermediary result returned by the wrapped function. This\nmethod can be called at any point in time during the call life cycle, i.e.\nbefore, during and after the wrapped function invocation.\n\nReturns an array containing the results returned by the last wrapped function\ncall. For example, to get the error code returned by the last call, one would\ndo the following.\n\n``` js\nvar results = call.getLastResult();\n// The error code is the first parameter of the callback.\nvar error = results[0];\n```\n\n#### call.getNumRetries()\n\nReturns the number of times the wrapped function call was retried. For a\nwrapped function that succeeded immediately, this would return 0. This\nmethod can be called at any point in time during the call life cycle, i.e.\nbefore, during and after the wrapped function invocation.\n\n#### call.start()\n\nInitiates the call the wrapped function. This method should only be called\nonce otherwise an exception will be thrown.\n\n\n#### call.abort()\n\nAborts the call.\n\nThe last result can be retrieved using `call.getLastResult()`. This method\ncan be called at any point in time during the call life cycle, i.e. before,\nduring and after the wrapped function invocation.\n\n#### Event: 'call'\n\n- args: wrapped function's arguments\n\nEmitted each time the wrapped function is called.\n\n#### Event: 'callback'\n\n- results: wrapped function's return values\n\nEmitted each time the wrapped function invokes its callback.\n\n#### Event: 'backoff'\n\n- number: backoff number, starts at 0\n- delay: backoff delay in milliseconds\n- err: the error that triggered the backoff operation\n\nEmitted each time a backoff operation is started.\n\n## Annotated source code\n\nThe annotated source code can be found at [mathieuturcotte.github.io/node-backoff/docs](http://mathieuturcotte.github.io/node-backoff/docs/).\n\n## License\n\nThis code is free to use under the terms of the [MIT license](http://mturcotte.mit-license.org/).\n",
- "readmeFilename": "README.md",
"bugs": {
"url": "https://github.com/MathieuTurcotte/node-backoff/issues"
- },
- "homepage": "https://github.com/MathieuTurcotte/node-backoff",
- "_id": "backoff@2.4.0",
- "_from": "backoff@2.4.0"
+ }
}
View
7 src/img/node_modules/bunyan/package.json
@@ -132,8 +132,6 @@
"url": "https://github.com/gausby"
}
],
- "readme": "Bunyan is **a simple and fast JSON logging library** for node.js services:\n\n var bunyan = require('bunyan');\n var log = bunyan.createLogger({name: \"myapp\"});\n log.info(\"hi\");\n\nand **a `bunyan` CLI tool** for nicely viewing those logs:\n\n![bunyan CLI screenshot](https://raw.github.com/trentm/node-bunyan/master/tools/screenshot1.png)\n\nManifesto: Server logs should be structured. JSON's a good format. Let's do\nthat. A log record is one line of `JSON.stringify`'d output. Let's also\nspecify some common names for the requisite and common fields for a log\nrecord (see below).\n\nAlso: log4j is way more than you need.\n\n\n# Current Status\n\nSolid core functionality is there. Joyent is using this for a number of\nproduction services. Bunyan supports node 0.6 and greater. Follow\n<a href=\"https://twitter.com/intent/user?screen_name=trentmick\" target=\"_blank\">@trentmick</a>\nfor updates to Bunyan.\n\nThere is an email discussion list\n[bunyan-logging@googlegroups.com](mailto:bunyan-logging@googlegroups.com),\nalso [as a forum in the\nbrowser](https://groups.google.com/forum/?fromgroups#!forum/bunyan-logging).\n\n\n# Installation\n\n npm install bunyan\n\n**Tip**: The `bunyan` CLI tool is written to be compatible (within reason) with\nall versions of Bunyan logs. Therefore you might want to `npm install -g bunyan`\nto get the bunyan CLI on your PATH, then use local bunyan installs for\nnode.js library usage of bunyan in your apps.\n\n\n# Features\n\n- elegant [log method API](#log-method-api)\n- extensible [streams](#streams) system for controlling where log records\n go (to a stream, to a file, [log file rotation](#stream-type-rotating-file),\n etc.)\n- [`bunyan` CLI](#cli-usage) for pretty-printing and filtering of Bunyan logs\n- simple include of log call source location (file, line, function) with\n [`src: true`](#src)\n- lightweight specialization of Logger instances with [`log.child`](#logchild)\n- custom rendering of logged objects with [\"serializers\"](#serializers)\n- [Runtime log snooping via Dtrace support](#runtime-log-snooping-via-dtrace)\n- Support for [browserify](http://browserify.org/). See [Browserify\n section](#browserify) below.\n\n\n# Introduction\n\nLike most logging libraries you create a Logger instance and call methods\nnamed after the logging levels:\n\n $ cat hi.js\n var bunyan = require('bunyan');\n var log = bunyan.createLogger({name: 'myapp'});\n log.info('hi');\n log.warn({lang: 'fr'}, 'au revoir');\n\nAll loggers must provide a \"name\". This is somewhat akin to the log4j logger\n\"name\", but Bunyan doesn't do hierarchical logger names.\n\n**Bunyan log records are JSON.** A few fields are added automatically:\n\"pid\", \"hostname\", \"time\" and \"v\".\n\n $ node hi.js\n {\"name\":\"myapp\",\"hostname\":\"banana.local\",\"pid\":40161,\"level\":30,\"msg\":\"hi\",\"time\":\"2013-01-04T18:46:23.851Z\",\"v\":0}\n {\"name\":\"myapp\",\"hostname\":\"banana.local\",\"pid\":40161,\"level\":40,\"lang\":\"fr\",\"msg\":\"au revoir\",\"time\":\"2013-01-04T18:46:23.853Z\",\"v\":0}\n\n\n## Log Method API\n\nThe example above shows two different ways to call `log.info(...)`. The\nfull API is:\n\n log.info(); // Returns a boolean: is the \"info\" level enabled?\n // This is equivalent to `log.isInfoEnabled()` or\n // `log.isEnabledFor(INFO)` in log4j.\n\n log.info('hi'); // Log a simple string message (or number).\n log.info('hi %s', bob, anotherVar); // Uses `util.format` for msg formatting.\n\n log.info({foo: 'bar'}, 'hi');\n // Adds \"foo\" field to log record. You can add any number\n // of additional fields here.\n\n log.info(err); // Special case to log an `Error` instance to the record.\n // This adds an \"err\" field with exception details\n // (including the stack) and sets \"msg\" to the exception\n // message.\n log.info(err, 'more on this: %s', more);\n // ... or you can specify the \"msg\".\n\nNote that this implies **you cannot pass any object as the first argument\nto log it**. IOW, `log.info(mywidget)` may not be what you expect. Instead\nof a string representation of `mywidget` that other logging libraries may\ngive you, Bunyan will try to JSON-ify your object. It is a Bunyan best\npractice to always give a field name to included objects, e.g.:\n\n log.info({widget: mywidget}, ...)\n\nThis will dove-tail with [Bunyan serializer support](#serializers), discussed\nlater.\n\nThe same goes for all of Bunyan's log levels: `log.trace`, `log.debug`,\n`log.info`, `log.warn`, `log.error`, and `log.fatal`. See the [levels section](#levels)\nbelow for details and suggestions.\n\n\n## CLI Usage\n\nBunyan log output is a stream of JSON objects. This is great for processing,\nbut not for reading directly. A **`bunyan` tool** is provided **for\npretty-printing bunyan logs** and for **filtering** (e.g.\n`| bunyan -c 'this.foo == \"bar\"'`). Using our example above:\n\n $ node hi.js | ./bin/bunyan\n [2013-01-04T19:01:18.241Z] INFO: myapp/40208 on banana.local: hi\n [2013-01-04T19:01:18.242Z] WARN: myapp/40208 on banana.local: au revoir (lang=fr)\n\nSee the screenshot above for an example of the default coloring of rendered\nlog output. That example also shows the nice formatting automatically done for\nsome well-known log record fields (e.g. `req` is formatted like an HTTP request,\n`res` like an HTTP response, `err` like an error stack trace).\n\nOne interesting feature is **filtering** of log content, which can be useful\nfor digging through large log files or for analysis. We can filter only\nrecords above a certain level:\n\n $ node hi.js | bunyan -l warn\n [2013-01-04T19:08:37.182Z] WARN: myapp/40353 on banana.local: au revoir (lang=fr)\n\nOr filter on the JSON fields in the records (e.g. only showing the French\nrecords in our contrived example):\n\n $ node hi.js | bunyan -c 'this.lang == \"fr\"'\n [2013-01-04T19:08:26.411Z] WARN: myapp/40342 on banana.local: au revoir (lang=fr)\n\nSee `bunyan --help` for other facilities.\n\n\n## Streams Introduction\n\nBy default, log output is to stdout and at the \"info\" level. Explicitly that\nlooks like:\n\n var log = bunyan.createLogger({\n name: 'myapp',\n stream: process.stdout,\n level: 'info'\n });\n\nThat is an abbreviated form for a single stream. **You can define multiple\nstreams at different levels**.\n\n var log = bunyan.createLogger({\n name: 'myapp',\n streams: [\n {\n level: 'info',\n stream: process.stdout // log INFO and above to stdout\n },\n {\n level: 'error',\n path: '/var/tmp/myapp-error.log' // log ERROR and above to a file\n }\n ]\n });\n\nMore on streams in the [Streams section](#streams) below.\n\n\n## log.child\n\nBunyan has a concept of a child logger to **specialize a logger for a\nsub-component of your application**, i.e. to create a new logger with\nadditional bound fields that will be included in its log records. A child\nlogger is created with `log.child(...)`.\n\nIn the following example, logging on a \"Wuzzle\" instance's `this.log` will\nbe exactly as on the parent logger with the addition of the `widget_type`\nfield:\n\n var bunyan = require('bunyan');\n var log = bunyan.createLogger({name: 'myapp'});\n\n function Wuzzle(options) {\n this.log = options.log.child({widget_type: 'wuzzle'});\n this.log.info('creating a wuzzle')\n }\n Wuzzle.prototype.woos = function () {\n this.log.warn('This wuzzle is woosey.')\n }\n\n log.info('start');\n var wuzzle = new Wuzzle({log: log});\n wuzzle.woos();\n log.info('done');\n\nRunning that looks like (raw):\n\n $ node myapp.js\n {\"name\":\"myapp\",\"hostname\":\"myhost\",\"pid\":34572,\"level\":30,\"msg\":\"start\",\"time\":\"2013-01-04T07:47:25.814Z\",\"v\":0}\n {\"name\":\"myapp\",\"hostname\":\"myhost\",\"pid\":34572,\"widget_type\":\"wuzzle\",\"level\":30,\"msg\":\"creating a wuzzle\",\"time\":\"2013-01-04T07:47:25.815Z\",\"v\":0}\n {\"name\":\"myapp\",\"hostname\":\"myhost\",\"pid\":34572,\"widget_type\":\"wuzzle\",\"level\":40,\"msg\":\"This wuzzle is woosey.\",\"time\":\"2013-01-04T07:47:25.815Z\",\"v\":0}\n {\"name\":\"myapp\",\"hostname\":\"myhost\",\"pid\":34572,\"level\":30,\"msg\":\"done\",\"time\":\"2013-01-04T07:47:25.816Z\",\"v\":0}\n\nAnd with the `bunyan` CLI (using the \"short\" output mode):\n\n $ node myapp.js | bunyan -o short\n 07:46:42.707Z INFO myapp: start\n 07:46:42.709Z INFO myapp: creating a wuzzle (widget_type=wuzzle)\n 07:46:42.709Z WARN myapp: This wuzzle is woosey. (widget_type=wuzzle)\n 07:46:42.709Z INFO myapp: done\n\n\nA more practical example is in the\n[node-restify](https://github.com/mcavage/node-restify) web framework.\nRestify uses Bunyan for its logging. One feature of its integration, is that\nif `server.use(restify.requestLogger())` is used, each restify request handler\nincludes a `req.log` logger that is:\n\n log.child({req_id: <unique request id>}, true)\n\nApps using restify can then use `req.log` and have all such log records\ninclude the unique request id (as \"req\\_id\"). Handy.\n\n\n## Serializers\n\nBunyan has a concept of **\"serializers\" to produce a JSON-able object from a\nJavaScript object**, so you can easily do the following:\n\n log.info({req: <request object>}, 'something about handling this request');\n\nSerializers is a mapping of log record field name, \"req\" in this example, to\na serializer function. That looks like this:\n\n function reqSerializer(req) {\n return {\n method: req.method,\n url: req.url,\n headers: req.headers\n }\n }\n var log = bunyan.createLogger({\n name: 'myapp',\n serializers: {\n req: reqSerializer\n }\n });\n\nOr this:\n\n var log = bunyan.createLogger({\n name: 'myapp',\n serializers: {req: bunyan.stdSerializers.req}\n });\n\nbecause Bunyan includes a small set of standard serializers. To use all the\nstandard serializers you can use:\n\n var log = bunyan.createLogger({\n ...\n serializers: bunyan.stdSerializers\n });\n\n**Note**: Your own serializers should never throw, otherwise you'll get an\nugly message on stderr from Bunyan (along with the traceback) and the field\nin your log record will be replaced with a short error message.\n\n\n## src\n\nThe **source file, line and function of the log call site** can be added to\nlog records by using the `src: true` config option:\n\n var log = bunyan.createLogger({src: true, ...});\n\nThis adds the call source info with the 'src' field, like this:\n\n {\n \"name\": \"src-example\",\n \"hostname\": \"banana.local\",\n \"pid\": 123,\n \"component\": \"wuzzle\",\n \"level\": 4,\n \"msg\": \"This wuzzle is woosey.\",\n \"time\": \"2012-02-06T04:19:35.605Z\",\n \"src\": {\n \"file\": \"/Users/trentm/tm/node-bunyan/examples/src.js\",\n \"line\": 20,\n \"func\": \"Wuzzle.woos\"\n },\n \"v\": 0\n }\n\n**WARNING: Determining the call source info is slow. Never use this option\nin production.**\n\n\n# Levels\n\nThe log levels in bunyan are as follows. The level descriptions are best\npractice *opinions*.\n\n- \"fatal\" (60): The service/app is going to stop or become unusable now.\n An operator should definitely look into this soon.\n- \"error\" (50): Fatal for a particular request, but the service/app continues\n servicing other requests. An operator should look at this soon(ish).\n- \"warn\" (40): A note on something that should probably be looked at by an\n operator eventually.\n- \"info\" (30): Detail on regular operation.\n- \"debug\" (20): Anything else, i.e. too verbose to be included in \"info\" level.\n- \"trace\" (10): Logging from external libraries used by your app or *very*\n detailed application logging.\n\nSuggestions: Use \"debug\" sparingly. Information that will be useful to debug\nerrors *post mortem* should usually be included in \"info\" messages if it's\ngenerally relevant or else with the corresponding \"error\" event. Don't rely\non spewing mostly irrelevant debug messages all the time and sifting through\nthem when an error occurs.\n\nIntegers are used for the actual level values (10 for \"trace\", ..., 60 for\n\"fatal\") and constants are defined for the (bunyan.TRACE ... bunyan.DEBUG).\nThe lowercase level names are aliases supported in the API.\n\nHere is the API for changing levels in an existing logger:\n\n log.level() -> INFO // gets current level (lowest level of all streams)\n\n log.level(INFO) // set all streams to level INFO\n log.level(\"info\") // set all streams to level INFO\n\n log.levels() -> [DEBUG, INFO] // get array of levels of all streams\n log.levels(0) -> DEBUG // get level of stream at index 0\n log.levels(\"foo\") // get level of stream with name \"foo\"\n\n log.levels(0, INFO) // set level of stream 0 to INFO\n log.levels(0, \"info\") // can use \"info\" et al aliases\n log.levels(\"foo\", WARN) // set stream named \"foo\" to WARN\n\n\n\n# Log Record Fields\n\nThis section will describe *rules* for the Bunyan log format: field names,\nfield meanings, required fields, etc. However, a Bunyan library doesn't\nstrictly enforce all these rules while records are being emitted. For example,\nBunyan will add a `time` field with the correct format to your log records,\nbut you can specify your own. It is the caller's responsibility to specify\nthe appropriate format.\n\nThe reason for the above leniency is because IMO logging a message should\nnever break your app. This leads to this rule of logging: **a thrown\nexception from `log.info(...)` or equivalent (other than for calling with the\nincorrect signature) is always a bug in Bunyan.**\n\n\nA typical Bunyan log record looks like this:\n\n {\"name\":\"myserver\",\"hostname\":\"banana.local\",\"pid\":123,\"req\":{\"method\":\"GET\",\"url\":\"/path?q=1#anchor\",\"headers\":{\"x-hi\":\"Mom\",\"connection\":\"close\"}},\"level\":3,\"msg\":\"start request\",\"time\":\"2012-02-03T19:02:46.178Z\",\"v\":0}\n\nPretty-printed:\n\n {\n \"name\": \"myserver\",\n \"hostname\": \"banana.local\",\n \"pid\": 123,\n \"req\": {\n \"method\": \"GET\",\n \"url\": \"/path?q=1#anchor\",\n \"headers\": {\n \"x-hi\": \"Mom\",\n \"connection\": \"close\"\n },\n \"remoteAddress\": \"120.0.0.1\",\n \"remotePort\": 51244\n },\n \"level\": 3,\n \"msg\": \"start request\",\n \"time\": \"2012-02-03T19:02:57.534Z\",\n \"v\": 0\n }\n\n\nCore fields:\n\n- `v`: Required. Integer. Added by Bunyan. Cannot be overriden.\n This is the Bunyan log format version (`require('bunyan').LOG_VERSION`).\n The log version is a single integer. `0` is until I release a version\n \"1.0.0\" of node-bunyan. Thereafter, starting with `1`, this will be\n incremented if there is any backward incompatible change to the log record\n format. Details will be in \"CHANGES.md\" (the change log).\n- `level`: Required. Integer. Added by Bunyan. Cannot be overriden.\n See the \"Levels\" section.\n- `name`: Required. String. Provided at Logger creation.\n You must specify a name for your logger when creating it. Typically this\n is the name of the service/app using Bunyan for logging.\n- `hostname`: Required. String. Provided or determined at Logger creation.\n You can specify your hostname at Logger creation or it will be retrieved\n vi `os.hostname()`.\n- `pid`: Required. Integer. Filled in automatically at Logger creation.\n- `time`: Required. String. Added by Bunyan. Can be overriden.\n The date and time of the event in [ISO 8601\n Extended Format](http://en.wikipedia.org/wiki/ISO_8601) format and in UTC,\n as from\n [`Date.toISOString()`](https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Date/toISOString).\n- `msg`: Required. String.\n Every `log.debug(...)` et al call must provide a log message.\n- `src`: Optional. Object giving log call source info. This is added\n automatically by Bunyan if the \"src: true\" config option is given to the\n Logger. Never use in production as this is really slow.\n\n\nGo ahead and add more fields, and nested ones are fine (and recommended) as\nwell. This is why we're using JSON. Some suggestions and best practices\nfollow (feedback from actual users welcome).\n\n\nRecommended/Best Practice Fields:\n\n- `err`: Object. A caught JS exception. Log that thing with `log.info(err)`\n to get:\n\n ...\n \"err\": {\n \"message\": \"boom\",\n \"name\": \"TypeError\",\n \"stack\": \"TypeError: boom\\n at Object.<anonymous> ...\"\n },\n \"msg\": \"boom\",\n ...\n\n Or use the `bunyan.stdSerializers.err` serializer in your Logger and\n do this `log.error({err: err}, \"oops\")`. See \"examples/err.js\".\n\n- `req_id`: String. A request identifier. Including this field in all logging\n tied to handling a particular request to your server is strongly suggested.\n This allows post analysis of logs to easily collate all related logging\n for a request. This really shines when you have a SOA with multiple services\n and you carry a single request ID from the top API down through all APIs\n (as [node-restify](https://github.com/mcavage/node-restify) facilitates\n with its 'Request-Id' header).\n\n- `req`: An HTTP server request. Bunyan provides `bunyan.stdSerializers.req`\n to serialize a request with a suggested set of keys. Example:\n\n {\n \"method\": \"GET\",\n \"url\": \"/path?q=1#anchor\",\n \"headers\": {\n \"x-hi\": \"Mom\",\n \"connection\": \"close\"\n },\n \"remoteAddress\": \"120.0.0.1\",\n \"remotePort\": 51244\n }\n\n- `res`: An HTTP server response. Bunyan provides `bunyan.stdSerializers.res`\n to serialize a response with a suggested set of keys. Example:\n\n {\n \"statusCode\": 200,\n \"header\": \"HTTP/1.1 200 OK\\r\\nContent-Type: text/plain\\r\\nConnection: keep-alive\\r\\nTransfer-Encoding: chunked\\r\\n\\r\\n\"\n }\n\n\nOther fields to consider:\n\n- `req.username`: Authenticated user (or for a 401, the user attempting to\n auth).\n- Some mechanism to calculate response latency. \"restify\" users will have\n a \"X-Response-Time\" header. A `latency` custom field would be fine.\n- `req.body`: If you know that request bodies are small (common in APIs,\n for example), then logging the request body is good.\n\n\n# Streams\n\nA \"stream\" is Bunyan's name for an output for log messages (the equivalent\nto a log4j Appender). Ultimately Bunyan uses a\n[Writable Stream](http://nodejs.org/docs/latest/api/all.html#writable_Stream)\ninterface, but there are some additional attributes used to create and\nmanage the stream. A Bunyan Logger instance has one or more streams.\nIn general streams are specified with the \"streams\" option:\n\n var bunyan = require('bunyan');\n var log = bunyan.createLogger({\n name: \"foo\",\n streams: [\n {\n stream: process.stderr,\n level: \"debug\"\n },\n ...\n ]\n });\n\nFor convenience, if there is only one stream, it can specified with the\n\"stream\" and \"level\" options (internally converted to a `Logger.streams`).\n\n var log = bunyan.createLogger({\n name: \"foo\",\n stream: process.stderr,\n level: \"debug\"\n });\n\nNote that \"file\" streams do not support this shortcut (partly for historical\nreasons and partly to not make it difficult to add a literal \"path\" field\non log records).\n\nIf neither \"streams\" nor \"stream\" are specified, the default is a stream of\ntype \"stream\" emitting to `process.stdout` at the \"info\" level.\n\n\n## stream errors\n\nBunyan re-emits error events from the created `WriteStream`. So you can\ndo this:\n\n var log = bunyan.createLogger({name: 'mylog', streams: [{path: LOG_PATH}]});\n log.on('error', function (err, stream) {\n // Handle stream write or create error here.\n });\n\nNote: This is **not** that same as a log record at the \"error\" level as\nproduced by `log.error(...)`.\n\n\n## stream type: `stream`\n\nA `type === 'stream'` is a plain ol' node.js [Writable\nStream](http://nodejs.org/docs/latest/api/all.html#writable_Stream). A\n\"stream\" (the writeable stream) field is required. E.g.: `process.stdout`,\n`process.stderr`.\n\n var log = bunyan.createLogger({\n name: 'foo',\n streams: [{\n stream: process.stderr\n // `type: 'stream'` is implied\n }]\n });\n\n<table>\n<tr>\n<th>Field</th>\n<th>Required?</th>\n<th>Default</th>\n<th>Description</th>\n</tr>\n<tr>\n<td>stream</td>\n<td>Yes</td>\n<td>-</td>\n<td>A \"Writable Stream\", e.g. a std handle or an open file write stream.</td>\n</tr>\n<tr>\n<td>type</td>\n<td>No</td>\n<td>n/a</td>\n<td>`type == 'stream'` is implied if the `stream` field is given.</td>\n</tr>\n<tr>\n<td>level</td>\n<td>No</td>\n<td>info</td>\n<td>The level at which logging to this stream is enabled. If not\nspecified it defaults to \"info\". If specified this can be one of the\nlevel strings (\"trace\", \"debug\", ...) or constants (`bunyan.TRACE`,\n`bunyan.DEBUG`, ...).</td>\n</tr>\n<tr>\n<td>name</td>\n<td>No</td>\n<td>-</td>\n<td>A name for this stream. This may be useful for usage of `log.level(NAME,\nLEVEL)`. See the [Levels section](#levels) for details. A stream \"name\" isn't\nused for anything else.</td>\n</tr>\n</table>\n\n\n## stream type: `file`\n\nA `type === 'file'` stream requires a \"path\" field. Bunyan will open this\nfile for appending. E.g.:\n\n var log = bunyan.createLogger({\n name: 'foo',\n streams: [{\n path: '/var/log/foo.log',\n // `type: 'file'` is implied\n }]\n });\n\n<table>\n<tr>\n<th>Field</th>\n<th>Required?</th>\n<th>Default</th>\n<th>Description</th>\n</tr>\n<tr>\n<td>path</td>\n<td>Yes</td>\n<td>-</td>\n<td>A file path to which to log.</td>\n</tr>\n<tr>\n<td>type</td>\n<td>No</td>\n<td>n/a</td>\n<td>`type == 'file'` is implied if the `path` field is given.</td>\n</tr>\n<tr>\n<td>level</td>\n<td>No</td>\n<td>info</td>\n<td>The level at which logging to this stream is enabled. If not\nspecified it defaults to \"info\". If specified this can be one of the\nlevel strings (\"trace\", \"debug\", ...) or constants (`bunyan.TRACE`,\n`bunyan.DEBUG`, ...).</td>\n</tr>\n<tr>\n<td>name</td>\n<td>No</td>\n<td>-</td>\n<td>A name for this stream. This may be useful for usage of `log.level(NAME,\nLEVEL)`. See the [Levels section](#levels) for details. A stream \"name\" isn't\nused for anything else.</td>\n</tr>\n</table>\n\n\n## stream type: `rotating-file`\n\n**WARNING on node 0.8 usage:** Users of Bunyan's `rotating-file` should (a) be\nusing at least bunyan 0.23.1 (with the fix for [this\nissue](https://github.com/trentm/node-bunyan/pull/97)), and (b) should use at\nleast node 0.10 (node 0.8 does not support the `unref()` method on\n`setTimeout(...)` needed for the mentioned fix). The symptom is that process\ntermination will hang for up to a full rotation period.\n\n**WARNING on [cluster](http://nodejs.org/docs/latest/api/all.html#all_cluster)\nusage:** Using Bunyan's `rotating-file` stream with node.js's \"cluster\" module\ncan result in unexpected file rotation. You must not have multiple processes\nin the cluster logging to the same file path. In other words, you must have\na separate log file path for the master and each worker in the cluster.\nAlternatively, consider using a system file rotation facility such as\n`logrotate` on Linux or `logadm` on SmartOS/Illumos. See\n[this comment on issue #117](https://github.com/trentm/node-bunyan/issues/117#issuecomment-44804938)\nfor details.\n\nA `type === 'rotating-file'` is a file stream that handles file automatic\nrotation.\n\n var log = bunyan.createLogger({\n name: 'foo',\n streams: [{\n type: 'rotating-file',\n path: '/var/log/foo.log',\n period: '1d', // daily rotation\n count: 3 // keep 3 back copies\n }]\n });\n\nThis will rotate '/var/log/foo.log' every day (at midnight) to:\n\n /var/log/foo.log.0 # yesterday\n /var/log/foo.log.1 # 1 day ago\n /var/log/foo.log.2 # 2 days ago\n\n*Currently*, there is no support for providing a template for the rotated\nfiles, or for rotating when the log reaches a threshold size.\n\n<table>\n<tr>\n<th>Field</th>\n<th>Required?</th>\n<th>Default</th>\n<th>Description</th>\n</tr>\n<tr>\n<td>type</td>\n<td>Yes</td>\n<td>-</td>\n<td>\"rotating-file\"</td>\n</tr>\n<tr>\n<td>path</td>\n<td>Yes</td>\n<td>-</td>\n<td>A file path to which to log. Rotated files will be \"$path.0\",\n\"$path.1\", ...</td>\n</tr>\n<tr>\n<td>period</td>\n<td>No</td>\n<td>1d</td>\n<td>The period at which to rotate. This is a string of the format\n\"$number$scope\" where \"$scope\" is one of \"h\" (hours), \"d\" (days), \"w\" (weeks),\n\"m\" (months), \"y\" (years). Or one of the following names can be used\n\"hourly\" (means 1h), \"daily\" (1d), \"weekly\" (1w), \"monthly\" (1m),\n\"yearly\" (1y). Rotation is done at the start of the scope: top of the hour (h),\nmidnight (d), start of Sunday (w), start of the 1st of the month (m),\nstart of Jan 1st (y).</td>\n</tr>\n<tr>\n<td>count</td>\n<td>No</td>\n<td>10</td>\n<td>The number of rotated files to keep.</td>\n</tr>\n<tr>\n<td>level</td>\n<td>No</td>\n<td>info</td>\n<td>The level at which logging to this stream is enabled. If not\nspecified it defaults to \"info\". If specified this can be one of the\nlevel strings (\"trace\", \"debug\", ...) or constants (`bunyan.TRACE`,\n`bunyan.DEBUG`, ...).</td>\n</tr>\n<tr>\n<td>name</td>\n<td>No</td>\n<td>-</td>\n<td>A name for this stream. This may be useful for usage of `log.level(NAME,\nLEVEL)`. See the [Levels section](#levels) for details. A stream \"name\" isn't\nused for anything else.</td>\n</tr>\n</table>\n\n\n**Note on log rotation**: Often you may be using external log rotation utilities\nlike `logrotate` on Linux or `logadm` on SmartOS/Illumos. In those cases, unless\nyour are ensuring \"copy and truncate\" sematics (via `copytruncate` with\nlogrotate or `-c` with logadm) then the fd for your 'file' stream will change.\nYou can tell bunyan to reopen the file stream with code like this in your\napp:\n\n var log = bunyan.createLogger(...);\n ...\n process.on('SIGUSR2', function () {\n log.reopenFileStreams();\n });\n\nwhere you'd configure your log rotation to send SIGUSR2 (or some other signal)\nto your process. Any other mechanism to signal your app to run\n`log.reopenFileStreams()` would work as well.\n\n\n## stream type: `raw`\n\n- `raw`: Similar to a \"stream\" writeable stream, except that the write method\n is given raw log record *Object*s instead of a JSON-stringified string.\n This can be useful for hooking on further processing to all Bunyan logging:\n pushing to an external service, a RingBuffer (see below), etc.\n\n\n\n## `raw` + RingBuffer Stream\n\nBunyan comes with a special stream called a RingBuffer which keeps the last N\nrecords in memory and does *not* write the data anywhere else. One common\nstrategy is to log 'info' and higher to a normal log file but log all records\n(including 'trace') to a ringbuffer that you can access via a debugger, or your\nown HTTP interface, or a post-mortem facility like MDB or node-panic.\n\nTo use a RingBuffer:\n\n /* Create a ring buffer that stores the last 100 records. */\n var bunyan = require('bunyan');\n var ringbuffer = new bunyan.RingBuffer({ limit: 100 });\n var log = bunyan.createLogger({\n name: 'foo',\n streams: [\n {\n level: 'info',\n stream: process.stdout\n },\n {\n level: 'trace',\n type: 'raw', // use 'raw' to get raw log record objects\n stream: ringbuffer\n }\n ]\n });\n\n log.info('hello world');\n console.log(ringbuffer.records);\n\nThis example emits:\n\n [ { name: 'foo',\n hostname: '912d2b29',\n pid: 50346,\n level: 30,\n msg: 'hello world',\n time: '2012-06-19T21:34:19.906Z',\n v: 0 } ]\n\n\n## third-party streams\n\n- syslog:\n [mcavage/node-bunyan-syslog](https://github.com/mcavage/node-bunyan-syslog)\n provides support for directing bunyan logging to a syslog server.\n\n- bunyan-slack:\n[qualitybath/bunyan-slack](https://github.com/qualitybath/bunyan-slack) Bunyan stream for Slack chat integration.\n\n- bunyan-fogbugz\n[qualitybath/bunyan-fogbugz](https://github.com/qualitybath/bunyan-fogbugz) Bunyan stream for sending automated crash reports to FogBugz\n\n- TODO: eventually https://github.com/trentm/node-bunyan-winston\n\n\n\n# Runtime log snooping via DTrace\n\n**Note**: To use Bunyan's DTrace facilities you need to manually install\nthe \"dtrace-provider\" lib separately via `npm install dtrace-provider`.\n\nOn systems that support DTrace (e.g., MacOS, FreeBSD, illumos derivatives\nlike SmartOS and OmniOS), Bunyan will create a DTrace provider (`bunyan`)\nthat makes available the following probes:\n\n log-trace\n log-debug\n log-info\n log-warn\n log-error\n log-fatal\n\nEach of these probes has a single argument: the string that would be\nwritten to the log. Note that when a probe is enabled, it will\nfire whenever the corresponding function is called, even if the level of\nthe log message is less than that of any stream.\n\n\n## DTrace examples\n\nTrace all log messages coming from any Bunyan module on the system.\n(The `-x strsize=4k` is to raise dtrace's default 256 byte buffer size\nbecause log messages are longer than typical dtrace probes.)\n\n dtrace -x strsize=4k -qn 'bunyan*:::log-*{printf(\"%d: %s: %s\", pid, probefunc, copyinstr(arg0))}'\n\nTrace all log messages coming from the \"wuzzle\" component:\n\n dtrace -x strsize=4k -qn 'bunyan*:::log-*/strstr(this->str = copyinstr(arg0), \"\\\"component\\\":\\\"wuzzle\\\"\") != NULL/{printf(\"%s\", this->str)}'\n\nAggregate debug messages from process 1234, by message:\n\n dtrace -x strsize=4k -n 'bunyan1234:::log-debug{@[copyinstr(arg0)] = count()}'\n\nHave the bunyan CLI pretty-print the traced logs:\n\n dtrace -x strsize=4k -qn 'bunyan1234:::log-*{printf(\"%s\", copyinstr(arg0))}' | bunyan\n\nA convenience handle has been made for this:\n\n bunyan -p 1234\n\n\nOn systems that support the\n[`jstack`](http://dtrace.org/blogs/dap/2012/04/25/profiling-node-js/) action\nvia a node.js helper, get a stack backtrace for any debug message that\nincludes the string \"danger!\":\n\n dtrace -x strsize=4k -qn 'log-debug/strstr(copyinstr(arg0), \"danger!\") != NULL/{printf(\"\\n%s\", copyinstr(arg0)); jstack()}'\n\nOutput of the above might be:\n\n {\"name\":\"foo\",\"hostname\":\"763bf293-d65c-42d5-872b-4abe25d5c4c7.local\",\"pid\":12747,\"level\":20,\"msg\":\"danger!\",\"time\":\"2012-10-30T18:28:57.115Z\",\"v\":0}\n\n node`0x87e2010\n DTraceProviderBindings.node`usdt_fire_probe+0x32\n DTraceProviderBindings.node`_ZN4node11DTraceProbe5_fireEN2v85LocalINS1_5ValueEEE+0x32d\n DTraceProviderBindings.node`_ZN4node11DTraceProbe4FireERKN2v89ArgumentsE+0x77\n << internal code >>\n (anon) as (anon) at /root/node-bunyan/lib/bunyan.js position 40484\n << adaptor >>\n (anon) as doit at /root/my-prog.js position 360\n (anon) as list.ontimeout at timers.js position 4960\n << adaptor >>\n << internal >>\n << entry >>\n node`_ZN2v88internalL6InvokeEbNS0_6HandleINS0_10JSFunctionEEENS1_INS0_6ObjectEEEiPS5_Pb+0x101\n node`_ZN2v88internal9Execution4CallENS0_6HandleINS0_6ObjectEEES4_iPS4_Pbb+0xcb\n node`_ZN2v88Function4CallENS_6HandleINS_6ObjectEEEiPNS1_INS_5ValueEEE+0xf0\n node`_ZN4node12MakeCallbackEN2v86HandleINS0_6ObjectEEENS1_INS0_8FunctionEEEiPNS1_INS0_5ValueEEE+0x11f\n node`_ZN4node12MakeCallbackEN2v86HandleINS0_6ObjectEEENS1_INS0_6StringEEEiPNS1_INS0_5ValueEEE+0x66\n node`_ZN4node9TimerWrap9OnTimeoutEP10uv_timer_si+0x63\n node`uv__run_timers+0x66\n node`uv__run+0x1b\n node`uv_run+0x17\n node`_ZN4node5StartEiPPc+0x1d0\n node`main+0x1b\n node`_start+0x83\n\n node`0x87e2010\n DTraceProviderBindings.node`usdt_fire_probe+0x32\n DTraceProviderBindings.node`_ZN4node11DTraceProbe5_fireEN2v85LocalINS1_5ValueEEE+0x32d\n DTraceProviderBindings.node`_ZN4node11DTraceProbe4FireERKN2v89ArgumentsE+0x77\n << internal code >>\n (anon) as (anon) at /root/node-bunyan/lib/bunyan.js position 40484\n << adaptor >>\n (anon) as doit at /root/my-prog.js position 360\n (anon) as list.ontimeout at timers.js position 4960\n << adaptor >>\n << internal >>\n << entry >>\n node`_ZN2v88internalL6InvokeEbNS0_6HandleINS0_10JSFunctionEEENS1_INS0_6ObjectEEEiPS5_Pb+0x101\n node`_ZN2v88internal9Execution4CallENS0_6HandleINS0_6ObjectEEES4_iPS4_Pbb+0xcb\n node`_ZN2v88Function4CallENS_6HandleINS_6ObjectEEEiPNS1_INS_5ValueEEE+0xf0\n node`_ZN4node12MakeCallbackEN2v86HandleINS0_6ObjectEEENS1_INS0_8FunctionEEEiPNS1_INS0_5ValueEEE+0x11f\n node`_ZN4node12MakeCallbackEN2v86HandleINS0_6ObjectEEENS1_INS0_6StringEEEiPNS1_INS0_5ValueEEE+0x66\n node`_ZN4node9TimerWrap9OnTimeoutEP10uv_timer_si+0x63\n node`uv__run_timers+0x66\n node`uv__run+0x1b\n node`uv_run+0x17\n node`_ZN4node5StartEiPPc+0x1d0\n node`main+0x1b\n node`_start+0x83\n\n\n# Browserify\n\nAs the [Browserify](http://browserify.org/) site says it \"lets you\n`require('modules')` in the browser by bundling up all of your dependencies.\"\nIt is a build tool to run on your node.js script to bundle up your script and\nall its node.js dependencies into a single file that is runnable in the\nbrowser via:\n\n <script src=\"play.browser.js\"></script>\n\nAs of version 1.1.0, node-bunyan supports being run via Browserify. The\ndefault [stream](#streams) when running in the browser is one that emits\nraw log records to `console.log/info/warn/error`.\n\nHere is a quick example showing you how you can get this working for your\nscript.\n\n1. Get browserify and bunyan installed in your module:\n\n\n $ npm install browserify bunyan\n\n2. An example script using Bunyan, \"play.js\":\n\n ```javascript\n var bunyan = require('bunyan');\n var log = bunyan.createLogger({name: 'play', level: 'debug'});\n log.trace('this one does not emit');\n log.debug('hi on debug'); // console.log\n log.info('hi on info'); // console.info\n log.warn('hi on warn'); // console.warn\n log.error('hi on error'); // console.error\n ```\n\n3. Build this into a bundle to run in the browser, \"play.browser.js\":\n\n $ ./node_modules/.bin/browserify play.js -o play.browser.js\n\n4. Put that into an HTML file, \"play.html\":\n\n ```html\n <!DOCTYPE html>\n <html>\n <head>\n <meta charset=\"utf-8\">\n <script src=\"play.browser.js\"></script>\n </head>\n <body>\n <div>hi</div>\n </body>\n </html>\n ```\n\n5. Open that in your browser and open your browser console:\n\n $ open play.html\n\n\nHere is what it looks like in Firefox's console: ![Bunyan + Browserify in the\nFirefox console](./docs/img/bunyan.browserify.png)\n\nFor some, the raw log records might not be desired. To have a rendered log line\nyou'll want to add your own stream, starting with something like this:\n\n```javascript\nvar bunyan = require('./lib/bunyan');\n\nfunction MyRawStream() {}\nMyRawStream.prototype.write = function (rec) {\n console.log('[%s] %s: %s',\n rec.time.toISOString(),\n bunyan.nameFromLevel[rec.level],\n rec.msg);\n}\n\nvar log = bunyan.createLogger({\n name: 'play',\n streams: [\n {\n level: 'info',\n stream: new MyRawStream(),\n type: 'raw'\n }\n ]\n});\n\nlog.info('hi on info');\n```\n\n\n\n\n# Versioning\n\nThe scheme I follow is most succintly described by the bootstrap guys\n[here](https://github.com/twitter/bootstrap#versioning).\n\ntl;dr: All versions are `<major>.<minor>.<patch>` which will be incremented for\nbreaking backward compat and major reworks, new features without breaking\nchange, and bug fixes, respectively.\n\n\n# License\n\nMIT. See \"LICENSE.txt\".\n\n\n# See Also\n\n- Bunyan syslog support: <https://github.com/mcavage/node-bunyan-syslog>.\n- Bunyan + Graylog2: <https://github.com/mhart/gelf-stream>.\n- Bunyan middleware for Express: <https://github.com/villadora/express-bunyan-logger>\n- An example of a Bunyan shim to the Winston logging system:\n <https://github.com/trentm/node-bunyan-winston>. Also a [comparison of\n Winston and Bunyan](http://strongloop.com/strongblog/compare-node-js-logging-winston-bunyan/).\n- [Bunyan for Bash](https://github.com/trevoro/bash-bunyan).\n- TODO: `RequestCaptureStream` example from restify.\n- [Bunyan integration for https://logentries.com](https://www.npmjs.org/package/logentries-stream)\n",
- "readmeFilename": "README.md",
"bugs": {
"url": "https://github.com/trentm/node-bunyan/issues"
},
@@ -142,8 +140,5 @@
"dtrace-provider": "~0.4",
"mv": "~2",
"safe-json-stringify": "~1"
- },
- "_id": "bunyan@1.3.5",
- "_shasum": "49803cee624667132484b535e1831e7a777791b0",
- "_from": "bunyan@1.3.5"
+ }
}
View
7 src/img/node_modules/cmdln/node_modules/dashdash/package.json
@@ -51,13 +51,8 @@
"url": "https://github.com/pfmooney"
}
],
- "readme": "A light, featureful and explicit option parsing library for node.js.\n\n[Why another one? See below](#why). tl;dr: The others I've tried are one of\ntoo loosey goosey (not explicit), too big/too many deps, or ill specified.\nYMMV.\n\nFollow <a href=\"https://twitter.com/intent/user?screen_name=trentmick\" target=\"_blank\">@trentmick</a>\nfor updates to node-dashdash.\n\n# Install\n\n npm install dashdash\n\n\n# Usage\n\n```javascript\nvar dashdash = require('dashdash');\n\n// Specify the options. Minimally `name` (or `names`) and `type`\n// must be given for each.\nvar options = [\n {\n // `names` or a single `name`. First element is the `opts.KEY`.\n names: ['help', 'h'],\n // See \"Option specs\" below for types.\n type: 'bool',\n help: 'Print this help and exit.'\n }\n];\n\n// Shortcut form. As called it infers `process.argv`. See below for\n// the longer form to use methods like `.help()` on the Parser object.\nvar opts = dashdash.parse({options: options});\n\nconsole.log(\"opts:\", opts);\nconsole.log(\"args:\", opts._args);\n```\n\n\n# Longer Example\n\nA more realistic [starter script \"foo.js\"](./examples/foo.js) is as follows.\nThis also shows using `parser.help()` for formatted option help.\n\n```javascript\nvar dashdash = require('./lib/dashdash');\n\nvar options = [\n {\n name: 'version',\n type: 'bool',\n help: 'Print tool version and exit.'\n },\n {\n names: ['help', 'h'],\n type: 'bool',\n help: 'Print this help and exit.'\n },\n {\n names: ['verbose', 'v'],\n type: 'arrayOfBool',\n help: 'Verbose output. Use multiple times for more verbose.'\n },\n {\n names: ['file', 'f'],\n type: 'string',\n help: 'File to process',\n helpArg: 'FILE'\n }\n];\n\nvar parser = dashdash.createParser({options: options});\ntry {\n var opts = parser.parse(process.argv);\n} catch (e) {\n console.error('foo: error: %s', e.message);\n process.exit(1);\n}\n\nconsole.log(\"# opts:\", opts);\nconsole.log(\"# args:\", opts._args);\n\n// Use `parser.help()` for formatted options help.\nif (opts.help) {\n var help = parser.help({includeEnv: true}).trimRight();\n console.log('usage: node foo.js [OPTIONS]\\n'\n + 'options:\\n'\n + help);\n process.exit(0);\n}\n\n// ...\n```\n\n\nSome example output from this script (foo.js):\n\n```\n$ node foo.js -h\n# opts: { help: true,\n _order: [ { name: 'help', value: true, from: 'argv' } ],\n _args: [] }\n# args: []\nusage: node foo.js [OPTIONS]\noptions:\n --version Print tool version and exit.\n -h, --help Print this help and exit.\n -v, --verbose Verbose output. Use multiple times for more verbose.\n -f FILE, --file=FILE File to process\n\n$ node foo.js -v\n# opts: { verbose: [ true ],\n _order: [ { name: 'verbose', value: true, from: 'argv' } ],\n _args: [] }\n# args: []\n\n$ node foo.js --version arg1\n# opts: { version: true,\n _order: [ { name: 'version', value: true, from: 'argv' } ],\n _args: [ 'arg1' ] }\n# args: [ 'arg1' ]\n\n$ node foo.js -f bar.txt\n# opts: { file: 'bar.txt',\n _order: [ { name: 'file', value: 'bar.txt', from: 'argv' } ],\n _args: [] }\n# args: []\n\n$ node foo.js -vvv --file=blah\n# opts: { verbose: [ true, true, true ],\n file: 'blah',\n _order:\n [ { name: 'verbose', value: true, from: 'argv' },\n { name: 'verbose', value: true, from: 'argv' },\n { name: 'verbose', value: true, from: 'argv' },\n { name: 'file', value: 'blah', from: 'argv' } ],\n _args: [] }\n# args: []\n```\n\n\nSee the [\"examples\"](examples/) dir for a number of starter examples using\nsome of dashdash's features.\n\n\n# Environment variable integration\n\nIf you want to allow environment variables to specify options to your tool,\ndashdash makes this easy. We can change the 'verbose' option in the example\nabove to include an 'env' field:\n\n```javascript\n {\n names: ['verbose', 'v'],\n type: 'arrayOfBool',\n env: 'FOO_VERBOSE', // <--- add this line\n help: 'Verbose output. Use multiple times for more verbose.'\n },\n```\n\nthen the **\"FOO_VERBOSE\" environment variable** can be used to set this\noption:\n\n```shell\n$ FOO_VERBOSE=1 node foo.js\n# opts: { verbose: [ true ],\n _order: [ { name: 'verbose', value: true, from: 'env' } ],\n _args: [] }\n# args: []\n```\n\nBoolean options will interpret the empty string as unset, '0' as false\nand anything else as true.\n\n```shell\n$ FOO_VERBOSE= node examples/foo.js # not set\n# opts: { _order: [], _args: [] }\n# args: []\n\n$ FOO_VERBOSE=0 node examples/foo.js # '0' is false\n# opts: { verbose: [ false ],\n _order: [ { key: 'verbose', value: false, from: 'env' } ],\n _args: [] }\n# args: []\n\n$ FOO_VERBOSE=1 node examples/foo.js # true\n# opts: { verbose: [ true ],\n _order: [ { key: 'verbose', value: true, from: 'env' } ],\n _args: [] }\n# args: []\n\n$ FOO_VERBOSE=boogabooga node examples/foo.js # true\n# opts: { verbose: [ true ],\n _order: [ { key: 'verbose', value: true, from: 'env' } ],\n _args: [] }\n# args: []\n```\n\nNon-booleans can be used as well. Strings:\n\n```shell\n$ FOO_FILE=data.txt node examples/foo.js\n# opts: { file: 'data.txt',\n _order: [ { key: 'file', value: 'data.txt', from: 'env' } ],\n _args: [] }\n# args: []\n```\n\nNumbers:\n\n```shell\n$ FOO_TIMEOUT=5000 node examples/foo.js\n# opts: { timeout: 5000,\n _order: [ { key: 'timeout', value: 5000, from: 'env' } ],\n _args: [] }\n# args: []\n\n$ FOO_TIMEOUT=blarg node examples/foo.js\nfoo: error: arg for \"FOO_TIMEOUT\" is not a positive integer: \"blarg\"\n```\n\nWith the `includeEnv: true` config to `parser.help()` the environment\nvariable can also be included in **help output**:\n\n usage: node foo.js [OPTIONS]\n options:\n --version Print tool version and exit.\n -h, --help Print this help and exit.\n -v, --verbose Verbose output. Use multiple times for more verbose.\n Environment: FOO_VERBOSE=1\n -f FILE, --file=FILE File to process\n\n\n# Parser config\n\nParser construction (i.e. `dashdash.createParser(CONFIG)`) takes the\nfollowing fields:\n\n- `options` (Array of option specs). Required. See the\n [Option specs](#option-specs) section below.\n\n- `interspersed` (Boolean). Optional. Default is true. If true this allows\n interspersed arguments and options. I.e.:\n\n node ./tool.js -v arg1 arg2 -h # '-h' is after interspersed args\n\n Set it to false to have '-h' **not** get parsed as an option in the above\n example.\n\n- `allowUnknown` (Boolean). Optional. Default is false. If false, this causes\n unknown arguments to throw an error. I.e.:\n\n node ./tool.js -v arg1 --afe8asefksjefhas\n\n Set it to true to treat the unknown option as a positional\n argument.\n\n **Caveat**: When a shortopt group, such as `-xaz` contains a mix of\n known and unknown options, the *entire* group is passed through\n unmolested as a positional argument.\n\n Consider if you have a known short option `-a`, and parse the\n following command line:\n\n node ./tool.js -xaz\n\n where `-x` and `-z` are unknown. There are multiple ways to\n interpret this:\n\n 1. `-x` takes a value: `{x: 'az'}`\n 2. `-x` and `-z` are both booleans: `{x:true,a:true,z:true}`\n\n Since dashdash does not know what `-x` and `-z` are, it can't know\n if you'd prefer to receive `{a:true,_args:['-x','-z']}` or\n `{x:'az'}`, or `{_args:['-xaz']}`. Leaving the positional arg unprocessed\n is the easiest mistake for the user to recover from.\n\n\n# Option specs\n\nExample using all fields:\n\n```javascript\n{\n names: ['file', 'f'], // Required (or `name`).\n type: 'string', // Required.\n env: 'MYTOOL_FILE',\n help: 'Config file to load before running \"mytool\"',\n helpArg: 'PATH',\n helpWrap: false,\n default: path.resolve(process.env.HOME, '.mytoolrc')\n}\n```\n\nEach option spec in the `options` array must/can have the following fields:\n\n- `name` (String) or `names` (Array). Required. These give the option name\n and aliases. The first name (if more than one given) is the key for the\n parsed `opts` object.\n\n- `type` (String). Required. One of:\n\n - bool\n - string\n - number\n - integer\n - positiveInteger\n - date (epoch seconds, e.g. 1396031701, or ISO 8601 format\n `YYYY-MM-DD[THH:MM:SS[.sss][Z]]`, e.g. \"2014-03-28T18:35:01.489Z\")\n - arrayOfBool\n - arrayOfString\n - arrayOfNumber\n - arrayOfInteger\n - arrayOfPositiveInteger\n - arrayOfDate\n\n FWIW, these names attempt to match with asserts on\n [assert-plus](https://github.com/mcavage/node-assert-plus).\n You can add your own custom option types with `dashdash.addOptionType`.\n See below.\n\n- `env` (String or Array of String). Optional. An environment variable name\n (or names) that can be used as a fallback for this option. For example,\n given a \"foo.js\" like this:\n\n var options = [{names: ['dry-run', 'n'], env: 'FOO_DRY_RUN'}];\n var opts = dashdash.parse({options: options});\n\n Both `node foo.js --dry-run` and `FOO_DRY_RUN=1 node foo.js` would result\n in `opts.dry_run = true`.\n\n An environment variable is only used as a fallback, i.e. it is ignored if\n the associated option is given in `argv`.\n\n- `help` (String). Optional. Used for `parser.help()` output.\n\n- `helpArg` (String). Optional. Used in help output as the placeholder for\n the option argument, e.g. the \"PATH\" in:\n\n ...\n -f PATH, --file=PATH File to process\n ...\n\n- `helpWrap` (Boolean). Optional, default true. Set this to `false` to have\n that option's `help` *not* be text wrapped in `<parser>.help()` output.\n\n- `default`. Optional. A default value used for this option, if the\n option isn't specified in argv.\n\n- `hidden` (Boolean). Optional, default false. If true, help output will not\n include this option.\n\n\n# Option group headings\n\nYou can add headings between option specs in the `options` array. To do so,\nsimply add an object with only a `group` property -- the string to print as\nthe heading for the subsequent options in the array. For example:\n\n```javascript\nvar options = [\n {\n group: 'Armament Options'\n },\n {\n names: [ 'weapon', 'w' ],\n type: 'string'\n },\n {\n group: 'General Options'\n },\n {\n names: [ 'help', 'h' ],\n type: 'bool'\n }\n];\n...\n```\n\nNote: You can use an empty string, `{group: ''}`, to get a blank line in help\noutput between groups of options.\n\n\n# Help config\n\nThe `parser.help(...)` function is configurable as follows:\n\n Options:\n Armament Options:\n ^^ -w WEAPON, --weapon=WEAPON Weapon with which to crush. One of: |\n / sword, spear, maul |\n / General Options: |\n / -h, --help Print this help and exit. |\n / ^^^^ ^ |\n \\ `-- indent `-- helpCol maxCol ---'\n `-- headingIndent\n\n- `indent` (Number or String). Default 4. Set to a number (for that many\n spaces) or a string for the literal indent.\n- `headingIndent` (Number or String). Default half length of `indent`. Set to\n a number (for that many spaces) or a string for the literal indent. This\n indent applies to group heading lines, between normal option lines.\n- `nameSort` (String). Default is 'length'. By default the names are\n sorted to put the short opts first (i.e. '-h, --help' preferred\n to '--help, -h'). Set to 'none' to not do this sorting.\n- `maxCol` (Number). Default 80. Note that reflow is just done on whitespace\n so a long token in the option help can overflow maxCol.\n- `helpCol` (Number). If not set a reasonable value will be determined\n between `minHelpCol` and `maxHelpCol`.\n- `minHelpCol` (Number). Default 20.\n- `maxHelpCol` (Number). Default 40.\n- `helpWrap` (Boolean). Default true. Set to `false` to have option `help`\n strings *not* be textwrapped to the helpCol..maxCol range.\n- `includeEnv` (Boolean). Default false. If the option has associated\n environment variables (via the `env` option spec attribute), then\n append mentioned of those envvars to the help string.\n- `includeDefault` (Boolean). Default false. If the option has a default value\n (via the `default` option spec attribute, or a default on the option's type),\n then a \"Default: VALUE\" string will be appended to the help string.\n\n\n# Custom option types\n\nDashdash includes a good starter set of option types that it will parse for\nyou. However you can add your own via:\n\n var dashdash = require('dashdash');\n dashdash.addOptionType({\n name: '...',\n takesArg: true,\n helpArg: '...',\n parseArg: function (option, optstr, arg) {\n ...\n },\n default: ... // optional\n });\n\nFor example, a simple option type that accepts 'yes', 'y', 'no' or 'n' as\na boolean argument would look like:\n\n var dashdash = require('dashdash');\n\n function parseYesNo(option, optstr, arg) {\n var argLower = arg.toLowerCase()\n if (~['yes', 'y'].indexOf(argLower)) {\n return true;\n } else if (~['no', 'n'].indexOf(argLower)) {\n return false;\n } else {\n throw new Error(format(\n 'arg for \"%s\" is not \"yes\" or \"no\": \"%s\"',\n optstr, arg));\n }\n }\n\n dashdash.addOptionType({\n name: 'yesno'\n takesArg: true,\n helpArg: '<yes|no>',\n parseArg: parseYesNo\n });\n\n var options = {\n {names: ['answer', 'a'], type: 'yesno'}\n };\n var opts = dashdash.parse({options: options});\n\nSee \"examples/custom-option-duration.js\" for another example adding a \"duration\"\noption type. Please let me know [on twitter](https://twitter.com/trentmick)\nor [with an issue](https://github.com/trentm/node-dashdash/issues/new) if you\nwrite a generally useful one.\n\n\n\n# Why\n\nWhy another node.js option parsing lib?\n\n- `nopt` really is just for \"tools like npm\". Implicit opts (e.g. '--no-foo'\n works for every '--foo'). Can't disable abbreviated opts. Can't do multiple\n usages of same opt, e.g. '-vvv' (I think). Can't do grouped short opts.\n\n- `optimist` has surprise interpretation of options (at least to me).\n Implicit opts mean ambiguities and poor error handling for fat-fingering.\n `process.exit` calls makes it hard to use as a libary.\n\n- `optparse` Incomplete docs. Is this an attempted clone of Python's `optparse`.\n Not clear. Some divergence. `parser.on(\"name\", ...)` API is weird.\n\n- `argparse` Dep on underscore. No thanks just for option processing.\n `find lib | wc -l` -> `26`. Overkill.\n Argparse is a bit different anyway. Not sure I want that.\n\n- `posix-getopt` No type validation. Though that isn't a killer. AFAIK can't\n have a long opt without a short alias. I.e. no `getopt_long` semantics.\n Also, no whizbang features like generated help output.\n\n- [\"commander.js\"](https://github.com/visionmedia/commander.js): I wrote\n [a critique](http://trentm.com/2014/01/a-critique-of-commander-for-nodejs.html)\n a while back. It seems fine, but last I checked had\n [an outstanding bug](https://github.com/visionmedia/commander.js/pull/121)\n that would prevent me from using it.\n\n\n# License\n\nMIT. See LICENSE.txt.\n",
- "readmeFilename": "README.md",
"bugs": {
"url": "https://github.com/trentm/node-dashdash/issues"
},
- "homepage": "https://github.com/trentm/node-dashdash",
- "_id": "dashdash@1.10.0",
- "_shasum": "119b756c1aa67e55dcfb3152e2e659d1d26f5229",
- "_from": "dashdash@^1.7.1"
+ "homepage": "https://github.com/trentm/node-dashdash"
}
View
7 src/img/node_modules/cmdln/package.json
@@ -28,13 +28,8 @@
"devDependencies": {
"nodeunit": "0.9.0"
},
- "readme": "`node-cmdln` is a node.js helper lib for creating CLI tools with subcommands\n(think `git`, `svn`, `zfs`, `brew`, etc.). It is a sister of my earlier\n[Python lib for this](https://github.com/trentm/cmdln).\n\nFollow <a href=\"https://twitter.com/intent/user?screen_name=trentmick\" target=\"_blank\">@trentmick</a>\nfor updates to node-cmdln.\n\n\n# Usage\n\nYou define a subclass of `Cmdln` and subcommands as `do_NAME` methods.\nMinimally you could have a \"conan.js\" as follows:\n\n```javascript\n#!/usr/bin/env node\nvar util = require('util');\nvar cmdln = require('cmdln');\n\nfunction Conan() {\n cmdln.Cmdln.call(this, {\n name: 'conan',\n desc: 'What is best in life?'\n });\n}\nutil.inherits(Conan, cmdln.Cmdln);\n\nConan.prototype.do_crush = function do_crush(subcmd, opts, args, cb) {\n console.log('Yargh!');\n cb();\n};\nConan.prototype.do_crush.help = 'Crush your enemies.';\n\ncmdln.main(new Conan()); // mainline\n```\n\nWith this, you get the following behaviour:\n\n```bash\n$ node examples/conan.js\nWhat is best in life?\n\nUsage:\n conan [OPTIONS] COMMAND [ARGS...]\n conan help COMMAND\n\nOptions:\n -h, --help Show this help message and exit.\n\nCommands:\n help (?) Help on a specific sub-command.\n crush Crush your enemies.\n\n$ node examples/conan.js help crush\nCrush your enemies.\n\n$ node examples/conan.js crush\nYargh!\n```\n\n\n# Option processing\n\nOption processing (using [dashdash](https://github.com/trentm/node-dashdash))\nis integrated. `do_crush` above could be replaced with:\n\n```javascript\nConan.prototype.do_crush = function (subcmd, opts, args, cb) {\n if (opts.help) {\n this.do_help('help', {}, [subcmd], cb);\n return;\n }\n if (!args.length) {\n console.log('No enemies? Yarg!');\n } else {\n args.forEach(function (enemy) {\n console.log('Smite %s with a %s!', enemy, opts.weapon);\n });\n }\n cb();\n};\nConan.prototype.do_crush.options = [\n {\n names: ['help', 'h'],\n type: 'bool',\n help: 'Show this help.'\n },\n {\n names: ['weapon', 'w'],\n helpArg: 'WEAPON',\n type: 'string',\n default: 'sword',\n help: 'Weapon with which to smite.'\n }\n];\nConan.prototype.do_crush.help = (\n 'Crush your enemies.\\n'\n + '\\n'\n + 'Usage:\\n'\n + ' {{name}} crush [OPTIONS] [ENEMIES...]\\n'\n + '\\n'\n + '{{options}}'\n);\n```\n\nThen we get this behaviour:\n\n```bash\n$ node examples/conan.js crush Bob\nSmite Bob with a sword!\n\n$ node examples/conan.js crush Bob Linda --weapon mattock\nSmite Bob with a mattock!\nSmite Linda with a mattock!\n\n$ node examples/conan.js crush -h\nCrush your enemies.\n\nUsage:\n conan crush [OPTIONS] [ENEMIES...]\n\nOptions:\n -h, --help Show this help.\n -w WEAPON, --weapon=WEAPON Weapon with which to smite.\n```\n\n\nSee [examples/conan.js](examples/conan.js) for the complete example. Run\n`node example/conan.js ...` to try it out.\n\n\n# Reference\n\nIn general, please read the comments in [the source](./lib/cmdln.js) and\n[browse the examples](./examples/). The API is far from fully documented here.\n\n## `cmdln.Cmdln`\n\nTo use this module you create a class that inherits from `cmdln.Cmdln`; add\nsome methods to that class that define the tool's commands, options, etc.;\nthen pass an instance to `cmdln.main()`. Roughly like this:\n\n function CLI() {\n cmdln.Cmdln.call(this, {<config>});\n }\n util.inherits(CLI, cmdln.Cmdln);\n ...\n var cli = new CLI();\n cmdln.main(cli);\n\nWe'll use the `CLI` and `cli` names as used above in the following reference:\n\n- `new Cmdln(<config>)` Create a Cmdln subclass instance. See the block comment\n in the code for full documentation on the `config` options.\n\n- `CLI.prototype.do_<subcmd> = function (subcmd, opts, args, cb)` is how a\n subcommand is defined. How the subcmd is handled can be customize with some\n properties (e.g. `options`, `help`) on the handler function.\n\n- `CLI.prototype.do_<subcmd> = <SubCLI>;` Instead of a function handler for a\n subcommand, a `do_<subcmd>` can be set to another Cmdln subclass to support\n sub-subcommands, like `git remote add|remove|rename|...`. See\n [\"examples/fauxgit.js\"](./examples/fauxgit.js) for an example.\n\n- `CLI.prototype.do_<subcmd>.aliases = <array of strings>;` to define one or\n more aliases for a command. These aliases are shown in the \"Commands:\"\n section of the generated help output.\n\n- `CLI.prototype.do_<subcmd>.hiddenAliases = <array of strings>;` to define one\n or more aliases for a command **that are not shown in the generated help\n output**. This can be useful when renaming a subcommand in a new version of\n a tool and still support the old name.\n\n- `CLI.prototype.do_<subcmd>.options = <object>;` is how to set the options\n (in [dashdash](https://github.com/trentm/node-dashdash) format) for that\n subcommand.\n\n- `CLI.prototype.do_<subcmd>.helpOpts = <dashdash helpOpts object>;` to override\n formatting settings for `options` help output for this command. By default\n the `helpOpts` passed into the CLI constructor are used. The set of supported\n helpOpts are defined by\n [dashdash](https://github.com/trentm/node-dashdash#help-config).\n\n- `CLI.prototype.do_<subcmd>.help = <string>;` to set the help string for a\n subcommand.\n\n- `CLI.prototype.do_<subcmd>.help = function (subcmd, opts, args, cb)` is\n an alternate method to handle help for a subcommand. The given function\n will be run when `tool help <subcmd>` is called.\n\n- `CLI.prototype.do_<subcmd>.desc = <string>;` can be set to a short string\n to be used in the `tool help` output to summarize subcmd. If not provided,\n then the first line of `do_<subcmd>.help` will be used.\n\n- `CLI.prototype.do_<subcmd>.hidden = <boolean>;` Set to false to have\n `tool help` output *not* list this subcmd.\n\n- `<Cmdln>.prototype.init(opts, args, cb)` Hook run after option processing\n (`this.opts` is set), but before the subcommand handler is run.\n\n- `<Cmdln>.prototype.fini(subcmd, cb)` Hook run after the subcommand handler is\n run.\n\n- `<Cmdln>.showErrStack` boolean. Set to true to have `cmdln.main()`, if used,\n print a full stack on a shown error. When wanted, this is typically set\n in If you want this option it is typically\n set either\n\n- `<Cmdln>.handlerFromSubcmd(<subcmd>)` will return the appropriate\n `do_<subcmd>` method that handles the given sub-command. This resolves\n sub-command aliases.\n\n- `<Cmdln>.helpFromSubcmd(<subcmd>)` will return the help string for\n that subcmd *or*, if defined, the help function defined for that subcmd.\n This is used by the default `do_help` implementation.\n\n\n## `cmdln.main()`\n\nThis is a convenience method for driving the mainline of your script using\nthe your defined `Cmdln` subclass. There are a number of options to control\nhow it works. Read the block comment on that function in \"lib/cmdln.js\" for\nthe best docs.\n\n\n# License\n\nMIT. See LICENSE.txt\n",
- "readmeFilename": "README.md",
"bugs": {
"url": "https://github.com/trentm/node-cmdln/issues"
},
- "homepage": "https://github.com/trentm/node-cmdln",
- "_id": "cmdln@3.2.1",
- "_shasum": "8d21967625b25ee35fca8e8453ccf10fccd04e45",
- "_from": "cmdln@3.2.1"
+ "homepage": "https://github.com/trentm/node-cmdln"
}
View
12 src/img/node_modules/docker-registry-client/node_modules/strsplit/package.json
@@ -18,15 +18,5 @@
"license": "MIT",
"scripts": {
"test": "make test"
- },
- "readme": "# node-strsplit: split a string by a regular expression\n\n## strsplit(str, [pattern[, limit]])\n\nSplits a string `str` into fields using `pattern` as the separator, which may be\neither a string or a regular expression. If `pattern` is not specified, then\nthe regular expression `\\s+` is used to split on whitespace.\n\nIf `limit` is a positive number, the pattern will be applied at most `limit - 1`\ntimes and the returned array will have at most `limit` elements. The last\nelement will contain all of `str` beyond the last separator. (This is unlike\nthe JavaScript standard String.split method, which also provides a `limit`\nargument to control the number of returned fields. String.split always applies\nthe pattern as many times as possible, and only returns the first `limit`\nfields, so the rest of the input is lost. See Notes below for details.)\n\nIf `limit` is unspecified, negative, or zero, then there is no limit on the\nnumber of matches or returned fields. Additionally, if `limit` is zero,\ntrailing empty fields are discarded.\n\nIt's often desirable to skip leading empty fields as well, as awk(1) and bash(1)\ndo in processing fields. To do this, use String.trim before calling strsplit.\n\n\n## Examples\n\nSplit a colon-separated list (e.g., a line from /etc/passwd):\n\n > strsplit('nobody:*:-2:-2:Nobody User:/var/empty:/usr/bin/false', ':');\n [ 'nobody', '*', '-2', '-2', 'Nobody User', '/var/empty', '/usr/bin/false' ]\n\nSplit a whitespace-separated list (e.g., output from \"ps\"):\n\n > strsplit('86008 ttys000 0:00.05 -bash', /\\s+/);\n [ '86008', 'ttys000', '0:00.05', '-bash' ]\n\nSimilarly, split a line into words:\n\n > strsplit('How about a game of chess?', /\\s+/)\n [ 'How', 'about', 'a', 'game', 'of', 'chess?' ]\n\nSome tabular data formats allow the last field to contain the delimeter. The\nreader is expected to know how many fields there are to avoid getting confused.\nThe number of fields can be specified with the `limit` argument:\n\n > /* 4 Fields: Games, Wins, Losses, Team Name */\n > strsplit('101 55 46 San Francisco Giants', ' ', 4);\n [ '101', '55', '46', 'San Francisco Giants' ]\n\nSee [node-tab](https://github.com/davepacheco/node-tab) for a higher-level\ninterface to read and write tabular data.\n\n\n## Notes\n\nAs described above, `strsplit` is similar to `String.split`, but limits the\nnumber of times the pattern is matched rather than simply the number of matched\nfields returned. If you actually want only the first N matches, then specify no\nlimit and call `slice` on the result (or just use String.split). If `limit` is\nnegative or unspecified, the behavior is exactly identical to\n`str.split(pattern)`.\n\nBy comparison, here's String.split:\n\n > 'alpha bravo charlie delta'.split(' ', 3)\n [ 'alpha', 'bravo', 'charlie' ]\n\nand here's strsplit:\n\n > strsplit('alpha bravo charlie delta', ' ', 3)\n [ 'alpha', 'bravo', 'charlie delta' ]\n\nThis is the behavior implemented by `split` in Perl, Java, and Python.\n\n## Background: survey of \"split\" in Java, Perl, and Python\n\nThe tests directory contains test cases and test programs in Java, Perl, and\nPython for figuring out what these language's string split function does.\nSpecifically, this is:\n\n* Java: String.split.\n* Perl: split.\n* Python: re.split. While the \"split\" method on strings may be more common, it\n does not handle regular expressions, while the Java and Perl counterparts do.\n\nFor comparison, there's also a test case for this implementation of \"strsplit\".\nin JavaScript.\n\nThe test cases here test both a simple string as a splitter (a space) and a\nsimple regular expression (`\\s+`, indicating some non-zero number of whitespace\ncharacters), as well as various values of the optional \"limit\" parameter.\n\nIn summary, in all of the cases tried, the Java and Perl implementations are\nidentical. The Python implementation differs in a few ways:\n\n* The \"limit\" argument is off-by-one relative to the Java and Perl APIs. It\n represents the maximum number of splits to be made, rather than the maximum\n number of returned fields.\n* -1 for \"limit\" is not special, and seems to mean that at most -1 splits will\n be made, meaning the string is not split at all. In Java and Perl, -1 means\n there is no limit to the number of returned fields.\n* Java and Perl strip trailing empty fields when \"limit\" is 0. Python never\n strips trailing empty fields.\n\nJavaScript has a \"split\" method, but it behaves substantially different than all\nof these implementations when \"limit\" is specified. This implementation of\n\"strsplit\" for JavaScript mirrors the Java and Perl implementations, as the\ndifferences in Python do not seem substantial or better.\n\nThe remaining use case that would be nice to address is splitting fields the way\nawk(1) and bash(1) do, which is to strip leading whitespace. Python's *string*\nsplit also does this, but only if you specify None as the pattern. strsplit\ndoesn't support this; just trim the string first if you want that behavior.\n",
- "readmeFilename": "README.md",
- "bugs": {
- "url": "https://github.com/davepacheco/node-strsplit/issues"
- },
- "homepage": "https://github.com/davepacheco/node-strsplit",
- "_id": "strsplit@1.0.0",
- "_shasum": "0fdedc68e91addcfcb2e6be9c262581a6e8c28aa",
- "_from": "strsplit@1.x",
- "_resolved": "https://registry.npmjs.org/strsplit/-/strsplit-1.0.0.tgz"
+ }
}
View
8 ...dules/docker-registry-client/node_modules/tough-cookie/node_modules/punycode/package.json
@@ -51,11 +51,5 @@
"qunit-extras": "^1.2.0",
"qunitjs": "~1.11.0",
"requirejs": "^2.1.14"
- },
- "readme": "# Punycode.js [![Build status](https://travis-ci.org/bestiejs/punycode.js.svg?branch=master)](https://travis-ci.org/bestiejs/punycode.js) [![Code coverage status](http://img.shields.io/coveralls/bestiejs/punycode.js/master.svg)](https://coveralls.io/r/bestiejs/punycode.js) [![Dependency status](https://gemnasium.com/bestiejs/punycode.js.svg)](https://gemnasium.com/bestiejs/punycode.js)\n\nA robust Punycode converter that fully complies to [RFC 3492](http://tools.ietf.org/html/rfc3492) and [RFC 5891](http://tools.ietf.org/html/rfc5891), and works on nearly all JavaScript platforms.\n\nThis JavaScript library is the result of comparing, optimizing and documenting different open-source implementations of the Punycode algorithm:\n\n* [The C example code from RFC 3492](http://tools.ietf.org/html/rfc3492#appendix-C)\n* [`punycode.c` by _Markus W. Scherer_ (IBM)](http://opensource.apple.com/source/ICU/ICU-400.42/icuSources/common/punycode.c)\n* [`punycode.c` by _Ben Noordhuis_](https://github.com/bnoordhuis/punycode/blob/master/punycode.c)\n* [JavaScript implementation by _some_](http://stackoverflow.com/questions/183485/can-anyone-recommend-a-good-free-javascript-for-punycode-to-unicode-conversion/301287#301287)\n* [`punycode.js` by _Ben Noordhuis_](https://github.com/joyent/node/blob/426298c8c1c0d5b5224ac3658c41e7c2a3fe9377/lib/punycode.js) (note: [not fully compliant](https://github.com/joyent/node/issues/2072))\n\nThis project is [bundled](https://github.com/joyent/node/blob/master/lib/punycode.js) with [Node.js v0.6.2+](https://github.com/joyent/node/compare/975f1930b1...61e796decc).\n\n## Installation\n\nVia [npm](http://npmjs.org/) (only required for Node.js releases older than v0.6.2):\n\n```bash\nnpm install punycode\n```\n\nVia [Bower](http://bower.io/):\n\n```bash\nbower install punycode\n```\n\nVia [Component](https://github.com/component/component):\n\n```bash\ncomponent install bestiejs/punycode.js\n```\n\nIn a browser:\n\n```html\n<script src=\"punycode.js\"></script>\n```\n\nIn [Narwhal](http://narwhaljs.org/), [Node.js](http://nodejs.org/), and [RingoJS](http://ringojs.org/):\n\n```js\nvar punycode = require('punycode');\n```\n\nIn [Rhino](http://www.mozilla.org/rhino/):\n\n```js\nload('punycode.js');\n```\n\nUsing an AMD loader like [RequireJS](http://requirejs.org/):\n\n```js\nrequire(\n {\n 'paths': {\n 'punycode': 'path/to/punycode'\n }\n },\n ['punycode'],\n function(punycode) {\n console.log(punycode);\n }\n);\n```\n\n## API\n\n### `punycode.decode(string)`\n\nConverts a Punycode string of ASCII symbols to a string of Unicode symbols.\n\n```js\n// decode domain name parts\npunycode.decode('maana-pta'); // 'mañana'\npunycode.decode('--dqo34k'); // '☃-⌘'\n```\n\n### `punycode.encode(string)`\n\nConverts a string of Unicode symbols to a Punycode string of ASCII symbols.\n\n```js\n// encode domain name parts\npunycode.encode('mañana'); // 'maana-pta'\npunycode.encode('☃-⌘'); // '--dqo34k'\n```\n\n### `punycode.toUnicode(input)`\n\nConverts a Punycode string representing a domain name or an email address to Unicode. Only the Punycoded parts of the input will be converted, i.e. it doesn’t matter if you call it on a string that has already been converted to Unicode.\n\n```js\n// decode domain names\npunycode.toUnicode('xn--maana-pta.com');\n// → 'mañana.com'\npunycode.toUnicode('xn----dqo34k.com');\n// → '☃-⌘.com'\n\n// decode email addresses\npunycode.toUnicode('джумла@xn--p-8sbkgc5ag7bhce.xn--ba-lmcq');\n// → 'джумла@джpумлатест.bрфa'\n```\n\n### `punycode.toASCII(input)`\n\nConverts a Unicode string representing a domain name or an email address to Punycode. Only the non-ASCII parts of the input will be converted, i.e. it doesn’t matter if you call it with a domain that's already in ASCII.\n\n```js\n// encode domain names\npunycode.toASCII('mañana.com');\n// → 'xn--maana-pta.com'\npunycode.toASCII('☃-⌘.com');\n// → 'xn----dqo34k.com'\n\n// encode email addresses\npunycode.toASCII('джумла@джpумлатест.bрфa');\n// → 'джумла@xn--p-8sbkgc5ag7bhce.xn--ba-lmcq'\n```\n\n### `punycode.ucs2`\n\n#### `punycode.ucs2.decode(string)`\n\nCreates an array containing the numeric code point values of each Unicode symbol in the string. While [JavaScript uses UCS-2 internally](https://mathiasbynens.be/notes/javascript-encoding), this function will convert a pair of surrogate halves (each of which UCS-2 exposes as separate characters) into a single code point, matching UTF-16.\n\n```js\npunycode.ucs2.decode('abc');\n// → [0x61, 0x62, 0x63]\n// surrogate pair for U+1D306 TETRAGRAM FOR CENTRE:\npunycode.ucs2.decode('\\uD834\\uDF06');\n// → [0x1D306]\n```\n\n#### `punycode.ucs2.encode(codePoints)`\n\nCreates a string based on an array of numeric code point values.\n\n```js\npunycode.ucs2.encode([0x61, 0x62, 0x63]);\n// → 'abc'\npunycode.ucs2.encode([0x1D306]);\n// → '\\uD834\\uDF06'\n```\n\n### `punycode.version`\n\nA string representing the current Punycode.js version number.\n\n## Unit tests & code coverage\n\nAfter cloning this repository, run `npm install --dev` to install the dependencies needed for Punycode.js development and testing. You may want to install Istanbul _globally_ using `npm install istanbul -g`.\n\nOnce that’s done, you can run the unit tests in Node using `npm test` or `node tests/tests.js`. To run the tests in Rhino, Ringo, Narwhal, PhantomJS, and web browsers as well, use `grunt test`.\n\nTo generate the code coverage report, use `grunt cover`.\n\nFeel free to fork if you see possible improvements!\n\n## Author\n\n| [![twitter/mathias](https://gravatar.com/avatar/24e08a9ea84deb17ae121074d0f17125?s=70)](https://twitter.com/mathias \"Follow @mathias on Twitter\") |\n|---|\n| [Mathias Bynens](https://mathiasbynens.be/) |\n\n## Contributors\n\n| [![twitter/jdalton](https://gravatar.com/avatar/299a3d891ff1920b69c364d061007043?s=70)](https://twitter.com/jdalton \"Follow @jdalton on Twitter\") |\n|---|\n| [John-David Dalton](http://allyoucanleet.com/) |\n\n## License\n\nPunycode.js is available under the [MIT](https://mths.be/mit) license.\n",
- "readmeFilename": "README.md",
- "_id": "punycode@1.3.2",
- "_shasum": "9653a036fb7c1ee42342f2325cceefea3926c48d",
- "_from": "punycode@>=0.2.0",
- "_resolved": "https://registry.npmjs.org/punycode/-/punycode-1.3.2.tgz"
+ }
}
View
8 src/img/node_modules/docker-registry-client/node_modules/tough-cookie/package.json
@@ -38,11 +38,5 @@
"devDependencies": {
"vows": "0.7.0",
"async": ">=0.1.12"
- },
- "readme": "[RFC6265](http://tools.ietf.org/html/rfc6265) Cookies and CookieJar for Node.js\n\n![Tough Cookie](http://www.goinstant.com.s3.amazonaws.com/tough-cookie.jpg)\n\n[![Build Status](https://travis-ci.org/goinstant/node-cookie.png?branch=master)](https://travis-ci.org/goinstant/node-cookie)\n\n[![NPM Stats](https://nodei.co/npm/tough-cookie.png?downloads=true&stars=true)](https://npmjs.org/package/tough-cookie)\n![NPM Downloads](https://nodei.co/npm-dl/tough-cookie.png?months=9)\n\n# Synopsis\n\n``` javascript\nvar tough = require('tough-cookie'); // note: not 'cookie', 'cookies' or 'node-cookie'\nvar Cookie = tough.Cookie;\nvar cookie = Cookie.parse(header);\ncookie.value = 'somethingdifferent';\nheader = cookie.toString();\n\nvar cookiejar = new tough.CookieJar();\ncookiejar.setCookie(cookie, 'http://currentdomain.example.com/path', cb);\n// ...\ncookiejar.getCookies('http://example.com/otherpath',function(err,cookies) {\n res.headers['cookie'] = cookies.join('; ');\n});\n```\n\n# Installation\n\nIt's _so_ easy!\n\n`npm install tough-cookie`\n\nRequires `punycode`, which should get installed automatically for you. Note that node.js v0.6.2+ bundles punycode by default.\n\nWhy the name? NPM modules `cookie`, `cookies` and `cookiejar` were already taken.\n\n# API\n\ntough\n=====\n\nFunctions on the module you get from `require('tough-cookie')`. All can be used as pure functions and don't need to be \"bound\".\n\nparseDate(string[,strict])\n-----------------\n\nParse a cookie date string into a `Date`. Parses according to RFC6265 Section 5.1.1, not `Date.parse()`. If strict is set to true then leading/trailing non-seperator characters around the time part will cause the parsing to fail (e.g. \"Thu, 01 Jan 1970 00:00:010 GMT\" has an extra trailing zero but Chrome, an assumedly RFC-compliant browser, treats this as valid).\n\nformatDate(date)\n----------------\n\nFormat a Date into a RFC1123 string (the RFC6265-recommended format).\n\ncanonicalDomain(str)\n--------------------\n\nTransforms a domain-name into a canonical domain-name. The canonical domain-name is a trimmed, lowercased, stripped-of-leading-dot and optionally punycode-encoded domain-name (Section 5.1.2 of RFC6265). For the most part, this function is idempotent (can be run again on its output without ill effects).\n\ndomainMatch(str,domStr[,canonicalize=true])\n-------------------------------------------\n\nAnswers \"does this real domain match the domain in a cookie?\". The `str` is the \"current\" domain-name and the `domStr` is the \"cookie\" domain-name. Matches according to RFC6265 Section 5.1.3, but it helps to think of it as a \"suffix match\".\n\nThe `canonicalize` parameter will run the other two paramters through `canonicalDomain` or not.\n\ndefaultPath(path)\n-----------------\n\nGiven a current request/response path, gives the Path apropriate for storing in a cookie. This is basically the \"directory\" of a \"file\" in the path, but is specified by Section 5.1.4 of the RFC.\n\nThe `path` parameter MUST be _only_ the pathname part of a URI (i.e. excludes the hostname, query, fragment, etc.). This is the `.pathname` property of node's `uri.parse()` output.\n\npathMatch(reqPath,cookiePath)\n-----------------------------\n\nAnswers \"does the request-path path-match a given cookie-path?\" as per RFC6265 Section 5.1.4. Returns a boolean.\n\nThis is essentially a prefix-match where `cookiePath` is a prefix of `reqPath`.\n\nparse(header[,strict=false])\n----------------------------\n\nalias for `Cookie.parse(header[,strict])`\n\nfromJSON(string)\n----------------\n\nalias for `Cookie.fromJSON(string)`\n\ngetPublicSuffix(hostname)\n-------------------------\n\nReturns the public suffix of this hostname. The public suffix is the shortest domain-name upon which a cookie can be set. Returns `null` if the hostname cannot have cookies set for it.\n\nFor example: `www.example.com` and `www.subdomain.example.com` both have public suffix `example.com`.\n\nFor further information, see http://publicsuffix.org/. This module derives its list from that site.\n\ncookieCompare(a,b)\n------------------\n\nFor use with `.sort()`, sorts a list of cookies into the recommended order given in the RFC (Section 5.4 step 2). Longest `.path`s go first, then sorted oldest to youngest.\n\n``` javascript\nvar cookies = [ /* unsorted array of Cookie objects */ ];\ncookies = cookies.sort(cookieCompare);\n```\n\npermuteDomain(domain)\n---------------------\n\nGenerates a list of all possible domains that `domainMatch()` the parameter. May be handy for implementing cookie stores.\n\n\npermutePath(path)\n-----------------\n\nGenerates a list of all possible paths that `pathMatch()` the parameter. May be handy for implementing cookie stores.\n\nCookie\n======\n\nCookie.parse(header[,strict=false])\n-----------------------------------\n\nParses a single Cookie or Set-Cookie HTTP header into a `Cookie` object. Returns `undefined` if the string can't be parsed. If in strict mode, returns `undefined` if the cookie doesn't follow the guidelines in section 4 of RFC6265. Generally speaking, strict mode can be used to validate your own generated Set-Cookie headers, but acting as a client you want to be lenient and leave strict mode off.\n\nHere's how to process the Set-Cookie header(s) on a node HTTP/HTTPS response:\n\n``` javascript\nif (res.headers['set-cookie'] instanceof Array)\n cookies = res.headers['set-cookie'].map(function (c) { return (Cookie.parse(c)); });\nelse\n cookies = [Cookie.parse(res.headers['set-cookie'])];\n```\n\nCookie.fromJSON(string)\n-----------------------\n\nConvert a JSON string to a `Cookie` object. Does a `JSON.parse()` and converts the `.created`, `.lastAccessed` and `.expires` properties into `Date` objects.\n\nProperties\n==========\n\n * _key_ - string - the name or key of the cookie (default \"\")\n * _value_ - string - the value of the cookie (default \"\")\n * _expires_ - `Date` - if set, the `Expires=` attribute of the cookie (defaults to the string `\"Infinity\"`). See `setExpires()`\n * _maxAge_ - seconds - if set, the `Max-Age=` attribute _in seconds_ of the cookie. May also be set to strings `\"Infinity\"` and `\"-Infinity\"` for non-expiry and immediate-expiry, respectively. See `setMaxAge()`\n * _domain_ - string - the `Domain=` attribute of the cookie\n * _path_ - string - the `Path=` of the cookie\n * _secure_ - boolean - the `Secure` cookie flag\n * _httpOnly_ - boolean - the `HttpOnly` cookie flag\n * _extensions_ - `Array` - any unrecognized cookie attributes as strings (even if equal-signs inside)\n\nAfter a cookie has been passed through `CookieJar.setCookie()` it will have the following additional attributes:\n\n * _hostOnly_ - boolean - is this a host-only cookie (i.e. no Domain field was set, but was instead implied)\n * _pathIsDefault_ - boolean - if true, there was no Path field on the cookie and `defaultPath()` was used to derive one.\n * _created_ - `Date` - when this cookie was added to the jar\n * _lastAccessed_ - `Date` - last time the cookie got accessed. Will affect cookie cleaning once implemented. Using `cookiejar.getCookies(...)` will update this attribute.\n\nConstruction([{options}])\n------------\n\nReceives an options object that can contain any Cookie properties, uses the default for unspecified properties.\n\n.toString()\n-----------\n\nencode to a Set-Cookie header value. The Expires cookie field is set using `formatDate()`, but is omitted entirely if `.expires` is `Infinity`.\n\n.cookieString()\n---------------\n\nencode to a Cookie header value (i.e. the `.key` and `.value` properties joined with '=').\n\n.setExpires(String)\n-------------------\n\nsets the expiry based on a date-string passed through `parseDate()`. If parseDate returns `null` (i.e. can't parse this date string), `.expires` is set to `\"Infinity\"` (a string) is set.\n\n.setMaxAge(number)\n-------------------\n\nsets the maxAge in seconds. Coerces `-Infinity` to `\"-Infinity\"` and `Infinity` to `\"Infinity\"` so it JSON serializes correctly.\n\n.expiryTime([now=Date.now()])\n-----------------------------\n\n.expiryDate([now=Date.now()])\n-----------------------------\n\nexpiryTime() Computes the absolute unix-epoch milliseconds that this cookie expires. expiryDate() works similarly, except it returns a `Date` object. Note that in both cases the `now` parameter should be milliseconds.\n\nMax-Age takes precedence over Expires (as per the RFC). The `.created` attribute -- or, by default, the `now` paramter -- is used to offset the `.maxAge` attribute.\n\nIf Expires (`.expires`) is set, that's returned.\n\nOtherwise, `expiryTime()` returns `Infinity` and `expiryDate()` returns a `Date` object for \"Tue, 19 Jan 2038 03:14:07 GMT\" (latest date that can be expressed by a 32-bit `time_t`; the common limit for most user-agents).\n\n.TTL([now=Date.now()])\n---------\n\ncompute the TTL relative to `now` (milliseconds). The same precedence rules as for `expiryTime`/`expiryDate` apply.\n\nThe \"number\" `Infinity` is returned for cookies without an explicit expiry and `0` is returned if the cookie is expired. Otherwise a time-to-live in milliseconds is returned.\n\n.canonicalizedDoman()\n---------------------\n\n.cdomain()\n----------\n\nreturn the canonicalized `.domain` field. This is lower-cased and punycode (RFC3490) encoded if the domain has any non-ASCII characters.\n\n.validate()\n-----------\n\nStatus: *IN PROGRESS*. Works for a few things, but is by no means comprehensive.\n\nvalidates cookie attributes for semantic correctness. Useful for \"lint\" checking any Set-Cookie headers you generate. For now, it returns a boolean, but eventually could return a reason string -- you can future-proof with this construct:\n\n``` javascript\nif (cookie.validate() === true) {\n // it's tasty\n} else {\n // yuck!\n}\n```\n\nCookieJar\n=========\n\nConstruction([store = new MemoryCookieStore()][, rejectPublicSuffixes])\n------------\n\nSimply use `new CookieJar()`. If you'd like to use a custom store, pass that to the constructor otherwise a `MemoryCookieStore` will be created and used.\n\n\nAttributes\n----------\n\n * _rejectPublicSuffixes_ - boolean - reject cookies with domains like \"com\" and \"co.uk\" (default: `true`)\n\nSince eventually this module would like to support database/remote/etc. CookieJars, continuation passing style is used for CookieJar methods.\n\n.setCookie(cookieOrString, currentUrl, [{options},] cb(err,cookie))\n-------------------------------------------------------------------\n\nAttempt to set the cookie in the cookie jar. If the operation fails, an error will be given to the callback `cb`, otherwise the cookie is passed through. The cookie will have updated `.created`, `.lastAccessed` and `.hostOnly` properties.\n\nThe `options` object can be omitted and can have the following properties:\n\n * _http_ - boolean - default `true` - indicates if this is an HTTP or non-HTTP API. Affects HttpOnly cookies.\n * _secure_ - boolean - autodetect from url - indicates if this is a \"Secure\" API. If the currentUrl starts with `https:` or `wss:` then this is defaulted to `true`, otherwise `false`.\n * _now_ - Date - default `new Date()` - what to use for the creation/access time of cookies\n * _strict_ - boolean - default `false` - perform extra checks\n * _ignoreError_ - boolean - default `false` - silently ignore things like parse errors and invalid domains. CookieStore errors aren't ignored by this option.\n\nAs per the RFC, the `.hostOnly` property is set if there was no \"Domain=\" parameter in the cookie string (or `.domain` was null on the Cookie object). The `.domain` property is set to the fully-qualified hostname of `currentUrl` in this case. Matching this cookie requires an exact hostname match (not a `domainMatch` as per usual).\n\n.setCookieSync(cookieOrString, currentUrl, [{options}])\n-------------------------------------------------------\n\nSynchronous version of `setCookie`; only works with synchronous stores (e.g. the default `MemoryCookieStore`).\n\n.storeCookie(cookie, [{options},] cb(err,cookie))\n-------------------------------------------------\n\n__REMOVED__ removed in lieu of the CookieStore API below\n\n.getCookies(currentUrl, [{options},] cb(err,cookies))\n-----------------------------------------------------\n\nRetrieve the list of cookies that can be sent in a Cookie header for the current url.\n\nIf an error is encountered, that's passed as `err` to the callback, otherwise an `Array` of `Cookie` objects is passed. The array is sorted with `cookieCompare()` unless the `{sort:false}` option is given.\n\nThe `options` object can be omitted and can have the following properties:\n\n * _http_ - boolean - default `true` - indicates if this is an HTTP or non-HTTP API. Affects HttpOnly cookies.\n * _secure_ - boolean - autodetect from url - indicates if this is a \"Secure\" API. If the currentUrl starts with `https:` or `wss:` then this is defaulted to `true`, otherwise `false`.\n * _now_ - Date - default `new Date()` - what to use for the creation/access time of cookies\n * _expire_ - boolean - default `true` - perform expiry-time checking of cookies and asynchronously remove expired cookies from the store. Using `false` will return expired cookies and **not** remove them from the store (which is useful for replaying Set-Cookie headers, potentially).\n * _allPaths_ - boolean - default `false` - if `true`, do not scope cookies by path. The default uses RFC-compliant path scoping. **Note**: may not be supported by the CookieStore `fetchCookies` function (the default MemoryCookieStore supports it).\n\nThe `.lastAccessed` property of the returned cookies will have been updated.\n\n.getCookiesSync(currentUrl, [{options}])\n----------------------------------------\n\nSynchronous version of `getCookies`; only works with synchronous stores (e.g. the default `MemoryCookieStore`).\n\n.getCookieString(...)\n---------------------\n\nAccepts the same options as `.getCookies()` but passes a string suitable for a Cookie header rather than an array to the callback. Simply maps the `Cookie` array via `.cookieString()`.\n\n.getCookieStringSync(...)\n-------------------------\n\nSynchronous version of `getCookieString`; only works with synchronous stores (e.g. the default `MemoryCookieStore`).\n\n.getSetCookieStrings(...)\n-------------------------\n\nReturns an array of strings suitable for **Set-Cookie** headers. Accepts the same options as `.getCookies()`. Simply maps the cookie array via `.toString()`.\n\n.getSetCookieStringsSync(...)\n-----------------------------\n\nSynchronous version of `getSetCookieStrings`; only works with synchronous stores (e.g. the default `MemoryCookieStore`).\n\nStore\n=====\n\nBase class for CookieJar stores.\n\n# CookieStore API\n\nThe storage model for each `CookieJar` instance can be replaced with a custom implementation. The default is `MemoryCookieStore` which can be found in the `lib/memstore.js` file. The API uses continuation-passing-style to allow for asynchronous stores.\n\nStores should inherit from the base `Store` class, which is available as `require('tough-cookie').Store`. Stores are asynchronous by default, but if `store.synchronous` is set, then the `*Sync` methods on the CookieJar can be used.\n\nAll `domain` parameters will have been normalized before calling.\n\nThe Cookie store must have all of the following methods.\n\nstore.findCookie(domain, path, key, cb(err,cookie))\n---------------------------------------------------\n\nRetrieve a cookie with the given domain, path and key (a.k.a. name). The RFC maintains that exactly one of these cookies should exist in a store. If the store is using versioning, this means that the latest/newest such cookie should be returned.\n\nCallback takes an error and the resulting `Cookie` object. If no cookie is found then `null` MUST be passed instead (i.e. not an error).\n\nstore.findCookies(domain, path, cb(err,cookies))\n------------------------------------------------\n\nLocates cookies matching the given domain and path. This is most often called in the context of `cookiejar.getCookies()` above.\n\nIf no cookies are found, the callback MUST be passed an empty array.\n\nThe resulting list will be checked for applicability to the current request according to the RFC (domain-match, path-match, http-only-flag, secure-flag, expiry, etc.), so it's OK to use an optimistic search algorithm when implementing this method. However, the search algorithm used SHOULD try to find cookies that `domainMatch()` the domain and `pathMatch()` the path in order to limit the amount of checking that needs to be done.\n\nAs of version 0.9.12, the `allPaths` option to `cookiejar.getCookies()` above will cause the path here to be `null`. If the path is `null`, path-matching MUST NOT be performed (i.e. domain-matching only).\n\nstore.putCookie(cookie, cb(err))\n--------------------------------\n\nAdds a new cookie to the store. The implementation SHOULD replace any existing cookie with the same `.domain`, `.path`, and `.key` properties -- depending on the nature of the implementation, it's possible that between the call to `fetchCookie` and `putCookie` that a duplicate `putCookie` can occur.\n\nThe `cookie` object MUST NOT be modified; the caller will have already updated the `.creation` and `.lastAccessed` properties.\n\nPass an error if the cookie cannot be stored.\n\nstore.updateCookie(oldCookie, newCookie, cb(err))\n-------------------------------------------------\n\nUpdate an existing cookie. The implementation MUST update the `.value` for a cookie with the same `domain`, `.path` and `.key`. The implementation SHOULD check that the old value in the store is equivalent to `oldCookie` - how the conflict is resolved is up to the store.\n\nThe `.lastAccessed` property will always be different between the two objects and `.created` will always be the same. Stores MAY ignore or defer the `.lastAccessed` change at the cost of affecting how cookies are sorted (or selected for deletion).\n\nStores may wish to optimize changing the `.value` of the cookie in the store versus storing a new cookie. If the implementation doesn't define this method a stub that calls `putCookie(newCookie,cb)` will be added to the store object.\n\nThe `newCookie` and `oldCookie` objects MUST NOT be modified.\n\nPass an error if the newCookie cannot be stored.\n\nstore.removeCookie(domain, path, key, cb(err))\n----------------------------------------------\n\nRemove a cookie from the store (see notes on `findCookie` about the uniqueness constraint).\n\nThe implementation MUST NOT pass an error if the cookie doesn't exist; only pass an error due to the failure to remove an existing cookie.\n\nstore.removeCookies(domain, path, cb(err))\n------------------------------------------\n\nRemoves matching cookies from the store. The `path` paramter is optional, and if missing means all paths in a domain should be removed.\n\nPass an error ONLY if removing any existing cookies failed.\n\n# TODO\n\n * _full_ RFC5890/RFC5891 canonicalization for domains in `cdomain()`\n * the optional `punycode` requirement implements RFC3492, but RFC6265 requires RFC5891\n * better tests for `validate()`?\n\n# Copyright and License\n\n(tl;dr: BSD-3-Clause with some MPL/1.1)\n\n```text\n Copyright (c) 2015, Salesforce.com, Inc.\n All rights reserved.\n\n Redistribution and use in source and binary forms, with or without\n modification, are permitted provided that the following conditions are met:\n\n 1. Redistributions of source code must retain the above copyright notice,\n this list of conditions and the following disclaimer.\n\n 2. Redistributions in binary form must reproduce the above copyright notice,\n this list of conditions and the following disclaimer in the documentation\n and/or other materials provided with the distribution.\n\n 3. Neither the name of Salesforce.com nor the names of its contributors may\n be used to endorse or promote products derived from this software without\n specific prior written permission.\n\n THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\n AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE\n LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\n SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\n INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n POSSIBILITY OF SUCH DAMAGE.\n```\n\nPortions may be licensed under different licenses (in particular public-suffix.txt is MPL/1.1); please read the LICENSE file for full details.\n",
- "readmeFilename": "README.md",
- "_id": "tough-cookie@0.13.0",
- "_shasum": "34531cfefeba2dc050fb8e9a3310f876cdcc24f4",
- "_from": "tough-cookie@0.13.x",
- "_resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-0.13.0.tgz"
+ }
}
View
8 src/img/node_modules/docker-registry-client/package.json
@@ -32,11 +32,5 @@
"index",
"hub"
],
- "license": "MPL-2.0",
- "readme": "# node-docker-registry-client\n\nA Docker Registry API client for node.js.\nLimitation: Currently on v1 of the Registry API is implemented. Support for v2\nis planned.\n\nXXX docs are out of date for the 1.0.0 re-write.\n\n\n## Terminology\n\n(I'm talking v1 here. v2 support will come later.)\n\nThe \"Docker Registry\" docs can be a little confusing. There are two APIs in\nplay: the Index API (sometimes called the \"Hub API\") and the Registry API. There\nare a few auth-related endpoints and headers. Standalone registries (i.e. those\nnot connected with Docker Hub) and Docker Hub use different auth mechanisms.\n\"Image\" is commonly used when referring to a repo. \"The Registry\" is often used\nwhen referring to the docker Hub/Index. My understanding with v2 work is that\nthe concept of \"Index\" as separate from \"Registry\" is going away, though\nthe field name \"Index\" remains in code (both in docker.git and in this\nmodule for comparability).\n\nWorking with Docker images involves the following types of things:\n\n- index: The central Docker Hub API to handle Token-based auth for registries\n associated with Docker Hub (this seems to be only used by Docker Hub itself)\n and (theoretically) discovery of repositores in various registries.\n- registry: A server that holds Docker image repositories.\n- repositories: Images are grouped into named `repos`, e.g.\n [\"google/python\"](https://registry.hub.docker.com/u/google/python/),\n [\"library/mongo\"](https://registry.hub.docker.com/u/library/mongo/).\n On the \"official\" Docker Hub registry the \"library\" `namespace` are\n special \"official\" repos managed by Docker, Inc. All the images (that is to\n say, the image *data*) in a given repository are hosted by a single registry.\n- repository tags: A repository typically tags a set of its images with\n short names, e.g. \"2.7\" in \"library/mongo:2.7\". Tags are commonly used in\n the docker CLI when running containers. If a tag isn't specified the \"latest\"\n tag is implied -- note that \"latest\" isn't necessarily the *latest* image.\n Which image id a tag points to can change over time. The repository tags\n mapping lives in the registry.\n- image ids: A globally unique 64-char hex string identifying a particular\n image, e.g. \"3ce54e911389a2b08207b0a4d01c3131ce01b617ecc1c248f6d81ffdbebd628d\".\n Typically this is abbreviated in client usage to 12 chars: \"3ce54e911389\".\n- layers: I'm using \"layer\" and \"image\" interchangeably. Images are built up\n in layers. Each image has a parent, until the base layer. This chain\n forms the \"history\" (see `docker history <image>`), aka \"ancestry\"\n (see <https://docs.docker.com/reference/api/registry_api/#get-image-ancestry>).\n With Docker Registry API v2 these won't be interchangeable in the\n registry implementation, but for compat with older Docker the separate ID\n for each layer remains.\n\nSome relevant links:\n\n- <https://docs.docker.com/reference/api/hub_registry_spec/>\n- <https://docs.docker.com/reference/api/registry_api/>\n- <https://docs.docker.com/reference/api/docker-io_api/>\n\n\n## Names\n\nMost usage of this package involves creating a Registry client and calling\nits methods. A Registry client requires a repository name:\n\n [INDEX/]NAME # a \"repo name\"\n\nExamples:\n\n mongo # implies default index (docker.io) and namespace (library)\n docker.io/mongo # same thing\n docker.io/library/mongo # same thing\n\n myreg.example.com:5000/busybox # a \"busybox\" repo on a private registry\n\nThe `parseRepo` function is used to parse these. See \"examples/parseRepo.js\"\nto see how they are parsed:\n\n $ node examples/parseRepo.js mongo\n {\n \"index\": {\n \"name\": \"docker.io\",\n \"official\": true\n },\n \"official\": true,\n \"remoteName\": \"library/mongo\",\n \"localName\": \"mongo\",\n \"canonicalName\": \"docker.io/mongo\"\n }\n\n\nCommonly, a \"repo name and tag\" string is used for working with a Docker\nregistry, e.g. `docker pull busybox:latest`. This package provides\n`parseRepoAndTag` for that, e.g.:\n\n $ node examples/parseRepoAndTag.js myreg.example.com:5000/busybox:foo\n {\n \"index\": {\n \"name\": \"myreg.example.com:5000\",\n \"official\": false\n },\n \"official\": false,\n \"remoteName\": \"busybox\",\n \"localName\": \"myreg.example.com:5000/busybox\",\n \"canonicalName\": \"myreg.example.com:5000/busybox\",\n \"tag\": \"foo\"\n }\n\n\nSlightly different than docker.git's parsing, this package allows the\nscheme to be given on the index:\n\n\n $ node examples/parseRepoAndTag.js https://quay.io/trentm/foo\n {\n \"index\": {\n \"scheme\": \"https\", // <--- scheme\n \"name\": \"quay.io\",\n \"official\": false\n },\n \"official\": false,\n \"remoteName\": \"trentm/foo\",\n \"localName\": \"quay.io/trentm/foo\",\n \"canonicalName\": \"quay.io/trentm/foo\",\n \"tag\": \"latest\" // <--- default to 'latest' tag\n }\n\n\n## Registry client\n\nTypically:\n\n var client = drc.createClient({\n name: name,\n agent: false, // optional\n log: log, // optional\n username: opts.username, // optional\n password: opts.password, // optional\n // ... see the source code\n });\n client.listRepoTags(function (err, repoTags) {\n if (err) {\n console.log(err);\n process.exit(1);\n }\n console.log(JSON.stringify(repoTags, null, 4));\n });\n\n\nSee \"examples/\" for example usage of all (most?) of the API.\n\n\n## Dev Notes\n\nFor naming this package attempts to consistently use `repo` for repository,\n`img` for image, etc.\n",
- "readmeFilename": "README.md",
- "_id": "docker-registry-client@1.0.0",
- "_shasum": "1d574ee4f88e4292ba70a098ef519ceff62d8ea3",
- "_resolved": "git://github.com/joyent/node-docker-registry-client.git#765e74c6571752092be3cbd89d7c12b35d43a582",
- "_from": "docker-registry-client@git://github.com/joyent/node-docker-registry-client.git#765e74c"
+ "license": "MPL-2.0"
}
View
7 src/img/node_modules/extsprintf/package.json
@@ -11,13 +11,8 @@
"node >=0.6.0"
],
"license": "MIT",
- "readme": "# extsprintf: extended POSIX-style sprintf\n\nStripped down version of s[n]printf(3c). We make a best effort to throw an\nexception when given a format string we don't understand, rather than ignoring\nit, so that we won't break existing programs if/when we go implement the rest\nof this.\n\nThis implementation currently supports specifying\n\n* field alignment ('-' flag),\n* zero-pad ('0' flag)\n* always show numeric sign ('+' flag),\n* field width\n* conversions for strings, decimal integers, and floats (numbers).\n* argument size specifiers. These are all accepted but ignored, since\n Javascript has no notion of the physical size of an argument.\n\nEverything else is currently unsupported, most notably: precision, unsigned\nnumbers, non-decimal numbers, and characters.\n\nBesides the usual POSIX conversions, this implementation supports:\n\n* `%j`: pretty-print a JSON object (using node's \"inspect\")\n* `%r`: pretty-print an Error object\n\n# Example\n\nFirst, install it:\n\n # npm install extsprintf\n\nNow, use it:\n\n var mod_extsprintf = require('extsprintf');\n console.log(mod_extsprintf.sprintf('hello %25s', 'world'));\n\noutputs:\n\n hello world\n",
- "readmeFilename": "README.md",
"bugs": {
"url": "https://github.com/davepacheco/node-extsprintf/issues"
},
- "homepage": "https://github.com/davepacheco/node-extsprintf",
- "_id": "extsprintf@1.2.0",
- "_from": "extsprintf@1.2.0",
- "scripts": {}
+ "homepage": "https://github.com/davepacheco/node-extsprintf"
}
View
8 src/img/node_modules/findit/package.json
@@ -28,14 +28,8 @@
"url": "http://substack.net"
},
"license": "MIT",
- "readme": "# findit\n\nRecursively walk directory trees. Think `/usr/bin/find`.\n\n[![build status](https://secure.travis-ci.org/substack/node-findit.png)](http://travis-ci.org/substack/node-findit)\n\n# example\n\n``` js\nvar finder = require('findit')(process.argv[2] || '.');\nvar path = require('path');\n\nfinder.on('directory', function (dir, stat, stop) {\n var base = path.basename(dir);\n if (base === '.git' || base === 'node_modules') stop()\n else console.log(dir + '/')\n});\n\nfinder.on('file', function (file, stat) {\n console.log(file);\n});\n\nfinder.on('link', function (link, stat) {\n console.log(link);\n});\n```\n\n# methods\n\n``` js\nvar find = require('findit')\n```\n\n## var finder = find(basedir, opts)\n\nReturn an event emitter `finder` that performs a recursive walk starting at\n`basedir`.\n\nIf you set `opts.followSymlinks`, symlinks will be followed. Otherwise, a\n`'link'` event will fire but symlinked directories will not be walked.\n\nIf `basedir` is actually a non-directory regular file, findit emits a single\n\"file\" event for it then emits \"end\".\n\nYou can optionally specify a custom\n[fs](http://nodejs.org/docs/latest/api/fs.html)\nimplementation with `opts.fs`. `opts.fs` should implement:\n\n* `opts.fs.readdir(dir, cb)`\n* `opts.fs.lstat(dir, cb)`\n* `opts.fs.readlink(dir, cb)` - optional if your stat objects from\n`opts.fs.lstat` never return true for `stat.isSymbolicLink()`\n\n## finder.stop()\n\nStop the traversal. A `\"stop\"` event will fire and then no more events will\nfire.\n\n# events\n\n## finder.on('path', function (file, stat) {})\n\nFor each file, directory, and symlink `file`, this event fires.\n\n## finder.on('file', function (file, stat) {})\n\nFor each file, this event fires.\n\n## finder.on('directory', function (dir, stat, stop) {})\n\nFor each directory, this event fires with the path `dir`.\n\nYour callback may call `stop()` on the first tick to tell findit to stop walking\nthe current directory.\n\n## finder.on('link', function (file, stat) {})\n\nFor each symlink, this event fires.\n\n## finder.on('readlink', function (src, dst) {})\n\nEvery time a symlink is read when `opts.followSymlinks` is on, this event fires.\n\n## finder.on('end', function () {})\n\nWhen the recursive walk is complete unless `finder.stop()` was called, this\nevent fires.\n\n## finder.on('stop', function () {})\n\nWhen `finder.stop()` is called, this event fires.\n\n## finder.on('error', function (err) {})\n\nWhenever there is an error, this event fires. You can choose to ignore errors or\nstop the traversal using `finder.stop()`.\n\nYou can always get the source of the error by checking `err.path`.\n\n# install\n\nWith [npm](https://npmjs.org) do:\n\n```\nnpm install findit\n```\n\n# license\n\nMIT\n",
- "readmeFilename": "readme.markdown",
"bugs": {
"url": "https://github.com/substack/node-findit/issues"
},
- "homepage": "https://github.com/substack/node-findit",
- "_id": "findit@2.0.0",
- "_shasum": "6509f0126af4c178551cfa99394e032e13a4d56e",
- "_from": "findit@2.0.0",
- "_resolved": "https://registry.npmjs.org/findit/-/findit-2.0.0.tgz"
+ "homepage": "https://github.com/substack/node-findit"
}
View
8 src/img/node_modules/imgmanifest/package.json
@@ -17,11 +17,5 @@
"engines": {
"node": ">=0.8"
},
- "license": "MPL-2.0",
- "readme": "<!--\n This Source Code Form is subject to the terms of the Mozilla Public\n License, v. 2.0. If a copy of the MPL was not distributed with this\n file, You can obtain one at http://mozilla.org/MPL/2.0/.\n-->\n\n<!--\n Copyright (c) 2014, Joyent, Inc.\n-->\n\n# node-imgmanifest\n\nThis repository is part of the Joyent SmartDataCenter project (SDC). For\ncontribution guidelines, issues, and general documentation, visit the main\n[SDC](http://github.com/joyent/sdc) project page.\n\nnode-imgmanifest is a node.js lib for working with SmartOS image manifests.\n\nThe SmartOS/SDC *Image* world involves a number of pieces:\n\n1. The `imgadm` tool in SmartOS for installing and managing images for VM\n creation.\n2. The IMGAPI server in SmartDataCenter instances.\n3. The Joyent Images API, <https://images.joyent.com>.\n4. Possibly 3rd-party IMGAPI instances.\n5. `*-imgadm` tools for managing the above API servers.\n\nMost or all of these require being able to upgrade and validate image\nmanifests. This is the library for it.\n\n\n# Usage\n\n var imgmanifest = require('imgmanifest');\n\n // The latest Image manifest format version, i.e. the 'v' field\n // in a manifest.\n console.log(imgmanifest.V);\n\n // Upgrade a manifest to the latest manifest format version.\n var manifest = imgmanifest.upgradeManifest(manifest);\n\n // Validate a manifest, according to the \"minimal\" requirements.\n // \"Minimal\" requirements are those that, e.g., 'imgadm install'\n // requires and that 'imgadm create' creates. It does require\n // the manifest to include fields that are added by an IMGAPI\n // repository. Returns null if the manifest is valid.\n var errs = imgmanifest.validateMinimalManifest(manifest);\n\n\nNote: Current implementation of manifest validation here is **incomplete**.\n\n\n# Validation Errors\n\nThe `errs` returned by a `validate*Manifest` function is an array of\nobjects, e.g.:\n\n [\n {\n \"field\": \"name\",\n \"code\": \"MissingParameter\",\n },\n {\n \"field\": \"os\",\n \"code\": \"Invalid\",\n \"message\": \"invalid os, \\\"my-os\\\", must be one of: smartos, linux, windows, other\"\n }\n ]\n\nEach error object will always include \"field\" and \"code\" keys and **may**\ninclude a \"message\" string field. Current error \"code\" values are:\n\n||MissingParameter||A required parameter was not provided.||\n||Invalid||The formatting of the field is invalid.||\n\n\nNote: This error format is based on\n<https://mo.joyent.com/docs/eng/master/#error-handling>.\n\n",
- "readmeFilename": "README.md",
- "_id": "imgmanifest@2.1.2",
- "_shasum": "848d599dafc4f5457bc5f16f4d512f6f7db7b672",
- "_resolved": "git://github.com/joyent/node-imgmanifest.git#91e5d80f22bfb237c290baf8d459e78d0ee66b42",
- "_from": "imgmanifest@git://github.com/joyent/node-imgmanifest.git#91e5d80"
+ "license": "MPL-2.0"
}
View
8 src/img/node_modules/mkdirp/package.json
@@ -30,14 +30,8 @@
"mkdirp": "bin/cmd.js"
},
"license": "MIT",
- "readme": "# mkdirp\n\nLike `mkdir -p`, but in node.js!\n\n[![build status](https://secure.travis-ci.org/substack/node-mkdirp.png)](http://travis-ci.org/substack/node-mkdirp)\n\n# example\n\n## pow.js\n\n```js\nvar mkdirp = require('mkdirp');\n \nmkdirp('/tmp/foo/bar/baz', function (err) {\n if (err) console.error(err)\n else console.log('pow!')\n});\n```\n\nOutput\n\n```\npow!\n```\n\nAnd now /tmp/foo/bar/baz exists, huzzah!\n\n# methods\n\n```js\nvar mkdirp = require('mkdirp');\n```\n\n## mkdirp(dir, opts, cb)\n\nCreate a new directory and any necessary subdirectories at `dir` with octal\npermission string `opts.mode`. If `opts` is a non-object, it will be treated as\nthe `opts.mode`.\n\nIf `opts.mode` isn't specified, it defaults to `0777 & (~process.umask())`.\n\n`cb(err, made)` fires with the error or the first directory `made`\nthat had to be created, if any.\n\nYou can optionally pass in an alternate `fs` implementation by passing in\n`opts.fs`. Your implementation should have `opts.fs.mkdir(path, mode, cb)` and\n`opts.fs.stat(path, cb)`.\n\n## mkdirp.sync(dir, opts)\n\nSynchronously create a new directory and any necessary subdirectories at `dir`\nwith octal permission string `opts.mode`. If `opts` is a non-object, it will be\ntreated as the `opts.mode`.\n\nIf `opts.mode` isn't specified, it defaults to `0777 & (~process.umask())`.\n\nReturns the first directory that had to be created, if any.\n\nYou can optionally pass in an alternate `fs` implementation by passing in\n`opts.fs`. Your implementation should have `opts.fs.mkdirSync(path, mode)` and\n`opts.fs.statSync(path)`.\n\n# usage\n\nThis package also ships with a `mkdirp` command.\n\n```\nusage: mkdirp [DIR1,DIR2..] {OPTIONS}\n\n Create each supplied directory including any necessary parent directories that\n don't yet exist.\n \n If the directory already exists, do nothing.\n\nOPTIONS are:\n\n -m, --mode If a directory needs to be created, set the mode as an octal\n permission string.\n\n```\n\n# install\n\nWith [npm](http://npmjs.org) do:\n\n```\nnpm install mkdirp\n```\n\nto get the library, or\n\n```\nnpm install -g mkdirp\n```\n\nto get the command.\n\n# license\n\nMIT\n",
- "readmeFilename": "readme.markdown",
"bugs": {
"url": "https://github.com/substack/node-mkdirp/issues"
},
- "homepage": "https://github.com/substack/node-mkdirp",
- "_id": "mkdirp@0.5.0",
- "_shasum": "1d73076a6df986cd9344e15e71fcc05a4c9abf12",
- "_from": "mkdirp@0.5.0",
- "_resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.0.tgz"
+ "homepage": "https://github.com/substack/node-mkdirp"
}
View
9 src/img/node_modules/node-uuid/package.json
@@ -24,14 +24,7 @@
"url": "https://github.com/broofa/node-uuid.git"
},
"version": "1.4.1",
- "readme": "# node-uuid\n\nSimple, fast generation of [RFC4122](http://www.ietf.org/rfc/rfc4122.txt) UUIDS.\n\nFeatures:\n\n* Generate RFC4122 version 1 or version 4 UUIDs\n* Runs in node.js and all browsers.\n* Registered as a [ComponentJS](https://github.com/component/component) [component](https://github.com/component/component/wiki/Components) ('broofa/node-uuid').\n* Cryptographically strong random # generation on supporting platforms\n* 1.1K minified and gzip'ed (Want something smaller? Check this [crazy shit](https://gist.github.com/982883) out! )\n* [Annotated source code](http://broofa.github.com/node-uuid/docs/uuid.html)\n\n## Getting Started\n\nInstall it in your browser:\n\n```html\n<script src=\"uuid.js\"></script>\n```\n\nOr in node.js:\n\n```\nnpm install node-uuid\n```\n\n```javascript\nvar uuid = require('node-uuid');\n```\n\nThen create some ids ...\n\n```javascript\n// Generate a v1 (time-based) id\nuuid.v1(); // -> '6c84fb90-12c4-11e1-840d-7b25c5ee775a'\n\n// Generate a v4 (random) id\nuuid.v4(); // -> '110ec58a-a0f2-4ac4-8393-c866d813b8d1'\n```\n\n## API\n\n### uuid.v1([`options` [, `buffer` [, `offset`]]])\n\nGenerate and return a RFC4122 v1 (timestamp-based) UUID.\n\n* `options` - (Object) Optional uuid state to apply. Properties may include:\n\n * `node` - (Array) Node id as Array of 6 bytes (per 4.1.6). Default: Randomly generated ID. See note 1.\n * `clockseq` - (Number between 0 - 0x3fff) RFC clock sequence. Default: An internally maintained clockseq is used.\n * `msecs` - (Number | Date) Time in milliseconds since unix Epoch. Default: The current time is used.\n * `nsecs` - (Number between 0-9999) additional time, in 100-nanosecond units. Ignored if `msecs` is unspecified. Default: internal uuid counter is used, as per 4.2.1.2.\n\n* `buffer` - (Array | Buffer) Array or buffer where UUID bytes are to be written.\n* `offset` - (Number) Starting index in `buffer` at which to begin writing.\n\nReturns `buffer`, if specified, otherwise the string form of the UUID\n\nNotes:\n\n1. The randomly generated node id is only guaranteed to stay constant for the lifetime of the current JS runtime. (Future versions of this module may use persistent storage mechanisms to extend this guarantee.)\n\nExample: Generate string UUID with fully-specified options\n\n```javascript\nuuid.v1({\n node: [0x01, 0x23, 0x45, 0x67, 0x89, 0xab],\n clockseq: 0x1234,\n msecs: new Date('2011-11-01').getTime(),\n nsecs: 5678\n}); // -> \"710b962e-041c-11e1-9234-0123456789ab\"\n```\n\nExample: In-place generation of two binary IDs\n\n```javascript\n// Generate two ids in an array\nvar arr = new Array(32); // -> []\nuuid.v1(null, arr, 0); // -> [02 a2 ce 90 14 32 11 e1 85 58 0b 48 8e 4f c1 15]\nuuid.v1(null, arr, 16); // -> [02 a2 ce 90 14 32 11 e1 85 58 0b 48 8e 4f c1 15 02 a3 1c b0 14 32 11 e1 85 58 0b 48 8e 4f c1 15]\n\n// Optionally use uuid.unparse() to get stringify the ids\nuuid.unparse(buffer); // -> '02a2ce90-1432-11e1-8558-0b488e4fc115'\nuuid.unparse(buffer, 16) // -> '02a31cb0-1432-11e1-8558-0b488e4fc115'\n```\n\n### uuid.v4([`options` [, `buffer` [, `offset`]]])\n\nGenerate and return a RFC4122 v4 UUID.\n\n* `options` - (Object) Optional uuid state to apply. Properties may include:\n\n * `random` - (Number[16]) Array of 16 numbers (0-255) to use in place of randomly generated values\n * `rng` - (Function) Random # generator to use. Set to one of the built-in generators - `uuid.mathRNG` (all platforms), `uuid.nodeRNG` (node.js only), `uuid.whatwgRNG` (WebKit only) - or a custom function that returns an array[16] of byte values.\n\n* `buffer` - (Array | Buffer) Array or buffer where UUID bytes are to be written.\n* `offset` - (Number) Starting index in `buffer` at which to begin writing.\n\nReturns `buffer`, if specified, otherwise the string form of the UUID\n\nExample: Generate string UUID with fully-specified options\n\n```javascript\nuuid.v4({\n random: [\n 0x10, 0x91, 0x56, 0xbe, 0xc4, 0xfb, 0xc1, 0xea,\n 0x71, 0xb4, 0xef, 0xe1, 0x67, 0x1c, 0x58, 0x36\n ]\n});\n// -> \"109156be-c4fb-41ea-b1b4-efe1671c5836\"\n```\n\nExample: Generate two IDs in a single buffer\n\n```javascript\nvar buffer = new Array(32); // (or 'new Buffer' in node.js)\nuuid.v4(null, buffer, 0);\nuuid.v4(null, buffer, 16);\n```\n\n### uuid.parse(id[, buffer[, offset]])\n### uuid.unparse(buffer[, offset])\n\nParse and unparse UUIDs\n\n * `id` - (String) UUID(-like) string\n * `buffer` - (Array | Buffer) Array or buffer where UUID bytes are to be written. Default: A new Array or Buffer is used\n * `offset` - (Number) Starting index in `buffer` at which to begin writing. Default: 0\n\nExample parsing and unparsing a UUID string\n\n```javascript\nvar bytes = uuid.parse('797ff043-11eb-11e1-80d6-510998755d10'); // -> <Buffer 79 7f f0 43 11 eb 11 e1 80 d6 51 09 98 75 5d 10>\nvar string = uuid.unparse(bytes); // -> '797ff043-11eb-11e1-80d6-510998755d10'\n```\n\n### uuid.noConflict()\n\n(Browsers only) Set `uuid` property back to it's previous value.\n\nReturns the node-uuid object.\n\nExample:\n\n```javascript\nvar myUuid = uuid.noConflict();\nmyUuid.v1(); // -> '6c84fb90-12c4-11e1-840d-7b25c5ee775a'\n```\n\n## Deprecated APIs\n\nSupport for the following v1.2 APIs is available in v1.3, but is deprecated and will be removed in the next major version.\n\n### uuid([format [, buffer [, offset]]])\n\nuuid() has become uuid.v4(), and the `format` argument is now implicit in the `buffer` argument. (i.e. if you specify a buffer, the format is assumed to be binary).\n\n### uuid.BufferClass\n\nThe class of container created when generating binary uuid data if no buffer argument is specified. This is expected to go away, with no replacement API.\n\n## Testing\n\nIn node.js\n\n```\n> cd test\n> node test.js\n```\n\nIn Browser\n\n```\nopen test/test.html\n```\n\n### Benchmarking\n\nRequires node.js\n\n```\nnpm install uuid uuid-js\nnode benchmark/benchmark.js\n```\n\nFor a more complete discussion of node-uuid performance, please see the `benchmark/README.md` file, and the [benchmark wiki](https://github.com/broofa/node-uuid/wiki/Benchmark)\n\nFor browser performance [checkout the JSPerf tests](http://jsperf.com/node-uuid-performance).\n\n## Release notes\n\n### 1.4.0\n\n* Improved module context detection\n* Removed public RNG functions\n\n### 1.3.2\n\n* Improve tests and handling of v1() options (Issue #24)\n* Expose RNG option to allow for perf testing with different generators\n\n### 1.3.0\n\n* Support for version 1 ids, thanks to [@ctavan](https://github.com/ctavan)!\n* Support for node.js crypto API\n* De-emphasizing performance in favor of a) cryptographic quality PRNGs where available and b) more manageable code\n",
- "readmeFilename": "README.md",
"bugs": {
"url": "https://github.com/broofa/node-uuid/issues"
- },
- "homepage": "https://github.com/broofa/node-uuid",
- "_id": "node-uuid@1.4.1",
- "_shasum": "39aef510e5889a3dca9c895b506c73aae1bac048",
- "_from": "node-uuid@1.4.1",
- "_resolved": "https://registry.npmjs.org/node-uuid/-/node-uuid-1.4.1.tgz"
+ }
}
View
28 src/img/node_modules/nodeunit/package.json
@@ -1,12 +1,6 @@
{
"name": "nodeunit",
"description": "Easy unit testing for node.js and the browser.",
- "maintainers": [
- {
- "name": "Caolan McMahon",
- "url": "https://github.com/caolan"
- }
- ],
"contributors": [
{
"name": "Romain Beauxis",
@@ -61,7 +55,7 @@
"version": "0.7.4",
"repository": {
"type": "git",
- "url": "http://github.com/caolan/nodeunit.git"
+ "url": "git://github.com/caolan/nodeunit.git"
},
"devDependencies": {
"uglify-js": ">=1.1.0",
@@ -76,25 +70,17 @@
"url": "http://github.com/caolan/nodeunit/raw/master/LICENSE"
}
],
- "directories": {
- "lib": "./lib",
- "doc": "./doc",
- "man": "./man1"
- },
"bin": {
"nodeunit": "./bin/nodeunit"
},
"dependencies": {
"tap": ">=0.2.3"
},
+ "optionalDependencies": {},
+ "engines": {
+ "node": "*"
+ },
"man": [
- "/Users/trentm/.npm/nodeunit/0.7.4/package/man1/nodeunit.1"
- ],
- "readme": "Nodeunit\n========\n\nSimple syntax, powerful tools. Nodeunit provides easy async unit testing for\nnode.js and the browser.\n\n* Simple to use\n* Just export the tests from a module\n* Works with node.js and in the browser.\n* Helps you avoid common pitfalls when testing asynchronous code\n* Easy to add test cases with setUp and tearDown functions if you wish\n* Flexible reporters for custom output, built-in support for HTML and jUnit XML\n* Allows the use of mocks and stubs\n\n__Contributors__\n\n* [alexgorbatchev](https://github.com/alexgorbatchev)\n* [alexkwolfe](https://github.com/alexkwolfe)\n* [azatoth](https://github.com/azatoth)\n* [kadirpekel](https://github.com/kadirpekel)\n* [lambdalisue](https://github.com/lambdalisue)\n* [luebken](https://github.com/luebken)\n* [orlandov](https://github.com/orlandov)\n* [Sannis](https://github.com/Sannis)\n* [sstephenson](https://github.com/sstephenson)\n* [thegreatape](https://github.com/thegreatape)\n* [mmalecki](https://github.com/mmalecki)\n* and thanks to [cjohansen](https://github.com/cjohansen) for input and advice\n on implementing setUp and tearDown functions. See\n [cjohansen's fork](https://github.com/cjohansen/nodeunit).\n\nAlso, check out gerad's [nodeunit-dsl](https://github.com/gerad/nodeunit-dsl)\nproject, which implements a 'pretty dsl on top of nodeunit'.\n\nMore contributor information can be found in the\n[CONTRIBUTORS.md](https://github.com/caolan/nodeunit/blob/master/CONTRIBUTORS.md)\nfile.\n\nUsage\n-----\n\nHere is an example unit test module:\n\n exports.testSomething = function(test){\n test.expect(1);\n test.ok(true, \"this assertion should pass\");\n test.done();\n };\n\n exports.testSomethingElse = function(test){\n test.ok(false, \"this assertion should fail\");\n test.done();\n };\n\nWhen run using the included test runner, this will output the following:\n\n<img src=\"https://github.com/caolan/nodeunit/raw/master/img/example_fail.png\" />\n\nInstallation\n------------\n\nThere are two options for installing nodeunit:\n\n1. Clone / download nodeunit from [github](https://github.com/caolan/nodeunit),\n then:\n\n make && sudo make install\n\n2. Install via npm:\n\n npm install nodeunit\n\nAPI Documentation\n-----------------\n\nNodeunit uses the functions available in the node.js\n[assert module](http://nodejs.org/docs/v0.4.2/api/assert.html):\n\n* __ok(value, [message])__ - Tests if value is a true value.\n* __equal(actual, expected, [message])__ - Tests shallow, coercive equality\n with the equal comparison operator ( == ).\n* __notEqual(actual, expected, [message])__ - Tests shallow, coercive\n non-equality with the not equal comparison operator ( != ).\n* __deepEqual(actual, expected, [message])__ - Tests for deep equality.\n* __notDeepEqual(actual, expected, [message])__ - Tests for any deep\n inequality.\n* __strictEqual(actual, expected, [message])__ - Tests strict equality, as\n determined by the strict equality operator ( === )\n* __notStrictEqual(actual, expected, [message])__ - Tests strict non-equality,\n as determined by the strict not equal operator ( !== )\n* __throws(block, [error], [message])__ - Expects block to throw an error.\n* __doesNotThrow(block, [error], [message])__ - Expects block not to throw an\n error.\n* __ifError(value)__ - Tests if value is not a false value, throws if it is a\n true value. Useful when testing the first argument, error in callbacks.\n\nNodeunit also provides the following functions within tests:\n\n* __expect(amount)__ - Specify how many assertions are expected to run within a\n test. Very useful for ensuring that all your callbacks and assertions are\n run.\n* __done()__ - Finish the current test function, and move on to the next. ALL\n tests should call this!\n\nNodeunit aims to be simple and easy to learn. This is achieved through using\nexisting structures (such as node.js modules) to maximum effect, and reducing\nthe API where possible, to make it easier to digest.\n\nTests are simply exported from a module, but they are still run in the order\nthey are defined.\n\n__Note:__ Users of old nodeunit versions may remember using ok, equals and same\nin the style of qunit, instead of the assert functions above. These functions\nstill exist for backwards compatibility, and are simply aliases to their assert\nmodule counterparts.\n\n\nAsynchronous Testing\n--------------------\n\nWhen testing asynchronous code, there are a number of sharp edges to watch out\nfor. Thankfully, nodeunit is designed to help you avoid as many of these\npitfalls as possible. For the most part, testing asynchronous code in nodeunit\n_just works_.\n\n\n### Tests run in series\n\nWhile running tests in parallel seems like a good idea for speeding up your\ntest suite, in practice I've found it means writing much more complicated\ntests. Because of node's module cache, running tests in parallel means mocking\nand stubbing is pretty much impossible. One of the nicest things about testing\nin javascript is the ease of doing stubs:\n\n var _readFile = fs.readFile;\n fs.readFile = function(path, callback){\n // its a stub!\n };\n // test function that uses fs.readFile\n\n // we're done\n fs.readFile = _readFile;\n\nYou cannot do this when running tests in parallel. In order to keep testing as\nsimple as possible, nodeunit avoids it. Thankfully, most unit-test suites run\nfast anyway.\n\n\n### Explicit ending of tests\n\nWhen testing async code its important that tests end at the correct point, not\njust after a given number of assertions. Otherwise your tests can run short,\nending before all assertions have completed. Its important to detect too\nmany assertions as well as too few. Combining explicit ending of tests with\nan expected number of assertions helps to avoid false test passes, so be sure\nto use the test.expect() method at the start of your test functions, and\ntest.done() when finished.\n\n\nGroups, setUp and tearDown\n--------------------------\n\nNodeunit allows the nesting of test functions:\n\n exports.test1 = function (test) {\n ...\n }\n\n exports.group = {\n test2: function (test) {\n ...\n },\n test3: function (test) {\n ...\n }\n }\n\nThis would be run as:\n\n test1\n group - test2\n group - test3\n\nUsing these groups, Nodeunit allows you to define a `setUp` function, which is\nrun before each test, and a `tearDown` function, which is run after each test\ncalls `test.done()`:\n\n module.exports = {\n setUp: function (callback) {\n this.foo = 'bar';\n callback();\n },\n tearDown: function (callback) {\n // clean up\n callback();\n },\n test1: function (test) {\n test.equals(this.foo, 'bar');\n test.done();\n }\n };\n\nIn this way, its possible to have multiple groups of tests in a module, each\ngroup with its own setUp and tearDown functions.\n\n\nRunning Tests\n-------------\n\nNodeunit comes with a basic command-line test runner, which can be installed\nusing 'sudo make install'. Example usage:\n\n nodeunit testmodule1.js testfolder [...]\n\nThe default test reporter uses color output, because I think that's more fun :) I\nintend to add a no-color option in future. To give you a feeling of the fun you'll\nbe having writing tests, lets fix the example at the start of the README:\n\n<img src=\"https://github.com/caolan/nodeunit/raw/master/img/example_pass.png\" />\n\nAhhh, Doesn't that feel better?\n\nWhen using the included test runner, it will exit using the failed number of\nassertions as the exit code. Exiting with 0 when all tests pass.\n\n\n### Command-line Options\n\n* __--reporter FILE__ - you can set the test reporter to a custom module or\non of the modules in nodeunit/lib/reporters, when omitted, the default test runner\nis used.\n* __--list-reporters__ - list available build-in reporters.\n* __--config FILE__ - load config options from a JSON file, allows\nthe customisation of color schemes for the default test reporter etc. See\nbin/nodeunit.json for current available options.\n* __--version__ or __-v__ - report nodeunit version\n* __--help__ - show nodeunit help\n\n\nRunning tests in the browser\n----------------------------\n\nNodeunit tests can also be run inside the browser. For example usage, see\nthe examples/browser folder. The basic syntax is as follows:\n\n__test.html__\n\n <html>\n <head>\n <title>Example Test Suite</title>\n <link rel=\"stylesheet\" href=\"nodeunit.css\" type=\"text/css\" />\n <script src=\"nodeunit.js\"></script>\n <script src=\"suite1.js\"></script>\n <script src=\"suite2.js\"></script>\n </head>\n <body>\n <h1 id=\"nodeunit-header>Example Test Suite</h1>\n <script>\n nodeunit.run({\n 'Suite One': suite1,\n 'Suite Two': suite2\n });\n </script>\n </body>\n </html>\n\nHere, suite1 and suite2 are just object literals containing test functions or\ngroups, as would be returned if you did require('test-suite') in node.js:\n\n__suite1.js__\n\n this.suite1 = {\n 'example test': function (test) {\n test.ok(true, 'everything is ok');\n test.done();\n }\n };\n\nIf you wish to use a commonjs format for your test suites (using exports), it is\nup to you to define the commonjs tools for the browser. There are a number of\nalternatives and its important it fits with your existing code, which is\nwhy nodeunit does not currently provide this out of the box.\n\nIn the example above, the tests will run when the page is loaded.\n\nThe browser-version of nodeunit.js is created in dist/browser when you do, 'make\nbrowser'. You'll need [UglifyJS](https://github.com/mishoo/UglifyJS) installed in\norder for it to automatically create nodeunit.min.js.\n\n\nAdding nodeunit to Your Projects\n--------------------------------\n\nIf you don't want people to have to install the nodeunit command-line tool,\nyou'll want to create a script that runs the tests for your project with the\ncorrect require paths set up. Here's an example test script, that assumes you\nhave nodeunit in a suitably located node_modules directory.\n\n #!/usr/bin/env node\n var reporter = require('nodeunit').reporters.default;\n reporter.run(['test']);\n\nIf you're using git, you might find it useful to include nodeunit as a\nsubmodule. Using submodules makes it easy for developers to download nodeunit\nand run your test suite, without cluttering up your repository with\nthe source code. To add nodeunit as a git submodule do the following:\n\n git submodule add git://github.com/caolan/nodeunit.git node_modules/nodeunit\n\nThis will add nodeunit to the node_modules folder of your project. Now, when\ncloning the repository, nodeunit can be downloaded by doing the following:\n\n git submodule init\n git submodule update\n\nLet's update the test script above with a helpful hint on how to get nodeunit,\nif its missing:\n\n #!/usr/bin/env node\n try {\n var reporter = require('nodeunit').reporters.default;\n }\n catch(e) {\n console.log(\"Cannot find nodeunit module.\");\n console.log(\"You can download submodules for this project by doing:\");\n console.log(\"\");\n console.log(\" git submodule init\");\n console.log(\" git submodule update\");\n console.log(\"\");\n process.exit();\n }\n\n process.chdir(__dirname);\n reporter.run(['test']);\n\nNow if someone attempts to run your test suite without nodeunit installed they\nwill be prompted to download the submodules for your project.\n\n\nBuilt-in Test Reporters\n-----------------------\n\n* __default__ - The standard reporter seen in the nodeunit screenshots\n* __minimal__ - Pretty, minimal output, shows errors and progress only\n* __html__ - Outputs a HTML report to stdout\n* __junit__ - Creates jUnit compatible XML reports, which can be used with\n continuous integration tools such as [Hudson](http://hudson-ci.org/).\n* __machineout__ - Simple reporter for machine analysis. There is [nodeunit.vim](https://github.com/lambdalisue/nodeunit.vim)\n which is useful for TDD on VIM\n\n\nWriting a Test Reporter\n---------------------\n\nNodeunit exports runTest(fn, options), runModule(mod, options) and\nrunFiles(paths, options). You'll most likely want to run test suites from\nfiles, which can be done using the latter function. The _options_ argument can\ncontain callbacks which run during testing. Nodeunit provides the following\ncallbacks:\n\n* __moduleStart(name)__ - called before a module is tested\n* __moduleDone(name, assertions)__ - called once all test functions within the\n module have completed (see assertions object reference below)\n ALL tests within the module\n* __testStart(name)__ - called before a test function is run\n* __testDone(name, assertions)__ - called once a test function has completed\n (by calling test.done())\n* __log(assertion)__ - called whenever an assertion is made (see assertion\n object reference below)\n* __done(assertions)__ - called after all tests/modules are complete\n\nThe __assertion__ object:\n\n* __passed()__ - did the assertion pass?\n* __failed()__ - did the assertion fail?\n* __error__ - the AssertionError if the assertion failed\n* __method__ - the nodeunit assertion method used (ok, same, equals...)\n* __message__ - the message the assertion method was called with (optional)\n\nThe __assertionList__ object:\n\n* An array-like object with the following new attributes:\n * __failures()__ - the number of assertions which failed\n * __duration__ - the time taken for the test to complete in msecs\n\nFor a reference implementation of a test reporter, see lib/reporters/default.js in\nthe nodeunit project directory.\n\n\nSandbox utility\n---------------\n\nThis is a function which evaluates JavaScript files in a sandbox and returns the\ncontext. The sandbox function can be used for testing client-side code or private\nun-exported functions within a module.\n\n var sandbox = require('nodeunit').utils.sandbox;\n var example = sandbox('example.js');\n\n__sandbox(files, sandbox)__ - Evaluates JavaScript files in a sandbox, returning\nthe context. The first argument can either be a single filename or an array of\nfilenames. If multiple filenames are given their contents are concatenated before\nevalution. The second argument is an optional context to use for the sandbox.\n\n\nRunning the nodeunit Tests\n--------------------------\n\nThe tests for nodeunit are written using nodeunit itself as the test framework.\nHowever, the module test-base.js first does some basic tests using the assert\nmodule to ensure that test functions are actually run, and a basic level of\nnodeunit functionality is available.\n\nTo run the nodeunit tests do:\n\n make test\n\n__Note:__ There was a bug in node v0.2.0 causing the tests to hang, upgrading\nto v0.2.1 fixes this.\n\n\n__machineout__ reporter\n----------------------------------------------\n\nThe default reporter is really readable for human but for machinally analysis. \nWhen you want to analyze the output of nodeunit, use __machineout__ reporter and you will get\n\n<img src=\"https://github.com/caolan/nodeunit/raw/master/img/example_machineout.png\" />\n\n\nnodeunit with vim\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\nThere is [nodeunit.vim](https://github.com/lambdalisue/nodeunit.vim) so you can use nodeunit with VIM.\nThat compiler use __machineout__ reporter and it is useful to use with [vim-makegreen](https://github.com/reinh/vim-makegreen)\n\n \n\nContributing\n------------\n\nContributions to the project are most welcome, so feel free to fork and improve.\nWhen submitting a pull request, please run 'make lint' first to ensure\nwe're following a consistent coding style.\n",
- "readmeFilename": "README.md",
- "homepage": "https://github.com/caolan/nodeunit",
- "_id": "nodeunit@0.7.4",
- "_shasum": "c908def7f299fbe65ff7ac888782955c46aae9f8",
- "_from": "nodeunit@0.7.4",
- "_resolved": "https://registry.npmjs.org/nodeunit/-/nodeunit-0.7.4.tgz"
+ "man1/nodeunit.1"
+ ]
}
View
11 src/img/node_modules/once/node_modules/wrappy/package.json
@@ -3,9 +3,6 @@
"version": "1.0.1",
"description": "Callback wrapping utility",
"main": "wrappy.js",
- "directories": {
- "test": "test"
- },
"dependencies": {},
"devDependencies": {
"tap": "^0.4.12"
@@ -26,11 +23,5 @@
"bugs": {
"url": "https://github.com/npm/wrappy/issues"
},
- "homepage": "https://github.com/npm/wrappy",
- "readme": "# wrappy\n\nCallback wrapping utility\n\n## USAGE\n\n```javascript\nvar wrappy = require(\"wrappy\")\n\n// var wrapper = wrappy(wrapperFunction)\n\n// make sure a cb is called only once\n// See also: http://npm.im/once for this specific use case\nvar once = wrappy(function (cb) {\n var called = false\n return function () {\n if (called) return\n called = true\n return cb.apply(this, arguments)\n }\n})\n\nfunction printBoo () {\n console.log('boo')\n}\n// has some rando property\nprintBoo.iAmBooPrinter = true\n\nvar onlyPrintOnce = once(printBoo)\n\nonlyPrintOnce() // prints 'boo'\nonlyPrintOnce() // does nothing\n\n// random property is retained!\nassert.equal(onlyPrintOnce.iAmBooPrinter, true)\n```\n",
- "readmeFilename": "README.md",
- "_id": "wrappy@1.0.1",
- "_shasum": "1e65969965ccbc2db4548c6b84a6f2c5aedd4739",
- "_from": "wrappy@1",
- "_resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.1.tgz"
+ "homepage": "https://github.com/npm/wrappy"
}
View
11 src/img/node_modules/once/package.json
@@ -3,9 +3,6 @@
"version": "1.3.1",
"description": "Run a function exactly one time",
"main": "once.js",
- "directories": {
- "test": "test"
- },
"dependencies": {
"wrappy": "1"
},
@@ -31,14 +28,8 @@
"url": "http://blog.izs.me/"
},
"license": "BSD",
- "readme": "# once\n\nOnly call a function once.\n\n## usage\n\n```javascript\nvar once = require('once')\n\nfunction load (file, cb) {\n cb = once(cb)\n loader.load('file')\n loader.once('load', cb)\n loader.once('error', cb)\n}\n```\n\nOr add to the Function.prototype in a responsible way:\n\n```javascript\n// only has to be done once\nrequire('once').proto()\n\nfunction load (file, cb) {\n cb = cb.once()\n loader.load('file')\n loader.once('load', cb)\n loader.once('error', cb)\n}\n```\n\nIronically, the prototype feature makes this module twice as\ncomplicated as necessary.\n\nTo check whether you function has been called, use `fn.called`. Once the\nfunction is called for the first time the return value of the original\nfunction is saved in `fn.value` and subsequent calls will continue to\nreturn this value.\n\n```javascript\nvar once = require('once')\n\nfunction load (cb) {\n cb = once(cb)\n var stream = createStream()\n stream.once('data', cb)\n stream.once('end', function () {\n if (!cb.called) cb(new Error('not found'))\n })\n}\n```\n",
- "readmeFilename": "README.md",
"bugs": {
"url": "https://github.com/isaacs/once/issues"
},
- "homepage": "https://github.com/isaacs/once",
- "_id": "once@1.3.1",
- "_shasum": "f3f3e4da5b7d27b5c732969ee3e67e729457b31f",
- "_from": "once@1.3.1",
- "_resolved": "https://registry.npmjs.org/once/-/once-1.3.1.tgz"
+ "homepage": "https://github.com/isaacs/once"
}
View
11 src/img/node_modules/progbar/node_modules/sprintf/package.json
@@ -7,9 +7,6 @@
"author": {
"name": "Moritz Peters"
},
- "directories": {
- "lib": "./lib"
- },
"description": "Sprintf() for node.js",
"main": "./lib/sprintf",
"homepage": "https://github.com/maritz/node-sprintf",
@@ -24,13 +21,7 @@
"devDependencies": {
"nodeunit": "0.8.0"
},
- "readme": "# sprintf() for node\n\n## Disclaimer\n\nThis was originally just an adoption of a browser library to node.js. \nSince that library is now itself a node.js module, you should use that one: [alexei/sprintf.js](https://github.com/alexei/sprintf.js)\n\nOr just install it via npm:\n\n npm install sprintf-js\n\n\nThere is also a [built-in util.format](http://nodejs.org/api/util.html#util_util_format_format).\n\n\n\n\n## Install\n\n**This package is not maintained anymore. See Disclaimer above.**\n\n npm install sprintf\n\n\n## How to\n\nWorks exactly like http://www.diveintojavascript.com/projects/javascript-sprintf, except that it exports those two functions:\n\n sprintf = require('sprintf').sprintf;\n vsprintf = require('sprintf').vsprintf;\n\nHave fun!\n\n\n## Copyright/License\n\nCopyright (c) 2007-2013, Alexandru Marasteanu <hello [at) alexei (dot] ro>\nAll rights reserved.\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions are met:\n* Redistributions of source code must retain the above copyright\n notice, this list of conditions and the following disclaimer.\n* Redistributions in binary form must reproduce the above copyright\n notice, this list of conditions and the following disclaimer in the\n documentation and/or other materials provided with the distribution.\n* Neither the name of this software nor the names of its contributors may be\n used to endorse or promote products derived from this software without\n specific prior written permission.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND\nANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\nWARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\nDISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR\nANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\nLOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\nON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\nSOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n",
- "readmeFilename": "README.md",
"bugs": {
"url": "https://github.com/maritz/node-sprintf/issues"
- },
- "_id": "sprintf@0.1.5",
- "_shasum": "8f83e39a9317c1a502cb7db8050e51c679f6edcf",
- "_from": "sprintf@~0.1.3",
- "_resolved": "https://registry.npmjs.org/sprintf/-/sprintf-0.1.5.tgz"
+ }
}
View
8 src/img/node_modules/progbar/package.json
@@ -29,14 +29,8 @@
"console",
"cli"
],
- "readme": "# node-progbar\n\n`node-progbar` is a library for drawing progress bars in `xterm`-like (or\nhopefully any somewhat *ECMA-48*-compatible) terminals.\n\n## Usage\n\n```javascript\nvar mod_progbar = require('progbar');\n\n/*\n * Instantiate the ProgressBar class, like so. This instance\n * represents a single transfer operation, and will draw one\n * final status report when the transfer is deemed over.\n *\n * NB: you may also set 'nosize' to true, instead of passing\n * 'size', if you do not know the length of the stream\n * in advance.\n */\nvar bar = new mod_progbar.ProgressBar({\n\tfilename: 'whatever.zip', // filename to display\n\tsize: 10048 // filesize in bytes\n});\n\n/*\n * Usually, you would use the progress bar in Stream data\n * events, like so:\n */\nstream.on('data', function (data) {\n\tbar.advance(data.length);\n});\nstream.on('end', function (data) {\n\tbar.end();\n});\n\n/*\n * You may also use the stream() method to get a passthrough stream\n * that you may pipe your data through. The bar will advance with\n * the passage of bytes through the stream, and end() will be called\n * at the end of the stream.\n */\ninput_stream.pipe(bar.stream()).pipe(output_stream);\n```\n",
- "readmeFilename": "README.md",
"bugs": {
"url": "https://github.com/jclulow/node-progbar/issues"
},
- "homepage": "https://github.com/jclulow/node-progbar",
- "_id": "progbar@1.1.0",
- "_shasum": "b2852f5bfab32894a7492848113bae9827c02ab3",
- "_from": "progbar@1.1.0",
- "_resolved": "https://registry.npmjs.org/progbar/-/progbar-1.1.0.tgz"
+ "homepage": "https://github.com/jclulow/node-progbar"
}
View
10 src/img/node_modules/restify/node_modules/keep-alive-agent/package.json
@@ -32,13 +32,5 @@
"devDependencies": {
"chai": "*",
"mocha": "*"
- },
- "readme": "# keep-alive-agent\n\nkeep-alive-agent is an HTTP connection pool agent for node.js that re-uses sockets. It is simpler than some agents that also solve this problem because it does not attempt to replace the Agent provided by node. If you want to re-use connections, use this agent. If you want the default node behavior, use the default global agent.\n\n## Usage\n\n__new KeepAliveAgent(*options-hash*)__\n\nCreate an instance of the agent, passing the options hash through to the node Agent constructor. These options are in turn passed along to `createConnection()`. The KeepAliveAgent constructor does not use the options itself. The option you are most likely to change is `maxSockets`, which defaults to 5.\n\nTo use the agent instance, set it in the `agent` field of the options passed to `http.request()` or `http.get()`. See the [http.request() documentation](http://nodejs.org/api/http.html#http_http_request_options_callback) for details.\n\n__new KeepAliveAgent.Secure(*options-hash*)__\n\nA keep-alive agent that creates tls sockets. Use it the same way you use the http agent.\n\n## Examples\n\n```javascript\nvar http = require('http'),\n KeepAliveAgent = require('keep-alive-agent');\n\nvar getOptions = {\n hostname: 'twitter.com',\n port: 80,\n path: '/dshaw',\n agent: new KeepAliveAgent(),\n};\nhttp.get(getOptions, function(response)\n{\n\tresponse.pipe(process.stdout);\n});\n```\n\nTo re-use secure connections, use the Secure keep-alive agent:\n\n```javascript\nvar https = require('https'),\n KeepAliveAgent = require('keep-alive-agent');\n\nvar getOptions = {\n hostname: 'www.duckduckgo.com',\n port: 443,\n path: '/?q=unicorns',\n agent: new KeepAliveAgent.Secure(),\n};\nhttps.get(getOptions, function(response)\n{\n\tresponse.pipe(process.stdout);\n});\n```\n\n## See Also\n\nFor other implementations, see [agentkeepalive](https://github.com/TBEDP/agentkeepalive) and the [request](https://github.com/mikeal/request) module's [ForeverAgent](https://github.com/mikeal/request/blob/master/forever.js).\n\n## Licence\n\nMIT.\n",
- "readmeFilename": "README.md",
- "bugs": {
- "url": "https://github.com/ceejbot/keep-alive-agent/issues"
- },
- "homepage": "https://github.com/ceejbot/keep-alive-agent",
- "_id": "keep-alive-agent@0.0.1",
- "_from": "keep-alive-agent@^0.0.1"
+ }
}
View
17 src/img/node_modules/restify/node_modules/lru-cache/package.json
@@ -1,7 +1,7 @@
{
"name": "lru-cache",
"description": "A cache object that deletes the least-recently-used items.",
- "version": "2.6.2",
+ "version": "2.6.5",
"author": {
"name": "Isaac Z. Schlueter",
"email": "i@izs.me"
@@ -20,21 +20,12 @@
"url": "git://github.com/isaacs/node-lru-cache.git"
},
"devDependencies": {
- "tap": "^0.7.1",
+ "tap": "^1.2.0",
"weak": ""
},
- "license": {
- "type": "MIT",
- "url": "http://github.com/isaacs/node-lru-cache/raw/master/LICENSE"
- },
- "readme": "# lru cache\n\nA cache object that deletes the least-recently-used items.\n\n## Usage:\n\n```javascript\nvar LRU = require(\"lru-cache\")\n , options = { max: 500\n , length: function (n) { return n * 2 }\n , dispose: function (key, n) { n.close() }\n , maxAge: 1000 * 60 * 60 }\n , cache = LRU(options)\n , otherCache = LRU(50) // sets just the max size\n\ncache.set(\"key\", \"value\")\ncache.get(\"key\") // \"value\"\n\ncache.reset() // empty the cache\n```\n\nIf you put more stuff in it, then items will fall out.\n\nIf you try to put an oversized thing in it, then it'll fall out right\naway.\n\n## Options\n\n* `max` The maximum size of the cache, checked by applying the length\n function to all values in the cache. Not setting this is kind of\n silly, since that's the whole purpose of this lib, but it defaults\n to `Infinity`.\n* `maxAge` Maximum age in ms. Items are not pro-actively pruned out\n as they age, but if you try to get an item that is too old, it'll\n drop it and return undefined instead of giving it to you.\n* `length` Function that is used to calculate the length of stored\n items. If you're storing strings or buffers, then you probably want\n to do something like `function(n){return n.length}`. The default is\n `function(n){return 1}`, which is fine if you want to store `n`\n like-sized things.\n* `dispose` Function that is called on items when they are dropped\n from the cache. This can be handy if you want to close file\n descriptors or do other cleanup tasks when items are no longer\n accessible. Called with `key, value`. It's called *before*\n actually removing the item from the internal cache, so if you want\n to immediately put it back in, you'll have to do that in a\n `nextTick` or `setTimeout` callback or it won't do anything.\n* `stale` By default, if you set a `maxAge`, it'll only actually pull\n stale items out of the cache when you `get(key)`. (That is, it's\n not pre-emptively doing a `setTimeout` or anything.) If you set\n `stale:true`, it'll return the stale value before deleting it. If\n you don't set this, then it'll return `undefined` when you try to\n get a stale entry, as if it had already been deleted.\n\n## API\n\n* `set(key, value, max)`\n* `get(key) => value`\n\n Both of these will update the \"recently used\"-ness of the key.\n They do what you think. `max` is optional and overrides the\n cache `max` option if provided.\n\n* `peek(key)`\n\n Returns the key value (or `undefined` if not found) without\n updating the \"recently used\"-ness of the key.\n\n (If you find yourself using this a lot, you *might* be using the\n wrong sort of data structure, but there are some use cases where\n it's handy.)\n\n* `del(key)`\n\n Deletes a key out of the cache.\n\n* `reset()`\n\n Clear the cache entirely, throwing away all values.\n\n* `has(key)`\n\n Check if a key is in the cache, without updating the recent-ness\n or deleting it for being stale.\n\n* `forEach(function(value,key,cache), [thisp])`\n\n Just like `Array.prototype.forEach`. Iterates over all the keys\n in the cache, in order of recent-ness. (Ie, more recently used\n items are iterated over first.)\n\n* `keys()`\n\n Return an array of the keys in the cache.\n\n* `values()`\n\n Return an array of the values in the cache.\n\n* `length()`\n\n Return total length of objects in cache taking into account\n `length` options function.\n\n* `itemCount()`\n\n Return total quantity of objects currently in cache. Note, that\n `stale` (see options) items are returned as part of this item\n count.\n",
- "readmeFilename": "README.md",
+ "license": "ISC",
"bugs": {
"url": "https://github.com/isaacs/node-lru-cache/issues"
},
- "homepage": "https://github.com/isaacs/node-lru-cache",
- "_id": "lru-cache@2.6.2",
- "_shasum": "77741638c6dc972e503dbe41dcb6bfdfba499a38",
- "_from": "lru-cache@^2.5.0",
- "_resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-2.6.2.tgz"
+ "homepage": "https://github.com/isaacs/node-lru-cache#readme"
}
View
28 src/img/node_modules/restify/node_modules/mime/package.json
@@ -40,34 +40,8 @@
"type": "git"
},
"version": "1.3.4",
- "gitHead": "1628f6e0187095009dcef4805c3a49706f137974",
"bugs": {
"url": "https://github.com/broofa/node-mime/issues"
},
- "homepage": "https://github.com/broofa/node-mime",
- "_id": "mime@1.3.4",
- "_shasum": "115f9e3b6b3daf2959983cb38f149a2d40eb5d53",
- "_from": "mime@^1.2.11",
- "_npmVersion": "1.4.28",
- "_npmUser": {
- "name": "broofa",
- "email": "robert@broofa.com"
- },
- "maintainers": [
- {
- "name": "broofa",
- "email": "robert@broofa.com"
- },
- {
- "name": "bentomas",
- "email": "benjamin@benjaminthomas.org"
- }
- ],
- "dist": {
- "shasum": "115f9e3b6b3daf2959983cb38f149a2d40eb5d53",
- "tarball": "http://registry.npmjs.org/mime/-/mime-1.3.4.tgz"
- },
- "directories": {},
- "_resolved": "https://registry.npmjs.org/mime/-/mime-1.3.4.tgz",
- "readme": "ERROR: No README data found!"
+ "homepage": "https://github.com/broofa/node-mime"
}
View
8 src/img/node_modules/restify/node_modules/semver/package.json
@@ -21,14 +21,8 @@
"bin": {
"semver": "./bin/semver"
},
- "readme": "semver(1) -- The semantic versioner for npm\n===========================================\n\n## Usage\n\n $ npm install semver\n\n semver.valid('1.2.3') // '1.2.3'\n semver.valid('a.b.c') // null\n semver.clean(' =v1.2.3 ') // '1.2.3'\n semver.satisfies('1.2.3', '1.x || >=2.5.0 || 5.0.0 - 7.2.3') // true\n semver.gt('1.2.3', '9.8.7') // false\n semver.lt('1.2.3', '9.8.7') // true\n\nAs a command-line utility:\n\n $ semver -h\n\n Usage: semver <version> [<version> [...]] [-r <range> | -i <inc> | -d <dec>]\n Test if version(s) satisfy the supplied range(s), and sort them.\n\n Multiple versions or ranges may be supplied, unless increment\n or decrement options are specified. In that case, only a single\n version may be used, and it is incremented by the specified level\n\n Program exits successfully if any valid version satisfies\n all supplied ranges, and prints all satisfying versions.\n\n If no versions are valid, or ranges are not satisfied,\n then exits failure.\n\n Versions are printed in ascending order, so supplying\n multiple versions to the utility will just sort them.\n\n## Versions\n\nA \"version\" is described by the `v2.0.0` specification found at\n<http://semver.org/>.\n\nA leading `\"=\"` or `\"v\"` character is stripped off and ignored.\n\n## Ranges\n\nThe following range styles are supported:\n\n* `1.2.3` A specific version. When nothing else will do. Must be a full\n version number, with major, minor, and patch versions specified.\n Note that build metadata is still ignored, so `1.2.3+build2012` will\n satisfy this range.\n* `>1.2.3` Greater than a specific version.\n* `<1.2.3` Less than a specific version. If there is no prerelease\n tag on the version range, then no prerelease version will be allowed\n either, even though these are technically \"less than\".\n* `>=1.2.3` Greater than or equal to. Note that prerelease versions\n are NOT equal to their \"normal\" equivalents, so `1.2.3-beta` will\n not satisfy this range, but `2.3.0-beta` will.\n* `<=1.2.3` Less than or equal to. In this case, prerelease versions\n ARE allowed, so `1.2.3-beta` would satisfy.\n* `1.2.3 - 2.3.4` := `>=1.2.3 <=2.3.4`\n* `~1.2.3` := `>=1.2.3-0 <1.3.0-0` \"Reasonably close to `1.2.3`\". When\n using tilde operators, prerelease versions are supported as well,\n but a prerelease of the next significant digit will NOT be\n satisfactory, so `1.3.0-beta` will not satisfy `~1.2.3`.\n* `^1.2.3` := `>=1.2.3-0 <2.0.0-0` \"Compatible with `1.2.3`\". When\n using caret operators, anything from the specified version (including\n prerelease) will be supported up to, but not including, the next\n major version (or its prereleases). `1.5.1` will satisfy `^1.2.3`,\n while `1.2.2` and `2.0.0-beta` will not.\n* `^0.1.3` := `>=0.1.3-0 <0.2.0-0` \"Compatible with `0.1.3`\". `0.x.x` versions are\n special: the first non-zero component indicates potentially breaking changes,\n meaning the caret operator matches any version with the same first non-zero\n component starting at the specified version.\n* `^0.0.2` := `=0.0.2` \"Only the version `0.0.2` is considered compatible\"\n* `~1.2` := `>=1.2.0-0 <1.3.0-0` \"Any version starting with `1.2`\"\n* `^1.2` := `>=1.2.0-0 <2.0.0-0` \"Any version compatible with `1.2`\"\n* `1.2.x` := `>=1.2.0-0 <1.3.0-0` \"Any version starting with `1.2`\"\n* `1.2.*` Same as `1.2.x`.\n* `1.2` Same as `1.2.x`.\n* `~1` := `>=1.0.0-0 <2.0.0-0` \"Any version starting with `1`\"\n* `^1` := `>=1.0.0-0 <2.0.0-0` \"Any version compatible with `1`\"\n* `1.x` := `>=1.0.0-0 <2.0.0-0` \"Any version starting with `1`\"\n* `1.*` Same as `1.x`.\n* `1` Same as `1.x`.\n* `*` Any version whatsoever.\n* `x` Same as `*`.\n* `\"\"` (just an empty string) Same as `*`.\n\n\nRanges can be joined with either a space (which implies \"and\") or a\n`||` (which implies \"or\").\n\n## Functions\n\nAll methods and classes take a final `loose` boolean argument that, if\ntrue, will be more forgiving about not-quite-valid semver strings.\nThe resulting output will always be 100% strict, of course.\n\nStrict-mode Comparators and Ranges will be strict about the SemVer\nstrings that they parse.\n\n* `valid(v)`: Return the parsed version, or null if it's not valid.\n* `inc(v, release)`: Return the version incremented by the release\n type (`major`, `premajor`, `minor`, `preminor`, `patch`,\n `prepatch`, or `prerelease`), or null if it's not valid\n * `premajor` in one call will bump the version up to the next major\n version and down to a prerelease of that major version.\n `preminor`, and `prepatch` work the same way.\n * If called from a non-prerelease version, the `prerelease` will work the\n same as `prepatch`. It increments the patch version, then makes a\n prerelease. If the input version is already a prerelease it simply\n increments it.\n\n### Comparison\n\n* `gt(v1, v2)`: `v1 > v2`\n* `gte(v1, v2)`: `v1 >= v2`\n* `lt(v1, v2)`: `v1 < v2`\n* `lte(v1, v2)`: `v1 <= v2`\n* `eq(v1, v2)`: `v1 == v2` This is true if they're logically equivalent,\n even if they're not the exact same string. You already know how to\n compare strings.\n* `neq(v1, v2)`: `v1 != v2` The opposite of `eq`.\n* `cmp(v1, comparator, v2)`: Pass in a comparison string, and it'll call\n the corresponding function above. `\"===\"` and `\"!==\"` do simple\n string comparison, but are included for completeness. Throws if an\n invalid comparison string is provided.\n* `compare(v1, v2)`: Return `0` if `v1 == v2`, or `1` if `v1` is greater, or `-1` if\n `v2` is greater. Sorts in ascending order if passed to `Array.sort()`.\n* `rcompare(v1, v2)`: The reverse of compare. Sorts an array of versions\n in descending order when passed to `Array.sort()`.\n\n\n### Ranges\n\n* `validRange(range)`: Return the valid range or null if it's not valid\n* `satisfies(version, range)`: Return true if the version satisfies the\n range.\n* `maxSatisfying(versions, range)`: Return the highest version in the list\n that satisfies the range, or `null` if none of them do.\n* `gtr(version, range)`: Return `true` if version is greater than all the\n versions possible in the range.\n* `ltr(version, range)`: Return `true` if version is less than all the\n versions possible in the range.\n* `outside(version, range, hilo)`: Return true if the version is outside\n the bounds of the range in either the high or low direction. The\n `hilo` argument must be either the string `'>'` or `'<'`. (This is\n the function called by `gtr` and `ltr`.)\n\nNote that, since ranges may be non-contiguous, a version might not be\ngreater than a range, less than a range, *or* satisfy a range! For\nexample, the range `1.2 <1.2.9 || >2.0.0` would have a hole from `1.2.9`\nuntil `2.0.0`, so the version `1.2.10` would not be greater than the\nrange (because `2.0.1` satisfies, which is higher), nor less than the\nrange (since `1.2.8` satisfies, which is lower), and it also does not\nsatisfy the range.\n\nIf you want to know if a version satisfies or does not satisfy a\nrange, use the `satisfies(version, range)` function.\n",
- "readmeFilename": "README.md",
"bugs": {
"url": "https://github.com/isaacs/node-semver/issues"
},
- "homepage": "https://github.com/isaacs/node-semver",
- "_id": "semver@2.3.2",
- "_shasum": "b9848f25d6cf36333073ec9ef8856d42f1233e52",
- "_from": "semver@^2.3.0",
- "_resolved": "https://registry.npmjs.org/semver/-/semver-2.3.2.tgz"
+ "homepage": "https://github.com/isaacs/node-semver"
}
View
10 src/img/node_modules/restify/node_modules/tunnel-agent/package.json
@@ -6,9 +6,9 @@
},
"name": "tunnel-agent",
"description": "HTTP proxy tunneling agent. Formerly part of mikeal/request, now a standalone module.",
- "version": "0.4.0",
+ "version": "0.4.1",
"repository": {
- "url": "https://github.com/mikeal/tunnel-agent"
+ "url": "git+https://github.com/mikeal/tunnel-agent.git"
},
"main": "index.js",
"dependencies": {},
@@ -17,13 +17,9 @@
"engines": {
"node": "*"
},
- "readme": "tunnel-agent\n============\n\nHTTP proxy tunneling agent. Formerly part of mikeal/request, now a standalone module.\n",
- "readmeFilename": "README.md",
"bugs": {
"url": "https://github.com/mikeal/tunnel-agent/issues"
},
- "homepage": "https://github.com/mikeal/tunnel-agent",
- "_id": "tunnel-agent@0.4.0",
- "_from": "tunnel-agent@^0.4.0",
+ "homepage": "https://github.com/mikeal/tunnel-agent#readme",
"scripts": {}
}
View
20 src/img/node_modules/restify/package.json
@@ -80,9 +80,6 @@
"name": "Matt Smillie"
},
{
- "name": "Armin Tamzarian"
- },
- {
"name": "Diego Torres"
},
{
@@ -110,9 +107,6 @@
"url": "git://github.com/mcavage/node-restify.git"
},
"main": "lib/index.js",
- "directories": {
- "lib": "./lib"
- },
"bin": {
"report-latency": "./bin/report-latency"
},
@@ -139,10 +133,10 @@
"spdy": "^1.26.5",
"tunnel-agent": "^0.4.0",
"verror": "^1.4.0",
- "dtrace-provider": "^0.4.0"
+ "dtrace-provider": "^0.3.1"
},
"optionalDependencies": {
- "dtrace-provider": "^0.4.0"
+ "dtrace-provider": "^0.3.1"
},
"devDependencies": {
"cover": "^0.2.9",
@@ -151,15 +145,9 @@
"watershed": "^0.3.0"
},
"scripts": {
- "test": "make prepush"
+ "test": "nodeunit ./test"
},
- "readme": "# restify\n\n[![Build Status](https://travis-ci.org/mcavage/node-restify.svg)](https://travis-ci.org/mcavage/node-restify)\n[![Gitter chat](https://badges.gitter.im/mcavage/node-restify.svg)](https://gitter.im/mcavage/node-restify)\n[![Dependency Status](https://david-dm.org/mcavage/node-restify.svg)](https://david-dm.org/mcavage/node-restify)\n[![devDependency Status](https://david-dm.org/mcavage/node-restify/dev-status.svg)](https://david-dm.org/mcavage/node-restify#info=devDependencies)\n\n\n[restify](http://mcavage.github.com/node-restify) is a smallish framework,\nsimilar to [express](http://expressjs.com) for building REST APIs. For full\ndetails, see http://mcavage.github.com/node-restify.\n\nJoin us on IRC at `irc.freenode.net` in the `#restify` channel for real-time\nchat and support.\n\n# Usage\n\n## Server\n```javascript\nvar restify = require('restify');\n\nvar server = restify.createServer({\n name: 'myapp',\n version: '1.0.0'\n});\nserver.use(restify.acceptParser(server.acceptable));\nserver.use(restify.queryParser());\nserver.use(restify.bodyParser());\n\nserver.get('/echo/:name', function (req, res, next) {\n res.send(req.params);\n return next();\n});\n\nserver.listen(8080, function () {\n console.log('%s listening at %s', server.name, server.url);\n});\n```\n\n## Client\n```javascript\nvar assert = require('assert');\nvar restify = require('restify');\n\nvar client = restify.createJsonClient({\n url: 'http://localhost:8080',\n version: '~1.0'\n});\n\nclient.get('/echo/mark', function (err, req, res, obj) {\n assert.ifError(err);\n console.log('Server returned: %j', obj);\n});\n```\n\n# Installation\n\n $ npm install restify\n\n## License\n\nThe MIT License (MIT)\nCopyright (c) 2012 Mark Cavage\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of\nthis software and associated documentation files (the \"Software\"), to deal in\nthe Software without restriction, including without limitation the rights to\nuse, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\nthe Software, and to permit persons to whom the Software is furnished to do so,\nsubject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n\n## Bugs\n\nSee <https://github.com/mcavage/node-restify/issues>.\n\n## Mailing list\n\nSee the\n[Google group](https://groups.google.com/forum/?hl=en&fromgroups#!forum/restify)\n.\n",
- "readmeFilename": "README.md",
"bugs": {
"url": "https://github.com/mcavage/node-restify/issues"
- },
- "_id": "restify@2.8.5",
- "_shasum": "dca53860e5ea127da42ce3ceabcd0adf3c82075b",
- "_resolved": "https://registry.npmjs.org/restify/-/restify-2.8.5.tgz",
- "_from": "restify@2.8.5"
+ }
}
View
8 src/img/node_modules/rimraf/package.json
@@ -45,14 +45,8 @@
"email": "yosefd@microsoft.com"
}
],
- "readme": "`rm -rf` for node.\n\nInstall with `npm install rimraf`, or just drop rimraf.js somewhere.\n\n## API\n\n`rimraf(f, callback)`\n\nThe callback will be called with an error if there is one. Certain\nerrors are handled for you:\n\n* Windows: `EBUSY` and `ENOTEMPTY` - rimraf will back off a maximum of\n `opts.maxBusyTries` times before giving up.\n* `ENOENT` - If the file doesn't exist, rimraf will return\n successfully, since your desired outcome is already the case.\n\n## rimraf.sync\n\nIt can remove stuff synchronously, too. But that's not so good. Use\nthe async API. It's better.\n\n## CLI\n\nIf installed with `npm install rimraf -g` it can be used as a global\ncommand `rimraf <path>` which is useful for cross platform support.\n\n## mkdirp\n\nIf you need to create a directory recursively, check out\n[mkdirp](https://github.com/substack/node-mkdirp).\n",
- "readmeFilename": "README.md",
"bugs": {
"url": "https://github.com/isaacs/rimraf/issues"
},
- "homepage": "https://github.com/isaacs/rimraf",
- "_id": "rimraf@2.2.8",
- "_shasum": "e439be2aaee327321952730f99a8929e4fc50582",
- "_from": "rimraf@2.2.8",
- "_resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.2.8.tgz"
+ "homepage": "https://github.com/isaacs/rimraf"
}
View
12 src/img/node_modules/sdc-clients/node_modules/async/package.json
@@ -8,7 +8,7 @@
"version": "0.1.22",
"repository": {
"type": "git",
- "url": "http://github.com/caolan/async.git"
+ "url": "git://github.com/caolan/async.git"
},
"bugs": {
"url": "http://github.com/caolan/async/issues"
@@ -24,9 +24,9 @@
"uglify-js": "1.2.x",
"nodelint": ">0.0.0"
},
- "readme": "# Async.js\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), it can also be used directly in the\nbrowser.\n\nAsync provides around 20 functions that include the usual 'functional'\nsuspects (map, reduce, filter, forEach…) 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 async.map(['file1','file2','file3'], fs.stat, function(err, results){\n // results is now an array of stats for each file\n });\n\n async.filter(['file1','file2','file3'], path.exists, function(results){\n // results now equals an array of the existing files\n });\n\n async.parallel([\n function(){ ... },\n function(){ ... }\n ], callback);\n\n async.series([\n function(){ ... },\n function(){ ... }\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\n## Download\n\nReleases are available for download from\n[GitHub](http://github.com/caolan/async/downloads).\nAlternatively, you can install using Node Package Manager (npm):\n\n npm install async\n\n\n__Development:__ [async.js](https://github.com/caolan/async/raw/master/lib/async.js) - 17.5kb Uncompressed\n\n__Production:__ [async.min.js](https://github.com/caolan/async/raw/master/dist/async.min.js) - 1.7kb Packed and Gzipped\n\n\n## In the Browser\n\nSo far its been tested in IE6, IE7, IE8, FF3.6 and Chrome 5. Usage:\n\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\n### Collections\n\n* [forEach](#forEach)\n* [map](#map)\n* [filter](#filter)\n* [reject](#reject)\n* [reduce](#reduce)\n* [detect](#detect)\n* [sortBy](#sortBy)\n* [some](#some)\n* [every](#every)\n* [concat](#concat)\n\n### Control Flow\n\n* [series](#series)\n* [parallel](#parallel)\n* [whilst](#whilst)\n* [until](#until)\n* [waterfall](#waterfall)\n* [queue](#queue)\n* [auto](#auto)\n* [iterator](#iterator)\n* [apply](#apply)\n* [nextTick](#nextTick)\n\n### Utils\n\n* [memoize](#memoize)\n* [unmemoize](#unmemoize)\n* [log](#log)\n* [dir](#dir)\n* [noConflict](#noConflict)\n\n\n## Collections\n\n<a name=\"forEach\" />\n### forEach(arr, iterator, callback)\n\nApplies an iterator function to each item in an array, 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 this callback, the main\ncallback for the forEach 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.\n\n__Arguments__\n\n* arr - An array to iterate over.\n* iterator(item, callback) - A function to apply to each item in the array.\n The iterator is passed a callback which must be called once it has completed.\n* callback(err) - A callback which is called after all the iterator functions\n have finished, or an error has occurred.\n\n__Example__\n\n // assuming openFiles is an array of file names and saveFile is a function\n // to save the modified contents of that file:\n\n async.forEach(openFiles, saveFile, function(err){\n // if any of the saves produced an error, err would equal that error\n });\n\n---------------------------------------\n\n<a name=\"forEachSeries\" />\n### forEachSeries(arr, iterator, callback)\n\nThe same as forEach only the iterator is applied to each item in the array in\nseries. The next iterator is only called once the current one has completed\nprocessing. This means the iterator functions will complete in order.\n\n\n---------------------------------------\n\n<a name=\"forEachLimit\" />\n### forEachLimit(arr, limit, iterator, callback)\n\nThe same as forEach only the iterator is applied to batches of items in the\narray, in series. The next batch of iterators is only called once the current\none has completed processing.\n\n__Arguments__\n\n* arr - An array to iterate over.\n* limit - How many items should be in each batch.\n* iterator(item, callback) - A function to apply to each item in the array.\n The iterator is passed a callback which must be called once it has completed.\n* callback(err) - A callback which is called after all the iterator functions\n have finished, or an error has occurred.\n\n__Example__\n\n // Assume documents is an array of JSON objects and requestApi is a\n // function that interacts with a rate-limited REST api.\n\n async.forEachLimit(documents, 20, requestApi, function(err){\n // if any of the saves produced an error, err would equal that error\n });\n---------------------------------------\n\n<a name=\"map\" />\n### map(arr, iterator, callback)\n\nProduces a new array of values by mapping each value in the given array through\nthe iterator function. The iterator is called with an item from the array and a\ncallback for when it has finished processing. The callback takes 2 arguments, \nan error and the transformed item from the array. If the iterator passes an\nerror to this callback, the main callback for the map function is immediately\ncalled 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, however\nthe results array will be in the same order as the original array.\n\n__Arguments__\n\n* arr - An array to iterate over.\n* iterator(item, callback) - A function to apply to each item in the array.\n The iterator is passed a callback which must be called once it has completed\n with an error (which can be null) and a transformed item.\n* callback(err, results) - A callback which is called after all the iterator\n functions have finished, or an error has occurred. Results is an array of the\n transformed items from the original array.\n\n__Example__\n\n async.map(['file1','file2','file3'], fs.stat, function(err, results){\n // results is now an array of stats for each file\n });\n\n---------------------------------------\n\n<a name=\"mapSeries\" />\n### mapSeries(arr, iterator, callback)\n\nThe same as map only the iterator is applied to each item in the array in\nseries. The next iterator is only called once the current one has completed\nprocessing. The results array will be in the same order as the original.\n\n\n---------------------------------------\n\n<a name=\"filter\" />\n### filter(arr, iterator, callback)\n\n__Alias:__ select\n\nReturns a new array of all the values which pass an async truth test.\n_The callback for each iterator call only accepts a single argument of true or\nfalse, it does not accept an error argument first!_ This is in-line with the\nway node libraries work with truth tests like path.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 the array.\n The iterator is passed a callback which must be called once it has completed.\n* callback(results) - A callback which is called after all the iterator\n functions have finished.\n\n__Example__\n\n async.filter(['file1','file2','file3'], path.exists, function(results){\n // results now equals an array of the existing files\n });\n\n---------------------------------------\n\n<a name=\"filterSeries\" />\n### filterSeries(arr, iterator, callback)\n\n__alias:__ selectSeries\n\nThe same as filter only the iterator is applied to each item in the array in\nseries. The next iterator is only called once the current one has completed\nprocessing. The results array will be in the same order as the original.\n\n---------------------------------------\n\n<a name=\"reject\" />\n### reject(arr, iterator, callback)\n\nThe opposite of filter. Removes values that pass an async truth test.\n\n---------------------------------------\n\n<a name=\"rejectSeries\" />\n### rejectSeries(arr, iterator, callback)\n\nThe same as filter, only the iterator is applied to each item in the array\nin series.\n\n\n---------------------------------------\n\n<a name=\"reduce\" />\n### reduce(arr, memo, iterator, callback)\n\n__aliases:__ inject, foldl\n\nReduces a list of values into a single value using an async iterator to return\neach successive step. Memo is the initial state of the reduction. This\nfunction only operates in series. For performance reasons, it may make sense to\nsplit a call to this function into a parallel map, then use the normal\nArray.prototype.reduce on the results. This function is for situations where\neach step in the reduction needs to be async, if you can get the data before\nreducing it then its 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 which accepts an optional error as its first argument, and the state\n of the reduction as the second. If an error is passed to the callback, the\n reduction is stopped and the main callback is immediately called with the\n error.\n* callback(err, result) - A callback which is called after all the iterator\n functions have finished. Result is the reduced value.\n\n__Example__\n\n async.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<a name=\"reduceRight\" />\n### reduceRight(arr, memo, iterator, callback)\n\n__Alias:__ foldr\n\nSame as reduce, only operates on the items in the array in reverse order.\n\n\n---------------------------------------\n\n<a name=\"detect\" />\n### detect(arr, iterator, callback)\n\nReturns the first value in a list that passes an async truth test. The\niterator 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 array (in terms of order) that passes the test.\n\nIf order within the original array is important then look at 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 the array.\n The iterator is passed a callback which must be called once it has completed.\n* callback(result) - 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.\n\n__Example__\n\n async.detect(['file1','file2','file3'], path.exists, function(result){\n // result now equals the first file in the list that exists\n });\n\n---------------------------------------\n\n<a name=\"detectSeries\" />\n### detectSeries(arr, iterator, callback)\n\nThe same as detect, only the iterator is applied to each item in the array\nin series. This means the result is always the first in the original array (in\nterms of array order) that passes the truth test.\n\n\n---------------------------------------\n\n<a name=\"sortBy\" />\n### sortBy(arr, iterator, callback)\n\nSorts a list by the results of running each 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 the array.\n The iterator is passed a callback which must be called once it has completed\n with an error (which can be null) and a value to use as the sort criteria.\n* callback(err, results) - A callback which is called after all the iterator\n functions have finished, or an error has occurred. Results is the items from\n the original array sorted by the values returned by the iterator calls.\n\n__Example__\n\n async.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---------------------------------------\n\n<a name=\"some\" />\n### some(arr, iterator, callback)\n\n__Alias:__ any\n\nReturns true if at least one element in the array satisfies an async test.\n_The callback for each iterator call only accepts a single argument of true or\nfalse, it does not accept an error argument first!_ This is in-line with the\nway node libraries work with truth tests like path.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 The iterator is passed a callback which must be called once it has completed.\n* callback(result) - 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__Example__\n\n async.some(['file1','file2','file3'], path.exists, function(result){\n // if result is true then at least one of the files exists\n });\n\n---------------------------------------\n\n<a name=\"every\" />\n### every(arr, iterator, callback)\n\n__Alias:__ all\n\nReturns true if every element in the array satisfies an async test.\n_The callback for each iterator call only accepts a single argument of true or\nfalse, it does not accept an error argument first!_ This is in-line with the\nway node libraries work with truth tests like path.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 The iterator is passed a callback which must be called once it has completed.\n* callback(result) - A callback which is called after all the iterator\n functions have finished. Result will be either true or false depending on\n the values of the async tests.\n\n__Example__\n\n async.every(['file1','file2','file3'], path.exists, function(result){\n // if result is true then every file exists\n });\n\n---------------------------------------\n\n<a name=\"concat\" />\n### concat(arr, iterator, callback)\n\nApplies an iterator to each item in a list, concatenating the results. Returns the\nconcatenated list. The iterators 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 the arguments 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 the array.\n The iterator is passed a callback which must be called once it has completed\n with an error (which can be null) and an array of results.\n* callback(err, results) - A callback which is called after all the iterator\n functions have finished, or an error has occurred. Results is an array containing\n the concatenated results of the iterator function.\n\n__Example__\n\n async.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\n<a name=\"concatSeries\" />\n### concatSeries(arr, iterator, callback)\n\nSame as async.concat, but executes in series instead of parallel.\n\n\n## Control Flow\n\n<a name=\"series\" />\n### series(tasks, [callback])\n\nRun an array of functions 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 the callback for the series is\nimmediately called with the value of the error. Once the tasks have completed,\nthe results are passed to the final callback as an array.\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\nasync.series.\n\n\n__Arguments__\n\n* tasks - An array or object containing functions to run, each function is passed\n a callback it must call on completion.\n* callback(err, results) - An optional callback to run once all the functions\n have completed. This function gets an array of all the arguments passed to\n the callbacks used in the array.\n\n__Example__\n\n async.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\n function(err, results){\n // results is now equal to ['one', 'two']\n });\n\n\n // an example using an object instead of an array\n async.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 },\n function(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 an 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\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\nasync.parallel.\n\n\n__Arguments__\n\n* tasks - An array or object containing functions to run, each function is passed a\n callback it must call on completion.\n* callback(err, results) - An optional callback to run once all the functions\n have completed. This function gets an array of all the arguments passed to\n the callbacks used in the array.\n\n__Example__\n\n async.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\n function(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\n async.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 },\n function(err, results) {\n // results is now equals to: {one: 1, two: 2}\n });\n\n\n---------------------------------------\n\n<a name=\"whilst\" />\n### whilst(test, fn, callback)\n\nRepeatedly call fn, while test returns true. Calls the 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 to call each time the test passes. The function is\n passed a callback which must be called once it has completed with an optional\n error as the first argument.\n* callback(err) - A callback which is called after the test fails and repeated\n execution of fn has stopped.\n\n__Example__\n\n var count = 0;\n\n async.whilst(\n function () { return count < 5; },\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=\"until\" />\n### until(test, fn, callback)\n\nRepeatedly call fn, until test returns true. Calls the callback when stopped,\nor an error occurs.\n\nThe inverse of async.whilst.\n\n\n---------------------------------------\n\n<a name=\"waterfall\" />\n### waterfall(tasks, [callback])\n\nRuns an array of functions in series, each passing their results to the next in\nthe array. However, if any of the functions pass an error to the 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 callback it\n must call on completion.\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 async.waterfall([\n function(callback){\n callback(null, 'one', 'two');\n },\n function(arg1, arg2, callback){\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\n\n---------------------------------------\n\n<a name=\"queue\" />\n### queue(worker, concurrency)\n\nCreates a queue object with the specified concurrency. Tasks added to the\nqueue will be processed in parallel (up to the concurrency limit). If all\nworkers are in progress, the task is queued until one is available. Once\na worker has completed a task, the task's callback is called.\n\n__Arguments__\n\n* worker(task, callback) - An asynchronous function for processing a queued\n task.\n* concurrency - An integer for determining how many worker functions should be\n run in parallel.\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* 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, the callback is called\n once the worker has finished processing the task.\n instead of a single task, an array of tasks 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\n__Example__\n\n // create a queue object with concurrency 2\n\n var q = async.queue(function (task, callback) {\n console.log('hello ' + task.name);\n callback();\n }, 2);\n\n\n // assign a callback\n q.drain = function() {\n console.log('all items have been processed');\n }\n\n // add some items to the queue\n\n q.push({name: 'foo'}, function (err) {\n console.log('finished processing foo');\n });\n q.push({name: 'bar'}, function (err) {\n console.log('finished processing bar');\n });\n\n // add some items to the queue (batch-wise)\n\n q.push([{name: 'baz'},{name: 'bay'},{name: 'bax'}], function (err) {\n console.log('finished processing bar');\n });\n\n\n---------------------------------------\n\n<a name=\"auto\" />\n### auto(tasks, [callback])\n\nDetermines the best order for running functions based on their requirements.\nEach function can optionally depend on other functions being completed first,\nand each function is run as soon as its requirements are satisfied. If any of\nthe functions pass an error to their callback, that function will not complete\n(so any other functions depending on it will not run) and the main callback\nwill be called immediately with the error. Functions also receive an object\ncontaining the results of functions which have completed so far.\n\n__Arguments__\n\n* tasks - An object literal containing named functions or an array of\n requirements, with the function itself the last item in the array. The key\n used for each function or array is used when specifying requirements. The\n syntax is easier to understand by looking at the example.\n* callback(err, results) - An optional callback which is called when all the\n tasks have been completed. The callback will receive an error as an argument\n if any tasks pass an error to their callback. If all tasks complete\n successfully, it will receive an object containing their results.\n\n__Example__\n\n async.auto({\n get_data: function(callback){\n // async code to get some data\n },\n make_folder: function(callback){\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 },\n write_file: ['get_data', 'make_folder', function(callback){\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 // once the file is written let's email a link to it...\n // results.write_file contains the filename returned by write_file.\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 async.parallel([\n function(callback){\n // async code to get some data\n },\n function(callback){\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 }\n ],\n function(results){\n async.series([\n function(callback){\n // once there is some data and the directory exists,\n // write the data to a file in the directory\n },\n email_link: function(callback){\n // once the file is written let's email a link to it...\n }\n ]);\n });\n\nFor a complicated series of async tasks using the auto function makes adding\nnew tasks much easier and makes the code more readable.\n\n\n---------------------------------------\n\n<a name=\"iterator\" />\n### iterator(tasks)\n\nCreates an iterator function which calls the next function in the array,\nreturning a continuation to call the next one after that. Its also possible to\n'peek' the next iterator by doing 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, each function is passed a callback it\n must call on completion.\n\n__Example__\n\n var iterator = async.iterator([\n function(){ sys.p('one'); },\n function(){ sys.p('two'); },\n function(){ sys.p('three'); }\n ]);\n\n node> var iterator2 = iterator();\n 'one'\n node> var iterator3 = iterator2();\n 'two'\n node> iterator3();\n 'three'\n node> var nextfn = iterator2.next();\n node> 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, a useful\nshorthand 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 // using apply\n\n async.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\n async.parallel([\n function(callback){\n fs.writeFile('testfile1', 'test1', callback);\n },\n function(callback){\n fs.writeFile('testfile2', 'test2', callback);\n },\n ]);\n\nIt's possible to pass any number of additional arguments when calling the\ncontinuation:\n\n node> var fn = async.apply(sys.puts, 'one');\n node> fn('two', 'three');\n one\n two\n three\n\n---------------------------------------\n\n<a name=\"nextTick\" />\n### nextTick(callback)\n\nCalls the callback on a later loop around the event loop. In node.js this just\ncalls process.nextTick, in the browser it falls back to setTimeout(callback, 0),\nwhich means other higher priority events may precede the execution of the 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 var call_order = [];\n async.nextTick(function(){\n call_order.push('two');\n // call_order now equals ['one','two]\n });\n call_order.push('one')\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\n__Arguments__\n\n* fn - the function you 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 var slow_fn = function (name, callback) {\n // do something\n callback(null, result);\n };\n var fn = async.memoize(slow_fn);\n\n // fn can now be used as if it were slow_fn\n fn('some name', function () {\n // callback\n });\n\n<a name=\"unmemoize\" />\n### unmemoize(fn)\n\nUndoes a memoized function, reverting it to the original, unmemoized\nform. Comes handy in tests.\n\n__Arguments__\n\n* fn - the memoized function\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 var hello = function(name, callback){\n setTimeout(function(){\n callback(null, 'hello ' + name);\n }, 1000);\n };\n\n node> 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 var hello = function(name, callback){\n setTimeout(function(){\n callback(null, {hello: name});\n }, 1000);\n };\n\n node> 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\nasync object.\n",
- "readmeFilename": "README.md",
- "homepage": "https://github.com/caolan/async",
- "_id": "async@0.1.22",
- "_from": "async@0.1.22"
+ "dependencies": {},
+ "optionalDependencies": {},
+ "engines": {
+ "node": "*"
+ }
}
View
10 src/img/node_modules/sdc-clients/node_modules/lru-cache/package.json
@@ -51,13 +51,5 @@
"name": "Jesse Dailey",
"email": "jesse.dailey@gmail.com"
}
- ],
- "readme": "# lru cache\n\nA cache object that deletes the least-recently-used items.\n\n## Usage:\n\n```javascript\nvar LRU = require(\"lru-cache\")\n , options = { max: 500\n , length: function (n) { return n * 2 }\n , dispose: function (key, n) { n.close() }\n , maxAge: 1000 * 60 * 60 }\n , cache = LRU(options)\n , otherCache = LRU(50) // sets just the max size\n\ncache.set(\"key\", \"value\")\ncache.get(\"key\") // \"value\"\n\ncache.reset() // empty the cache\n```\n\nIf you put more stuff in it, then items will fall out.\n\nIf you try to put an oversized thing in it, then it'll fall out right\naway.\n\n## Options\n\n* `max` The maximum size of the cache, checked by applying the length\n function to all values in the cache. Not setting this is kind of\n silly, since that's the whole purpose of this lib, but it defaults\n to `Infinity`.\n* `maxAge` Maximum age in ms. Items are not pro-actively pruned out\n as they age, but if you try to get an item that is too old, it'll\n drop it and return undefined instead of giving it to you.\n* `length` Function that is used to calculate the length of stored\n items. If you're storing strings or buffers, then you probably want\n to do something like `function(n){return n.length}`. The default is\n `function(n){return 1}`, which is fine if you want to store `n`\n like-sized things.\n* `dispose` Function that is called on items when they are dropped\n from the cache. This can be handy if you want to close file\n descriptors or do other cleanup tasks when items are no longer\n accessible. Called with `key, value`. It's called *before*\n actually removing the item from the internal cache, so if you want\n to immediately put it back in, you'll have to do that in a\n `nextTick` or `setTimeout` callback or it won't do anything.\n* `stale` By default, if you set a `maxAge`, it'll only actually pull\n stale items out of the cache when you `get(key)`. (That is, it's\n not pre-emptively doing a `setTimeout` or anything.) If you set\n `stale:true`, it'll return the stale value before deleting it. If\n you don't set this, then it'll return `undefined` when you try to\n get a stale entry, as if it had already been deleted.\n\n## API\n\n* `set(key, value)`\n* `get(key) => value`\n\n Both of these will update the \"recently used\"-ness of the key.\n They do what you think.\n\n* `peek(key)`\n\n Returns the key value (or `undefined` if not found) without\n updating the \"recently used\"-ness of the key.\n\n (If you find yourself using this a lot, you *might* be using the\n wrong sort of data structure, but there are some use cases where\n it's handy.)\n\n* `del(key)`\n\n Deletes a key out of the cache.\n\n* `reset()`\n\n Clear the cache entirely, throwing away all values.\n\n* `has(key)`\n\n Check if a key is in the cache, without updating the recent-ness\n or deleting it for being stale.\n\n* `forEach(function(value,key,cache), [thisp])`\n\n Just like `Array.prototype.forEach`. Iterates over all the keys\n in the cache, in order of recent-ness. (Ie, more recently used\n items are iterated over first.)\n\n* `keys()`\n\n Return an array of the keys in the cache.\n\n* `values()`\n\n Return an array of the values in the cache.\n",
- "readmeFilename": "README.md",
- "bugs": {
- "url": "https://github.com/isaacs/node-lru-cache/issues"
- },
- "homepage": "https://github.com/isaacs/node-lru-cache",
- "_id": "lru-cache@2.3.0",
- "_from": "lru-cache@2.3.0"
+ ]
}
View
9 src/img/node_modules/sdc-clients/node_modules/ssh-agent/node_modules/ctype/package.json
@@ -11,11 +11,6 @@
"node": ">= 0.4"
},
"main": "ctype.js",
- "readme": "Node-CType is a way to read and write binary data in structured and easy to use\nformat. Its name comes from the C header file.\n\nTo get started, simply clone the repository or use npm to install it. Once it is\nthere, simply require it.\n\ngit clone git://github.com/rmustacc/node-ctype\nnpm install ctype\nvar mod_ctype = require('ctype')\n\n\nThere are two APIs that you can use, depending on what abstraction you'd like.\nThe low level API let's you read and write individual integers and floats from\nbuffers. The higher level API let's you read and write structures of these. To\nillustrate this, let's looks look at how we would read and write a binary\nencoded x,y point.\n\nIn C we would define this structure as follows:\n\ntypedef struct point {\n\tuint16_t\tp_x;\n\tuint16_t\tp_y;\n} point_t;\n\nTo read a binary encoded point from a Buffer, we first need to create a CType\nparser (where we specify the endian and other options) and add the typedef.\n\nvar parser = new mod_ctype.Parser({ endian: 'big' });\nparser.typedef('point_t', [\n\t{ x: { type: 'uint16_t' } },\n\t{ y: { type: 'uint16_t' } }\n]);\n\nFrom here, given a buffer buf and an offset into it, we can read a point.\n\nvar out = parser.readData([ { point: { type: 'point_t' } } ], buffer, 0);\nconsole.log(out);\n{ point: { x: 23, y: 42 } }\n\nAnother way to get the same information would be to use the low level methods.\nNote that these require you to manually deal with the offset. Here's how we'd\nget the same values of x and y from the buffer.\n\nvar x = mod_ctype.ruint16(buf, 'big', 0);\nvar y = mod_ctype.ruint16(buf, 'big', 2);\nconsole.log(x + ', ' + y);\n23, 42\n\nThe true power of this API comes from the ability to define and nest typedefs,\njust as you would in C. By default, the following types are defined by default.\nNote that they return a Number, unless indicated otherwise.\n\n * int8_t\n * int16_t\n * int32_t\n * int64_t (returns an array where val[0] << 32 + val[1] would be the value)\n * uint8_t\n * uint16_t\n * uint32_t\n * uint64_t (returns an array where val[0] << 32 + val[1] would be the value)\n * float\n * double\n * char (either returns a buffer with that character or a uint8_t)\n * char[] (returns an object with the buffer and the number of characters read which is either the total amount requested or until the first 0)\n\n\nctf2json integration:\n\nNode-CType supports consuming the output of ctf2json. Once you read in a JSON file,\nall you have to do to add all the definitions it contains is:\n\nvar data, parser;\ndata = JSON.parse(parsedJSONData);\nparser = mod_ctype.parseCTF(data, { endian: 'big' });\n\nFor more documentation, see the file README.old. Full documentation is in the\nprocess of being rewritten as a series of manual pages which will be available\nin the repository and online for viewing.\n\nTo read the ctio manual page simple run, from the root of the workspace:\n\nman -Mman -s 3ctype ctio\n",
- "readmeFilename": "README",
- "_id": "ctype@0.5.0",
- "_shasum": "672673ec67587eb495c1ed694da1abb964ff65e3",
- "_from": "ctype@0.5.0",
- "_resolved": "https://registry.npmjs.org/ctype/-/ctype-0.5.0.tgz",
- "scripts": {}
+ "dependencies": {},
+ "devDependencies": {}
}
View
14 src/img/node_modules/sdc-clients/node_modules/ssh-agent/package.json
@@ -26,16 +26,6 @@
"whiskey": "0.6.10"
},
"scripts": {
- "test": "whiskey -t \"`find tst -name *.test.js | xargs`\""
- },
- "readme": "node-ssh-agent is a client binding to the SSH Agent protocol, written in \"pure\"\nnode.js. For now, the operations supported are \"list keys\" and \"sign data\"\n(which in SSH parlance is `requestIdentities` and `sign`.\n\n## Usage\n\n var SSHAgentClient = require('ssh-agent');\n\n var client = new SSHAgentClient();\n var data = new Buffer('Hello World');\n\n // Try to sign data with an RSA key (will generate\n // an RSA-SHA1 signature).\n client.requestIdentities(function(err, keys) {\n var key = null;\n for (var i = 0; i < keys.length; i++) {\n if (keys[i].type === 'ssh-rsa') {\n key = keys[i];\n break;\n }\n }\n if (!key)\n return;\n\n client.sign(key, data, function(err, signature) {\n console.log('Signature: ' + signature.signature);\n });\n });\n\n\n## Installation\n\n npm install ssh-agent\n\n## License\n\nMIT.\n\n## Bugs\n\nSee <https://github.com/mcavage/node-ssh-agent/issues>.\n",
- "readmeFilename": "README.md",
- "bugs": {
- "url": "https://github.com/mcavage/node-ssh-agent/issues"
- },
- "homepage": "https://github.com/mcavage/node-ssh-agent",
- "_id": "ssh-agent@0.2.1",
- "_shasum": "3044e9eaeca88a9e6971dd7deb19bdcc20012929",
- "_from": "ssh-agent@0.2.1",
- "_resolved": "https://registry.npmjs.org/ssh-agent/-/ssh-agent-0.2.1.tgz"
+ "test": "./node_modules/.bin/whiskey -t \"`find tst -name *.test.js | xargs`\""
+ }
}
View
8 src/img/node_modules/sdc-clients/package.json
@@ -31,13 +31,7 @@
"node": ">=0.8.14"
},
"license": "MPL-2.0",
- "readme": "<!--\n This Source Code Form is subject to the terms of the Mozilla Public\n License, v. 2.0. If a copy of the MPL was not distributed with this\n file, You can obtain one at http://mozilla.org/MPL/2.0/.\n-->\n\n<!--\n Copyright (c) 2014, Joyent, Inc.\n-->\n\n# node-sdc-clients\n\nThis repository is part of the Joyent SmartDataCenter project (SDC). For\ncontribution guidelines, issues, and general documentation, visit the main\n[SDC](http://github.com/joyent/sdc) project page.\n\nNode.js client libraries for the various SDC REST API services: Amon, CA,\nCNAPI, NAPI, UFDS, Packages on top of UFDS and VMAPI so far.\n\n## Testing\n\nShort version:\n\n make test\n\nOf course, you may want to read some assumptions we made in order to ensure\nthe previous `make test` will run successfully.\n\nCurrently, every `test/*.test.js` file can be run separately as a different\ntest suite by issuing the proper commands:\n\n AMON_IP=10.99.99.20 \\\n MACHINE_UUID=f56dbb40-1c81-4047-9d56-73fc3adf2b99 \\\n make amon_test\n\n CA_IP=10.99.99.24 make ca_test\n\n make cnapi_test\n\n make ufds_test\n\n make package_test\n\n make vmapi_test\n\n make napi_test\n\n make imgapi_test\n\n make papi_test\n\nEach one of this commands assumes you've got a running version of the proper\nAPI service.\n\nFor every service, the following environment variables can be provided to\nindicate the IP addresses where these services are running:\n\n AMON_IP\n CA_IP\n CNAPI_IP\n UFDS_IP\n VMAPI_IP\n NAPI_IP\n PAPI_IP\n\nOf course, you provide each one of these environment variables to the proper\ntest suite make command and, in case you plan to run `make test`, i.e, all the\ntest suites, you may want to provide all these environment variables.\n\nAlso, note that `amon` test suite requires the UUID of a real machine to be\ngiven as environment variable in order to be able to create real machine\nprobes (`MACHINE_UUID` env var).\n\nGiven UFDS, CNAPI, NAPI and VMAPI are services provided by the default headnode\ncore zones, if the associated IP env variables are not provided, the test\nsuites will set them to the default values into a COAL image running the\nheadnode; that is:\n\n CNAPI_IP=10.99.99.18\n UFDS_IP=10.99.99.14\n VMAPI_IP=10.99.99.22\n NAPI_IP=10.99.99.10\n AMON_IP=10.99.99.20\n CA_IP=10.99.99.25\n PAPI_IP=10.99.99.30\n\nThere are no default values pointing to the headnode zones for AMON and CA.\nThe default test values for these APIs point to `localhost` so, you may want\nto either run them locally or pass in the values for these zones IPs.\n\nSo, in brief, requirements to run these test suites:\n\n- Headnode setup, including AMON and CA zones. \n- Run the following command:\n\n CNAPI_IP=10.99.99.18 \\\n VMAPI_IP=10.99.99.22 \\\n UFDS_IP=10.99.99.14 \\\n NAPI_IP=10.99.99.10 \\\n CA_IP=10.99.99.25 \\\n AMON_IP=10.99.99.20 \\\n PAPI_IP=10.99.99.30 \\\n MACHINE_UUID=f56dbb40-1c81-4047-9d56-73fc3adf2b99 \\\n make test\n\nwith the different IP env vars pointing to the right IP for each zone.\n\nNote that it's also possible to pass the ENV variable `ADMIN_PWD` to be used\nwith UFDS authentication tests. When not given, it will default to the\n_traditional_ `joypass123`.\n",
- "readmeFilename": "README.md",
"bugs": {
"url": "https://github.com/joyent/node-sdc-clients/issues"
- },
- "_id": "sdc-clients@8.1.3",
- "_shasum": "3dfd65d20224cd2224b9aba3447c9c9f010c4676",
- "_resolved": "git://github.com/joyent/node-sdc-clients.git#29dea8eef141df8e9de3fd3b8857a5b43e23477f",
- "_from": "sdc-clients@git://github.com/joyent/node-sdc-clients.git#29dea8e"
+ }
}
View
8 src/img/node_modules/tabula/package.json
@@ -43,13 +43,7 @@
"url": "http://trentm.com"
}
],
- "readme": "A light `tabula(items, options)` function for printing a text table\nto stdout.\n\nWhy another one? I had one that worked for me and wanted to re-use it. Trawling\nthrough dozens of available ones on npm was a chore I haven't done. I'd welcome\na table-printing node.js bake off.\n\n\n# Install\n\n npm install tabula\n\n\n# Usage\n\n```javascript\nvar tabula = require('tabula');\n\nvar items = [\n {name: 'trent', age: 38, game: 'hockey'},\n {name: 'ewan', age: 4, game: 'chess'}\n];\n\ntabula(items);\n/* prints:\nNAME AGE GAME\ntrent 38 hockey\newan 4 chess\n*/\n\ntabula(items, {columns: ['name', 'age']});\n/* prints:\nNAME AGE\ntrent 38\newan 4\n*/\n\ntabula(items, {\n columns: ['name', 'age'],\n skipHeader: true\n});\n/* prints:\ntrent 38\newan 4\n*/\n\n// Sort by age. Attempts numeric sort on given fields.\n// Note: This actually sorts the given `items` array in-place.\ntabula(items, {\n columns: ['name', 'age'],\n sort: ['age']\n});\n/* prints:\nNAME AGE\newan 4\ntrent 38\n*/\n```\n\n\n# `tabula` CLI\n\nThere is also a `tabula` CLI that can be used for emitting a table\nfrom a stream of JSON objects (or a single JSON array). E.g.:\n\n $ echo '[{\"name\":\"trent\",\"age\":38}, {\"name\":\"ewan\",\"age\":4}]' | tabula\n NAME AGE\n trent 38\n ewan 4\n\n # column selection\n $ echo '[{\"name\":\"trent\",\"age\":38}, {\"name\":\"ewan\",\"age\":4}]' | tabula name\n NAME\n trent\n ewan\n\n # sorting\n $ echo '[{\"name\":\"trent\",\"age\":38}, {\"name\":\"ewan\",\"age\":4}]' | tabula -s age\n NAME AGE\n ewan 4\n trent 38\n\n\n\n# TODO\n\n- Describe the \"opinions\", features and limitations of this module.\n\n- `tabula` CLI for piping in a JSON array of objects, or stream of objects.\n - streaming\n - option for skipping non-JSON lines (e.g. for bunyan logs)\n - option for non-JSON input? e.g. space separated ('json -ga foo bar'\n output, output from other table-emitting things, perhaps then 2-space\n or more separated), naive-csv\n - separate tabula-cli module?\n - test cases\n\n- Merge this with [node-tab](https://github.com/davepacheco/node-tab) if\n reasonable. I have some PR work for it (that I haven't completed) to add some\n conveniences that `tabulate` provides. It is silly to have two table-printing\n libs in play.\n\n\n# License\n\nMIT. See LICENSE.txt.\n",
- "readmeFilename": "README.md",
"bugs": {
"url": "https://github.com/trentm/node-tabula/issues"
- },
- "_id": "tabula@1.4.1",
- "_shasum": "5ef595dab9c5021a2919cc69203ba5dd72318f2d",
- "_from": "tabula@1.4.1",
- "_resolved": "https://registry.npmjs.org/tabula/-/tabula-1.4.1.tgz"
+ }
}
View
8 src/img/node_modules/vasync/package.json
@@ -21,14 +21,8 @@
"node >=0.6.0"
],
"license": "MIT",
- "readme": "# vasync: observable asynchronous control flow\n\nThis module provides several functions for asynchronous control flow. There are\nmany modules that do this already (notably async.js). This one's claim to fame\nis improved debuggability.\n\n\n## Observability is important\n\nWorking with Node's asynchronous, callback-based model is much easier with a\nhandful of simple control-flow abstractions, like:\n\n* waterfalls and pipelines (which invoke a list of asynchronous callbacks\n sequentially)\n* parallel pipelines (which invoke a list of asynchronous callbacks in parallel\n and invoke a top-level callback when the last one completes).\n* queues\n* barriers\n\nBut these structures also introduce new types of programming errors: failing to\ninvoke the callback can cause the program to hang, and inadvertently invoking it\ntwice can cause all kinds of mayhem that's very difficult to debug.\n\nThe functions in this module keep track of what's going on so that you can\nfigure out what happened when your program goes wrong. They generally return an\nobject describing details of the current state. If your program goes wrong, you\nhave several ways of getting at this state:\n\n* On illumos-based systems, use MDB to [find the status object](http://dtrace.org/blogs/bmc/2012/05/05/debugging-node-js-memory-leaks/)\n and then [print it out](http://dtrace.org/blogs/dap/2012/01/13/playing-with-nodev8-postmortem-debugging/).\n* Provide an HTTP API (or AMQP, or whatever) that returns these pending status\n objects as JSON (see [kang](https://github.com/davepacheco/kang)).\n* Incorporate a REPL into your program and print out the status object.\n* Use the Node debugger to print out the status object.\n\n## Functions\n\n* [parallel](#parallel-invoke-n-functions-in-parallel): invoke N functions in\n parallel (and merge the results)\n* [forEachParallel](#foreachparallel-invoke-the-same-function-on-n-inputs-in-parallel):\n invoke the same function on N inputs in parallel\n* [pipeline](#pipeline-invoke-n-functions-in-series-and-stop-on-failure): invoke\n N functions in series (and stop on failure)\n* [forEachPipeline](#foreachpipeline-invoke-the-same-function-on-n-inputs-in-series-and-stop-on-failure):\n invoke the same function on N inputs in series (and stop on failure)\n* [waterfall](#waterfall-invoke-n-functions-in-series-stop-on-failure-and-propagate-results):\n like pipeline, but propagating results between stages\n* [barrier](#barrier-coordinate-multiple-concurrent-operations): coordinate\n multiple concurrent operations\n* [queue/queuev](#queuequeuev-fixed-size-worker-queue): fixed-size worker queue\n\n### parallel: invoke N functions in parallel\n\nSynopsis: `parallel(args, callback)`\n\nThis function takes a list of input functions (specified by the \"funcs\" property\nof \"args\") and runs them all. These input functions are expected to be\nasynchronous: they get a \"callback\" argument and should invoke it as\n`callback(err, result)`. The error and result will be saved and made available\nto the original caller when all of these functions complete.\n\nThis function returns the same \"result\" object it passes to the callback, and\nyou can use the fields in this object to debug or observe progress:\n\n* `operations`: array corresponding to the input functions, with\n * `func`: input function,\n * `status`: \"pending\", \"ok\", or \"fail\",\n * `err`: returned \"err\" value, if any, and\n * `result`: returned \"result\" value, if any\n* `successes`: \"result\" field for each of \"operations\" where\n \"status\" == \"ok\" (in no particular order)\n* `ndone`: number of input operations that have completed\n* `nerrors`: number of input operations that have failed\n\nThis status object lets you see in a debugger exactly which functions have\ncompleted, what they returned, and which ones are outstanding.\n\nAll errors are combined into a single \"err\" parameter to the final callback (see\nbelow).\n\nExample usage:\n\n```js\nconsole.log(mod_vasync.parallel({\n 'funcs': [\n function f1 (callback) { mod_dns.resolve('joyent.com', callback); },\n function f2 (callback) { mod_dns.resolve('github.com', callback); },\n function f3 (callback) { mod_dns.resolve('asdfaqsdfj.com', callback); }\n ]\n}, function (err, results) {\n console.log('error: %s', err.message);\n console.log('results: %s', mod_util.inspect(results, null, 3));\n}));\n```\n\nIn the first tick, this outputs:\n\n```js\nstatus: { operations:\n [ { func: [Function: f1], status: 'pending' },\n { func: [Function: f2], status: 'pending' },\n { func: [Function: f3], status: 'pending' } ],\n successes: [],\n ndone: 0,\n nerrors: 0 }\n```\n\nshowing that there are three operations pending and none has yet been started.\nWhen the program finishes, it outputs this error:\n\n error: first of 1 error: queryA ENOTFOUND\n\nwhich encapsulates all of the intermediate failures. This model allows you to\nwrite the final callback like you normally would:\n\n```js\nif (err)\n return (callback(err));\n```\n\nand still propagate useful information to callers that don't deal with multiple\nerrors (i.e. most callers).\n\nThe example also prints out the detailed final status, including all of the\nerrors and return values:\n\n```js\nresults: { operations:\n [ { func: [Function: f1],\n funcname: 'f1',\n status: 'ok',\n err: null,\n result: [ '165.225.132.33' ] },\n { func: [Function: f2],\n funcname: 'f2',\n status: 'ok',\n err: null,\n result: [ '207.97.227.239' ] },\n { func: [Function: f3],\n funcname: 'f3',\n status: 'fail',\n err: { [Error: queryA ENOTFOUND] code: 'ENOTFOUND',\n errno: 'ENOTFOUND', syscall: 'queryA' },\n result: undefined } ],\n successes: [ [ '165.225.132.33' ], [ '207.97.227.239' ] ],\n ndone: 3,\n nerrors: 1 }\n```\n\nYou can use this if you want to handle all of the errors individually or to get\nat all of the individual return values.\n\nNote that \"successes\" is provided as a convenience and the order of items in\nthat array may not correspond to the order of the inputs. To consume output in\nan ordered manner, you should iterate over \"operations\" and pick out the result\nfrom each item.\n\n\n### forEachParallel: invoke the same function on N inputs in parallel\n\nSynopsis: `forEachParallel(args, callback)`\n\nThis function is exactly like `parallel`, except that the input is specified as\na *single* function (\"func\") and a list of inputs (\"inputs\"). The function is\ninvoked on each input in parallel.\n\nThis example is exactly equivalent to the one above:\n\n```js\nconsole.log(mod_vasync.forEachParallel({\n 'func': mod_dns.resolve,\n 'inputs': [ 'joyent.com', 'github.com', 'asdfaqsdfj.com' ]\n}, function (err, results) {\n console.log('error: %s', err.message);\n console.log('results: %s', mod_util.inspect(results, null, 3));\n}));\n```\n\n### pipeline: invoke N functions in series (and stop on failure)\n\nSynopsis: `pipeline(args, callback)`\n\nThe named arguments (that go inside `args`) are:\n\n* `funcs`: input functions, to be invoked in series\n* `arg`: arbitrary argument that will be passed to each function\n\nThe functions are invoked in order as `func(arg, callback)`, where \"arg\" is the\nuser-supplied argument from \"args\" and \"callback\" should be invoked in the usual\nway. If any function emits an error, the whole pipeline stops.\n\nThe return value and the arguments to the final callback are exactly the same as\nfor `parallel`. The error object for the final callback is just the error\nreturned by whatever pipeline function failed (if any).\n\nThis example is similar to the one above, except that it runs the steps in\nsequence and stops early because `pipeline` stops on the first error:\n\n```js\nconsole.log(mod_vasync.pipeline({\n 'funcs': [\n function f1 (_, callback) { mod_fs.stat('/tmp', callback); },\n function f2 (_, callback) { mod_fs.stat('/noexist', callback); },\n function f3 (_, callback) { mod_fs.stat('/var', callback); }\n ]\n}, function (err, results) {\n console.log('error: %s', err.message);\n console.log('results: %s', mod_util.inspect(results, null, 3));\n}));\n```\n\nAs a result, the status after the first tick looks like this:\n\n```js\n{ operations:\n [ { func: [Function: f1], status: 'pending' },\n { func: [Function: f2], status: 'waiting' },\n { func: [Function: f3], status: 'waiting' } ],\n successes: [],\n ndone: 0,\n nerrors: 0 }\n```\n\nNote that the second and third stages are now \"waiting\", rather than \"pending\"\nin the `parallel` case. The error and complete result look just like the\nparallel case.\n\n\n### forEachPipeline: invoke the same function on N inputs in series (and stop on failure)\n\nSynopsis: `forEachPipeline(args, callback)`\n\nThis function is exactly like `pipeline`, except that the input is specified as\na *single* function (\"func\") and a list of inputs (\"inputs\"). The function is\ninvoked on each input in series.\n\nThis example is exactly equivalent to the one above:\n\n```js\nconsole.log(mod_vasync.forEachPipeline({\n 'func': mod_dns.resolve,\n 'inputs': [ 'joyent.com', 'github.com', 'asdfaqsdfj.com' ]\n}, function (err, results) {\n console.log('error: %s', err.message);\n console.log('results: %s', mod_util.inspect(results, null, 3));\n}));\n```\n\n### waterfall: invoke N functions in series, stop on failure, and propagate results\n\nSynopsis: `waterfall(funcs, callback)`\n\nThis function works like `pipeline` except for argument passing.\n\nEach function is passed any values emitted by the previous function (none for\nthe first function), followed by the callback to invoke upon completion. This\ncallback must be invoked exactly once, regardless of success or failure. As\nconventional in Node, the first argument to the callback indicates an error (if\nnon-null). Subsequent arguments are passed to the next function in the \"funcs\"\nchain.\n\nIf any function fails (i.e., calls its callback with an Error), then the\nremaining functions are not invoked and \"callback\" is invoked with the error.\n\nThe only difference between waterfall() and pipeline() are the arguments passed\nto each function in the chain. pipeline() always passes the same argument\nfollowed by the callback, while waterfall() passes whatever values were emitted\nby the previous function followed by the callback.\n\nHere's an example:\n\n```js\nmod_vasync.waterfall([\n function func1(callback) {\n \tsetImmediate(function () {\n\t\tcallback(null, 37);\n\t});\n },\n function func2(extra, callback) {\n\tconsole.log('func2 got \"%s\" from func1', extra);\n\tcallback();\n }\n], function () {\n\tconsole.log('done');\n});\n```\n\nThis prints:\n\n```\nfunc2 got \"37\" from func1\nbetter stop early\n```\n\n### barrier: coordinate multiple concurrent operations\n\nSynopsis: `barrier([args])`\n\nReturns a new barrier object. Like `parallel`, barriers are useful for\ncoordinating several concurrent operations, but instead of specifying a list of\nfunctions to invoke, you just say how many (and optionally which ones) are\noutstanding, and this object emits `'drain'` when they've all completed. This\nis syntactically lighter-weight, and more flexible.\n\n* Methods:\n\n * start(name): Indicates that the named operation began. The name must not\n match an operation which is already ongoing.\n * done(name): Indicates that the named operation ended.\n\n\n* Read-only public properties (for debugging):\n\n * pending: Set of pending operations. Keys are names passed to \"start\", and\n values are timestamps when the operation began.\n * recent: Array of recent completed operations. Each element is an object\n with a \"name\", \"start\", and \"done\" field. By default, 10 operations are\n remembered.\n\n\n* Options:\n\n * nrecent: number of recent operations to remember (for debugging)\n\nExample: printing sizes of files in a directory\n\n```js\nvar mod_fs = require('fs');\nvar mod_path = require('path');\nvar mod_vasync = require('../lib/vasync');\n\nvar barrier = mod_vasync.barrier();\n\nbarrier.on('drain', function () {\n console.log('all files checked');\n});\n\nbarrier.start('readdir');\n\nmod_fs.readdir(__dirname, function (err, files) {\n barrier.done('readdir');\n\n if (err)\n throw (err);\n\n files.forEach(function (file) {\n barrier.start('stat ' + file);\n\n var path = mod_path.join(__dirname, file);\n\n mod_fs.stat(path, function (err2, stat) {\n barrier.done('stat ' + file);\n console.log('%s: %d bytes', file, stat['size']);\n });\n });\n});\n```\n\nThis emits:\n\n barrier-readdir.js: 602 bytes\n foreach-parallel.js: 358 bytes\n barrier-basic.js: 552 bytes\n nofail.js: 384 bytes\n pipeline.js: 490 bytes\n parallel.js: 481 bytes\n queue-serializer.js: 441 bytes\n queue-stat.js: 529 bytes\n all files checked\n\n\n### queue/queuev: fixed-size worker queue\n\nSynopsis: `queue(worker, concurrency)`\n\nSynopsis: `queuev(args)`\n\nThis function returns an object that allows up to a fixed number of tasks to be\ndispatched at any given time. The interface is compatible with that provided\nby the \"async\" Node library, except that the returned object's fields represent\na public interface you can use to introspect what's going on.\n\n* Arguments\n\n * worker: a function invoked as `worker(task, callback)`, where `task` is a\n task dispatched to this queue and `callback` should be invoked when the\n task completes.\n * concurrency: a positive integer indicating the maximum number of tasks\n that may be dispatched at any time. With concurrency = 1, the queue\n serializes all operations.\n\n\n* Methods\n\n * push(task, [callback]): add a task (or array of tasks) to the queue, with\n an optional callback to be invoked when each task completes. If a list of\n tasks are added, the callback is invoked for each one.\n * length(): for compatibility with node-async.\n * close(): signal that no more tasks will be enqueued. Further attempts to\n enqueue tasks to this queue will throw. Once all pending and queued\n tasks are completed the object will emit the \"end\" event. The \"end\"\n event is the last event the queue will emit, and it will be emitted even\n if no tasks were ever enqueued.\n * kill(): clear enqueued tasks and implicitly close the queue. Several\n caveats apply when kill() is called:\n * The completion callback will _not_ be called for items purged from\n the queue.\n * The drain handler is cleared (for node-async compatibility)\n * Subsequent calls to kill() or close() are no-ops.\n * As with close(), it is not legal to call push() after kill().\n\n\n* Read-only public properties (for debugging):\n\n * concurrency: for compatibility with node-async\n * worker: worker function, as passed into \"queue\"/\"queuev\"\n * worker\\_name: worker function's \"name\" field\n * npending: the number of tasks currently being processed\n * pending: an object (*not* an array) describing the tasks currently being\n processed\n * queued: array of tasks currently queued for processing\n * closed: true when close() has been called on the queue\n * ended: true when all tasks have completed processing, and no more\n processing will occur\n * killed: true when kill() has been called on the queue\n\n\n* Hooks (for compatibility with node-async):\n\n * saturated\n * empty\n * drain\n\n* Events\n\n * 'end': see close()\n\nIf the tasks are themselves simple objects, then the entire queue may be\nserialized (as via JSON.stringify) for debugging and monitoring tools. Using\nthe above fields, you can see what this queue is doing (worker\\_name), which\ntasks are queued, which tasks are being processed, and so on.\n\n### Example 1: Stat several files\n\nHere's an example demonstrating the queue:\n\n```js\nvar mod_fs = require('fs');\nvar mod_vasync = require('../lib/vasync');\n\nvar queue;\n\nfunction doneOne()\n{\n console.log('task completed; queue state:\\n%s\\n',\n JSON.stringify(queue, null, 4));\n}\n\nqueue = mod_vasync.queue(mod_fs.stat, 2);\n\nconsole.log('initial queue state:\\n%s\\n', JSON.stringify(queue, null, 4));\n\nqueue.push('/tmp/file1', doneOne);\nqueue.push('/tmp/file2', doneOne);\nqueue.push('/tmp/file3', doneOne);\nqueue.push('/tmp/file4', doneOne);\n\nconsole.log('all tasks dispatched:\\n%s\\n', JSON.stringify(queue, null, 4));\n```\n\nThe initial queue state looks like this:\n\n```js\ninitial queue state:\n{\n \"nextid\": 0,\n \"worker_name\": \"anon\",\n \"npending\": 0,\n \"pending\": {},\n \"queued\": [],\n \"concurrency\": 2\n}\n```\nAfter four tasks have been pushed, we see that two of them have been dispatched\nand the remaining two are queued up:\n\n```js\nall tasks pushed:\n{\n \"nextid\": 4,\n \"worker_name\": \"anon\",\n \"npending\": 2,\n \"pending\": {\n \"1\": {\n \"id\": 1,\n \"task\": \"/tmp/file1\"\n },\n \"2\": {\n \"id\": 2,\n \"task\": \"/tmp/file2\"\n }\n },\n \"queued\": [\n {\n \"id\": 3,\n \"task\": \"/tmp/file3\"\n },\n {\n \"id\": 4,\n \"task\": \"/tmp/file4\"\n }\n ],\n \"concurrency\": 2\n}\n```\n\nAs they complete, we see tasks moving from \"queued\" to \"pending\", and completed\ntasks disappear:\n\n```js\ntask completed; queue state:\n{\n \"nextid\": 4,\n \"worker_name\": \"anon\",\n \"npending\": 1,\n \"pending\": {\n \"3\": {\n \"id\": 3,\n \"task\": \"/tmp/file3\"\n }\n },\n \"queued\": [\n {\n \"id\": 4,\n \"task\": \"/tmp/file4\"\n }\n ],\n \"concurrency\": 2\n}\n```\n\nWhen all tasks have completed, the queue state looks like it started:\n\n```js\ntask completed; queue state:\n{\n \"nextid\": 4,\n \"worker_name\": \"anon\",\n \"npending\": 0,\n \"pending\": {},\n \"queued\": [],\n \"concurrency\": 2\n}\n```\n\n\n### Example 2: A simple serializer\n\nYou can use a queue with concurrency 1 and where the tasks are themselves\nfunctions to ensure that an arbitrary asynchronous function never runs\nconcurrently with another one, no matter what each one does. Since the tasks\nare the actual functions to be invoked, the worker function just invokes each\none:\n\n```js\nvar mod_vasync = require('../lib/vasync');\n\nvar queue = mod_vasync.queue(\n function (task, callback) { task(callback); }, 1);\n\nqueue.push(function (callback) {\n console.log('first task begins');\n setTimeout(function () {\n console.log('first task ends');\n callback();\n }, 500);\n});\n\nqueue.push(function (callback) {\n console.log('second task begins');\n process.nextTick(function () {\n console.log('second task ends');\n callback();\n });\n});\n```\n\nThis example outputs:\n\n $ node examples/queue-serializer.js\n first task begins\n first task ends\n second task begins\n second task ends\n",
- "readmeFilename": "README.md",
"bugs": {
"url": "https://github.com/davepacheco/node-vasync/issues"
},
- "homepage": "https://github.com/davepacheco/node-vasync",
- "_id": "vasync@1.6.2",
- "_shasum": "568edcf40b2b5c35b1cc048cad085de4739703fb",
- "_from": "vasync@1.6.2",
- "_resolved": "https://registry.npmjs.org/vasync/-/vasync-1.6.2.tgz"
+ "homepage": "https://github.com/davepacheco/node-vasync"
}
View
8 src/img/node_modules/verror/package.json
@@ -17,14 +17,8 @@
"test": "make test"
},
"license": "MIT",
- "readme": "# verror: richer JavaScript errors\n\nThis module provides two classes:\n\n* VError, for combining errors while preserving each one's error message, and\n* WError, for wrapping errors.\n\nBoth support printf-style error messages using\n[extsprintf](https://github.com/davepacheco/node-extsprintf).\n\n## printf-style Error constructor\n\nAt the most basic level, VError is just like JavaScript's Error class, but with\nprintf-style arguments:\n\n```javascript\nvar VError = require('verror');\n\nvar filename = '/etc/passwd';\nvar err = new VError('missing file: \"%s\"', filename);\nconsole.log(err.message);\n```\n\nThis prints:\n\n missing file: \"/etc/passwd\"\n\n`err.stack` works the same as for built-in errors:\n\n```javascript\nconsole.log(err.stack);\n```\n\nThis prints:\n\n missing file: \"/etc/passwd\"\n at Object.<anonymous> (/Users/dap/node-verror/examples/varargs.js:4:11)\n at Module._compile (module.js:449:26)\n at Object.Module._extensions..js (module.js:467:10)\n at Module.load (module.js:356:32)\n at Function.Module._load (module.js:312:12)\n at Module.runMain (module.js:492:10)\n at process.startup.processNextTick.process._tickCallback (node.js:244:9)\n\n\n## Causes\n\nYou can also pass a `cause` argument, which is another Error. For example:\n\n```javascript\nvar fs = require('fs');\nvar VError = require('verror');\n\nvar filename = '/nonexistent';\nfs.stat(filename, function (err1) {\n\tvar err2 = new VError(err1, 'stat \"%s\" failed', filename);\n\tconsole.error(err2.message);\n});\n```\n\nThis prints out:\n\n stat \"/nonexistent\" failed: ENOENT, stat '/nonexistent'\n\nwhich resembles how Unix programs typically report errors:\n\n $ sort /nonexistent\n sort: open failed: /nonexistent: No such file or directory\n\nTo match the Unixy feel, just prepend the program's name to the VError's\n`message`.\n\nYou can also get the next-level Error using `err.cause()`:\n\n```javascript\nconsole.error(err2.cause().message);\n```\n\nprints:\n\n ENOENT, stat '/nonexistent'\n\nOf course, you can nest these as many times as you want:\n\n```javascript\nvar VError = require('verror');\nvar err1 = new Error('No such file or directory');\nvar err2 = new VError(err1, 'failed to stat \"%s\"', '/junk');\nvar err3 = new VError(err2, 'request failed');\nconsole.error(err3.message);\n```\n\nThis prints:\n\n request failed: failed to stat \"/junk\": No such file or directory\n\nThe idea is that each layer in the stack annotates the error with a description\nof what it was doing (with a printf-like format string) and the result is a\nmessage that explains what happened at every level.\n\n\n## WError: wrap layered errors\n\nSometimes you don't want an Error's \"message\" field to include the details of\nall of the low-level errors, but you still want to be able to get at them\nprogrammatically. For example, in an HTTP server, you probably don't want to\nspew all of the low-level errors back to the client, but you do want to include\nthem in the audit log entry for the request. In that case, you can use a\nWError, which is created exactly like VError (and also supports both\nprintf-style arguments and an optional cause), but the resulting \"message\" only\ncontains the top-level error. It's also more verbose, including the class\nassociated with each error in the cause chain. Using the same example above,\nbut replacing `err3`'s VError with WError, we get this output:\n\n request failed\n\nThat's what we wanted -- just a high-level summary for the client. But we can\nget the object's toString() for the full details:\n\n WError: request failed; caused by WError: failed to stat \"/nonexistent\";\n caused by Error: No such file or directory\n\n# Contributing\n\nContributions welcome. Code should be \"make check\" clean. To run \"make check\",\nyou'll need these tools:\n\n* https://github.com/davepacheco/jsstyle\n* https://github.com/davepacheco/javascriptlint\n\nIf you're changing something non-trivial or user-facing, you may want to submit\nan issue first.\n",
- "readmeFilename": "README.md",
"bugs": {
"url": "https://github.com/davepacheco/node-verror/issues"
},
- "homepage": "https://github.com/davepacheco/node-verror",
- "_id": "verror@1.6.0",
- "_shasum": "7d13b27b1facc2e2da90405eb5ea6e5bdd252ea5",
- "_from": "verror@1.6.0",
- "_resolved": "https://registry.npmjs.org/verror/-/verror-1.6.0.tgz"
+ "homepage": "https://github.com/davepacheco/node-verror"
}
View
24 src/img/tools/update-node-modules.sh
@@ -238,3 +238,27 @@ patch -p0 <<'PATCHNODEUNIT'
// browser test reporter is not listed because it cannot be used
PATCHNODEUNIT
rm -rf node_modules/nodeunit/lib/reporters/index.js.orig
+
+
+# Normalize all package.json's. Dropping fields that seem to
+# change willy-nilly from npm server-side.
+for packageJson in $(find node_modules -name package.json); do
+ json -f $packageJson -Ie '
+ delete this.readme;
+ delete this.readmeFilename;
+ delete this.dist;
+ delete this.maintainers;
+ delete this.directories;
+ delete this.gitHead;
+ delete this._id;
+ delete this._shasum;
+ delete this._resolved;
+ delete this._npmVersion;
+ delete this._npmUser;
+ delete this._from;
+ delete this._engineSupported;
+ delete this._nodeVersion;
+ delete this._defaultsLoaded;
+ delete this._from;
+ '
+done
Please sign in to comment.
Something went wrong with that request. Please try again.