123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127 |
- {
- "_args": [
- [
- {
- "raw": "asynckit@^0.4.0",
- "scope": null,
- "escapedName": "asynckit",
- "name": "asynckit",
- "rawSpec": "^0.4.0",
- "spec": ">=0.4.0 <0.5.0",
- "type": "range"
- },
- "/mnt/Data/bach/Documents/ola/OLA#4/OLA#4DOC/sys/node_modules/form-data"
- ]
- ],
- "_from": "asynckit@>=0.4.0 <0.5.0",
- "_id": "asynckit@0.4.0",
- "_inCache": true,
- "_location": "/asynckit",
- "_nodeVersion": "0.12.11",
- "_npmOperationalInternal": {
- "host": "packages-16-east.internal.npmjs.com",
- "tmp": "tmp/asynckit-0.4.0.tgz_1465928940169_0.8008207362145185"
- },
- "_npmUser": {
- "name": "alexindigo",
- "email": "iam@alexindigo.com"
- },
- "_npmVersion": "2.15.6",
- "_phantomChildren": {},
- "_requested": {
- "raw": "asynckit@^0.4.0",
- "scope": null,
- "escapedName": "asynckit",
- "name": "asynckit",
- "rawSpec": "^0.4.0",
- "spec": ">=0.4.0 <0.5.0",
- "type": "range"
- },
- "_requiredBy": [
- "/form-data"
- ],
- "_resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz",
- "_shasum": "c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79",
- "_shrinkwrap": null,
- "_spec": "asynckit@^0.4.0",
- "_where": "/mnt/Data/bach/Documents/ola/OLA#4/OLA#4DOC/sys/node_modules/form-data",
- "author": {
- "name": "Alex Indigo",
- "email": "iam@alexindigo.com"
- },
- "bugs": {
- "url": "https://github.com/alexindigo/asynckit/issues"
- },
- "dependencies": {},
- "description": "Minimal async jobs utility library, with streams support",
- "devDependencies": {
- "browserify": "^13.0.0",
- "browserify-istanbul": "^2.0.0",
- "coveralls": "^2.11.9",
- "eslint": "^2.9.0",
- "istanbul": "^0.4.3",
- "obake": "^0.1.2",
- "phantomjs-prebuilt": "^2.1.7",
- "pre-commit": "^1.1.3",
- "reamde": "^1.1.0",
- "rimraf": "^2.5.2",
- "size-table": "^0.2.0",
- "tap-spec": "^4.1.1",
- "tape": "^4.5.1"
- },
- "directories": {},
- "dist": {
- "shasum": "c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79",
- "tarball": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz"
- },
- "gitHead": "583a75ed4fe41761b66416bb6e703ebb1f8963bf",
- "homepage": "https://github.com/alexindigo/asynckit#readme",
- "keywords": [
- "async",
- "jobs",
- "parallel",
- "serial",
- "iterator",
- "array",
- "object",
- "stream",
- "destroy",
- "terminate",
- "abort"
- ],
- "license": "MIT",
- "main": "index.js",
- "maintainers": [
- {
- "name": "alexindigo",
- "email": "iam@alexindigo.com"
- }
- ],
- "name": "asynckit",
- "optionalDependencies": {},
- "pre-commit": [
- "clean",
- "lint",
- "test",
- "browser",
- "report",
- "size"
- ],
- "readme": "# asynckit [![NPM Module](https://img.shields.io/npm/v/asynckit.svg?style=flat)](https://www.npmjs.com/package/asynckit)\n\nMinimal async jobs utility library, with streams support.\n\n[![PhantomJS Build](https://img.shields.io/travis/alexindigo/asynckit/v0.4.0.svg?label=browser&style=flat)](https://travis-ci.org/alexindigo/asynckit)\n[![Linux Build](https://img.shields.io/travis/alexindigo/asynckit/v0.4.0.svg?label=linux:0.12-6.x&style=flat)](https://travis-ci.org/alexindigo/asynckit)\n[![Windows Build](https://img.shields.io/appveyor/ci/alexindigo/asynckit/v0.4.0.svg?label=windows:0.12-6.x&style=flat)](https://ci.appveyor.com/project/alexindigo/asynckit)\n\n[![Coverage Status](https://img.shields.io/coveralls/alexindigo/asynckit/v0.4.0.svg?label=code+coverage&style=flat)](https://coveralls.io/github/alexindigo/asynckit?branch=master)\n[![Dependency Status](https://img.shields.io/david/alexindigo/asynckit/v0.4.0.svg?style=flat)](https://david-dm.org/alexindigo/asynckit)\n[![bitHound Overall Score](https://www.bithound.io/github/alexindigo/asynckit/badges/score.svg)](https://www.bithound.io/github/alexindigo/asynckit)\n\n<!-- [![Readme](https://img.shields.io/badge/readme-tested-brightgreen.svg?style=flat)](https://www.npmjs.com/package/reamde) -->\n\nAsyncKit provides harness for `parallel` and `serial` iterators over list of items represented by arrays or objects.\nOptionally it accepts abort function (should be synchronously return by iterator for each item), and terminates left over jobs upon an error event. For specific iteration order built-in (`ascending` and `descending`) and custom sort helpers also supported, via `asynckit.serialOrdered` method.\n\nIt ensures async operations to keep behavior more stable and prevent `Maximum call stack size exceeded` errors, from sync iterators.\n\n| compression | size |\n| :----------------- | -------: |\n| asynckit.js | 12.34 kB |\n| asynckit.min.js | 4.11 kB |\n| asynckit.min.js.gz | 1.47 kB |\n\n\n## Install\n\n```sh\n$ npm install --save asynckit\n```\n\n## Examples\n\n### Parallel Jobs\n\nRuns iterator over provided array in parallel. Stores output in the `result` array,\non the matching positions. In unlikely event of an error from one of the jobs,\nwill terminate rest of the active jobs (if abort function is provided)\nand return error along with salvaged data to the main callback function.\n\n#### Input Array\n\n```javascript\nvar parallel = require('asynckit').parallel\n , assert = require('assert')\n ;\n\nvar source = [ 1, 1, 4, 16, 64, 32, 8, 2 ]\n , expectedResult = [ 2, 2, 8, 32, 128, 64, 16, 4 ]\n , expectedTarget = [ 1, 1, 2, 4, 8, 16, 32, 64 ]\n , target = []\n ;\n\nparallel(source, asyncJob, function(err, result)\n{\n assert.deepEqual(result, expectedResult);\n assert.deepEqual(target, expectedTarget);\n});\n\n// async job accepts one element from the array\n// and a callback function\nfunction asyncJob(item, cb)\n{\n // different delays (in ms) per item\n var delay = item * 25;\n\n // pretend different jobs take different time to finish\n // and not in consequential order\n var timeoutId = setTimeout(function() {\n target.push(item);\n cb(null, item * 2);\n }, delay);\n\n // allow to cancel \"leftover\" jobs upon error\n // return function, invoking of which will abort this job\n return clearTimeout.bind(null, timeoutId);\n}\n```\n\nMore examples could be found in [test/test-parallel-array.js](test/test-parallel-array.js).\n\n#### Input Object\n\nAlso it supports named jobs, listed via object.\n\n```javascript\nvar parallel = require('asynckit/parallel')\n , assert = require('assert')\n ;\n\nvar source = { first: 1, one: 1, four: 4, sixteen: 16, sixtyFour: 64, thirtyTwo: 32, eight: 8, two: 2 }\n , expectedResult = { first: 2, one: 2, four: 8, sixteen: 32, sixtyFour: 128, thirtyTwo: 64, eight: 16, two: 4 }\n , expectedTarget = [ 1, 1, 2, 4, 8, 16, 32, 64 ]\n , expectedKeys = [ 'first', 'one', 'two', 'four', 'eight', 'sixteen', 'thirtyTwo', 'sixtyFour' ]\n , target = []\n , keys = []\n ;\n\nparallel(source, asyncJob, function(err, result)\n{\n assert.deepEqual(result, expectedResult);\n assert.deepEqual(target, expectedTarget);\n assert.deepEqual(keys, expectedKeys);\n});\n\n// supports full value, key, callback (shortcut) interface\nfunction asyncJob(item, key, cb)\n{\n // different delays (in ms) per item\n var delay = item * 25;\n\n // pretend different jobs take different time to finish\n // and not in consequential order\n var timeoutId = setTimeout(function() {\n keys.push(key);\n target.push(item);\n cb(null, item * 2);\n }, delay);\n\n // allow to cancel \"leftover\" jobs upon error\n // return function, invoking of which will abort this job\n return clearTimeout.bind(null, timeoutId);\n}\n```\n\nMore examples could be found in [test/test-parallel-object.js](test/test-parallel-object.js).\n\n### Serial Jobs\n\nRuns iterator over provided array sequentially. Stores output in the `result` array,\non the matching positions. In unlikely event of an error from one of the jobs,\nwill not proceed to the rest of the items in the list\nand return error along with salvaged data to the main callback function.\n\n#### Input Array\n\n```javascript\nvar serial = require('asynckit/serial')\n , assert = require('assert')\n ;\n\nvar source = [ 1, 1, 4, 16, 64, 32, 8, 2 ]\n , expectedResult = [ 2, 2, 8, 32, 128, 64, 16, 4 ]\n , expectedTarget = [ 0, 1, 2, 3, 4, 5, 6, 7 ]\n , target = []\n ;\n\nserial(source, asyncJob, function(err, result)\n{\n assert.deepEqual(result, expectedResult);\n assert.deepEqual(target, expectedTarget);\n});\n\n// extended interface (item, key, callback)\n// also supported for arrays\nfunction asyncJob(item, key, cb)\n{\n target.push(key);\n\n // it will be automatically made async\n // even it iterator \"returns\" in the same event loop\n cb(null, item * 2);\n}\n```\n\nMore examples could be found in [test/test-serial-array.js](test/test-serial-array.js).\n\n#### Input Object\n\nAlso it supports named jobs, listed via object.\n\n```javascript\nvar serial = require('asynckit').serial\n , assert = require('assert')\n ;\n\nvar source = [ 1, 1, 4, 16, 64, 32, 8, 2 ]\n , expectedResult = [ 2, 2, 8, 32, 128, 64, 16, 4 ]\n , expectedTarget = [ 0, 1, 2, 3, 4, 5, 6, 7 ]\n , target = []\n ;\n\nvar source = { first: 1, one: 1, four: 4, sixteen: 16, sixtyFour: 64, thirtyTwo: 32, eight: 8, two: 2 }\n , expectedResult = { first: 2, one: 2, four: 8, sixteen: 32, sixtyFour: 128, thirtyTwo: 64, eight: 16, two: 4 }\n , expectedTarget = [ 1, 1, 4, 16, 64, 32, 8, 2 ]\n , target = []\n ;\n\n\nserial(source, asyncJob, function(err, result)\n{\n assert.deepEqual(result, expectedResult);\n assert.deepEqual(target, expectedTarget);\n});\n\n// shortcut interface (item, callback)\n// works for object as well as for the arrays\nfunction asyncJob(item, cb)\n{\n target.push(item);\n\n // it will be automatically made async\n // even it iterator \"returns\" in the same event loop\n cb(null, item * 2);\n}\n```\n\nMore examples could be found in [test/test-serial-object.js](test/test-serial-object.js).\n\n_Note: Since _object_ is an _unordered_ collection of properties,\nit may produce unexpected results with sequential iterations.\nWhenever order of the jobs' execution is important please use `serialOrdered` method._\n\n### Ordered Serial Iterations\n\nTBD\n\nFor example [compare-property](compare-property) package.\n\n### Streaming interface\n\nTBD\n\n## Want to Know More?\n\nMore examples can be found in [test folder](test/).\n\nOr open an [issue](https://github.com/alexindigo/asynckit/issues) with questions and/or suggestions.\n\n## License\n\nAsyncKit is licensed under the MIT license.\n",
- "readmeFilename": "README.md",
- "repository": {
- "type": "git",
- "url": "git+https://github.com/alexindigo/asynckit.git"
- },
- "scripts": {
- "browser": "browserify -t browserify-istanbul test/lib/browserify_adjustment.js test/test-*.js | obake --coverage | tap-spec",
- "clean": "rimraf coverage",
- "debug": "tape test/test-*.js",
- "lint": "eslint *.js lib/*.js test/*.js",
- "report": "istanbul report",
- "size": "browserify index.js | size-table asynckit",
- "test": "istanbul cover --reporter=json tape -- 'test/test-*.js' | tap-spec",
- "win-test": "tape test/test-*.js"
- },
- "version": "0.4.0"
- }
|