{"_id":"fast-iterator","_rev":"5-46e877369674f077acbeef13ba4d6f5d","name":"fast-iterator","description":"Fast execution of an array of functions with the same value as input that can be altered.","dist-tags":{"latest":"0.3.0"},"versions":{"0.1.0":{"name":"fast-iterator","version":"0.1.0","description":"Fast execution of an array of functions with the same value as input that can be altered.","main":"index.js","scripts":{"test":"standard && tap test.js"},"repository":{"type":"git","url":"git+https://github.com/delvedor/fast-iterator.git"},"keywords":["speed","value","update","series","each","iterator"],"author":{"name":"Tomas Della Vedova - @delvedor","url":"http://delved.org"},"license":"MIT","bugs":{"url":"https://github.com/delvedor/fast-iterator/issues"},"homepage":"https://github.com/delvedor/fast-iterator#readme","devDependencies":{"standard":"^10.0.3","tap":"^10.7.3"},"dependencies":{"reusify":"^1.0.3"},"gitHead":"2bc6a6ebe73fe092571ea704f45d3bee1dee97cb","_id":"fast-iterator@0.1.0","_npmVersion":"5.5.1","_nodeVersion":"8.9.0","_npmUser":{"name":"delvedor","email":"tommydelved@gmail.com"},"dist":{"integrity":"sha512-i4KXoQdyw1AM6pO1O6W6w9tW3+dGNc90Xj/zK0L/whjxN/pNjYaoI+79p5ajNdi04a5pnp0wa+r0MhlpXzszVw==","shasum":"1ce48c2b11dff81f8afd526cdd23c6ed57d25dbf","tarball":"https://registry.npmjs.org/fast-iterator/-/fast-iterator-0.1.0.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCIRn9gtwIu+sYmcNCo7rWksT+Onhg3eJ5cV95YP3PAGAIhAM0QWUT66167Fm+acYjFJndb3Q1+lBqWIbyQB0o2drHY"}]},"maintainers":[{"name":"delvedor","email":"tommydelved@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fast-iterator-0.1.0.tgz_1510776216222_0.864478710340336"}},"0.2.0":{"name":"fast-iterator","version":"0.2.0","description":"Fast execution of an array of functions with the same value as input that can be altered.","main":"index.js","scripts":{"test":"standard && tap test.js"},"repository":{"type":"git","url":"git+https://github.com/delvedor/fast-iterator.git"},"keywords":["speed","value","update","series","each","iterator"],"author":{"name":"Tomas Della Vedova - @delvedor","url":"http://delved.org"},"license":"MIT","bugs":{"url":"https://github.com/delvedor/fast-iterator/issues"},"homepage":"https://github.com/delvedor/fast-iterator#readme","devDependencies":{"standard":"^10.0.3","tap":"^10.7.3"},"dependencies":{"reusify":"^1.0.3"},"gitHead":"fc9b1f8964b4f5a203ba748c7c0eb6f14f33d0b7","_id":"fast-iterator@0.2.0","_npmVersion":"5.5.1","_nodeVersion":"8.9.0","_npmUser":{"name":"delvedor","email":"tommydelved@gmail.com"},"dist":{"integrity":"sha512-hHN4XfUAryg+E9Bwgp0CFZI6p9r1JbEJ9Qmk/FhF9MEsskiD4fFmltwpidnTOkSNBO5fh5aysk4u8wfOFHFQaQ==","shasum":"f506c5163c91bbcc3cce97c823f3f9577eb43036","tarball":"https://registry.npmjs.org/fast-iterator/-/fast-iterator-0.2.0.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCHpkQh3GJsRRGueJd5sSnFEYOATJbLpg+dq0ejGxMR9gIhAO/5bYkrOnywi4HEllOwKCPDLfZ4hiTF0+pboxY0S/Xv"}]},"maintainers":[{"name":"delvedor","email":"tommydelved@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fast-iterator-0.2.0.tgz_1510826000533_0.900033360812813"}},"0.2.1":{"name":"fast-iterator","version":"0.2.1","description":"Fast execution of an array of functions with the same value as input that can be altered.","main":"index.js","scripts":{"test":"standard && tap test.js"},"repository":{"type":"git","url":"git+https://github.com/delvedor/fast-iterator.git"},"keywords":["speed","value","update","series","each","iterator"],"author":{"name":"Tomas Della Vedova - @delvedor","url":"http://delved.org"},"license":"MIT","bugs":{"url":"https://github.com/delvedor/fast-iterator/issues"},"homepage":"https://github.com/delvedor/fast-iterator#readme","devDependencies":{"standard":"^10.0.3","tap":"^10.7.3"},"dependencies":{"reusify":"^1.0.3"},"gitHead":"cb1e1cbd8d184571d57dcc5a5a7f232716d968a9","_id":"fast-iterator@0.2.1","_npmVersion":"5.5.1","_nodeVersion":"8.9.0","_npmUser":{"name":"delvedor","email":"tommydelved@gmail.com"},"dist":{"integrity":"sha512-APmMxsY5Lo7LHmuULf9xbnKbwFkAQPUOo2+eo9NnnmR3PnLqe4IIMlHevqwl6PdahTE/Uv16U2s5ffsC7Ys3jA==","shasum":"f56f2de5a91fd5fc9a469a77ccfa35924e913f0a","tarball":"https://registry.npmjs.org/fast-iterator/-/fast-iterator-0.2.1.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDSYGKbGy8VUocThLa5RqCLYw01kpjzf1ljnWWg83EcFQIgB6jsUXwlCps9H0unjniSkuK2F9MvvTZN82YtXIslEUw="}]},"maintainers":[{"name":"delvedor","email":"tommydelved@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fast-iterator-0.2.1.tgz_1510827905332_0.4627152751199901"}},"0.2.2":{"name":"fast-iterator","version":"0.2.2","description":"Fast execution of an array of functions with the same value as input that can be altered.","main":"index.js","scripts":{"test":"standard && tap test.js"},"repository":{"type":"git","url":"git+https://github.com/delvedor/fast-iterator.git"},"keywords":["speed","value","update","series","each","iterator"],"author":{"name":"Tomas Della Vedova - @delvedor","url":"http://delved.org"},"license":"MIT","bugs":{"url":"https://github.com/delvedor/fast-iterator/issues"},"homepage":"https://github.com/delvedor/fast-iterator#readme","devDependencies":{"standard":"^10.0.3","tap":"^10.7.3"},"dependencies":{"reusify":"^1.0.3"},"gitHead":"8b12a71dd038ff39df65df4d7101aa11386909a6","_id":"fast-iterator@0.2.2","_npmVersion":"5.5.1","_nodeVersion":"8.9.0","_npmUser":{"name":"delvedor","email":"tommydelved@gmail.com"},"dist":{"integrity":"sha512-tvdb3Xb6SdbKxjYdnIgmIdumC+MZ1DE0I4tRlWRyr9flr173borgU6pb6jRdlRoXkMAXUjFqMAEeWkG6j0yG7g==","shasum":"321df4cbbc6f4bb4d4de0631e08f8e5d9c386ad5","tarball":"https://registry.npmjs.org/fast-iterator/-/fast-iterator-0.2.2.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDHp0qs/eDfLSgs6cCmqXxPlDxMm31RsWKLoxABUcRMZAIgBvsKYH1msbGm2pQNblf9JZPnM4clXDBGQADX7tx55/Q="}]},"maintainers":[{"name":"delvedor","email":"tommydelved@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fast-iterator-0.2.2.tgz_1516309567662_0.7627387153916061"}},"0.3.0":{"name":"fast-iterator","version":"0.3.0","description":"Fast execution of an array of functions with the same value as input that can be altered.","main":"index.js","scripts":{"test":"standard && tap test.js"},"repository":{"type":"git","url":"git+https://github.com/delvedor/fast-iterator.git"},"keywords":["speed","value","update","series","each","iterator"],"author":{"name":"Tomas Della Vedova - @delvedor","url":"http://delved.org"},"license":"MIT","bugs":{"url":"https://github.com/delvedor/fast-iterator/issues"},"homepage":"https://github.com/delvedor/fast-iterator#readme","devDependencies":{"standard":"^10.0.3","tap":"^10.7.3"},"dependencies":{"reusify":"^1.0.3"},"gitHead":"6d065624f3867cbd32e0fe0add26f2f20e9cd580","_id":"fast-iterator@0.3.0","_npmVersion":"5.5.1","_nodeVersion":"8.9.0","_npmUser":{"name":"delvedor","email":"tommydelved@gmail.com"},"dist":{"integrity":"sha512-grxEHsZMtpKxAOFIFMF55P3ZjKXvkfslWhtLMTi3hDzJSvLR3hkuFC+VpiEV371xVTNd8U6SEKYWlRqWkix2iA==","shasum":"8601a33fcd6e87155f68e085a5be05d42780f09f","tarball":"https://registry.npmjs.org/fast-iterator/-/fast-iterator-0.3.0.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFFPJKLWl/P9DKVZRFJs/qbk555wEfbsgNCOEkT149enAiAKEub6Fqz8ClSWRS257oS+9sCJYwvGUunkNyZ0VI4McQ=="}]},"maintainers":[{"name":"delvedor","email":"tommydelved@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fast-iterator-0.3.0.tgz_1516464489559_0.5209432889241725"}}},"readme":"# fast-iterator\n\n[![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat)](http://standardjs.com/) [![Build Status](https://travis-ci.org/delvedor/fast-iterator.svg?branch=init)](https://travis-ci.org/delvedor/fast-iterator)\n\nFast execution of an array of functions with the same value as input that can be altered.\n\n<a name=\"install\"></a>\n## Install\n```\nnpm i fast-iterator --save\n```\n\n<a name=\"usage\"></a>\n## Usage\n```js\nconst fast = require('fast-iterator')\n\nfast(\n  [fn1, fn2, fn3], // the array of functions to execute\n  { context: true } // a custom context for every function\n)(\n  iterator.bind({ a: 'a', b: 'b' }), // an iterator function to pass custom parameters\n  { hello: 'world' }, // the value to update\n  done // the function to call once the work has been done\n)\n\nfunction fn1 (a, b, result, done) {\n  console.log(a, b, result, this)\n  done(null, { ciao: 'mondo' })\n}\n\nfunction fn2 (a, b, result, done) {\n  console.log(a, b, result, this)\n  done(null, { winter: 'is coming' })\n}\n\nasync function fn3 (a, b, result) {\n  console.log(a, b, result, this)\n  return { winter: 'has come' }\n}\n\nfunction iterator (fn, result, done) {\n  return fn(this.a, this.b, result, done)\n}\n\nfunction done (err, result) {\n  console.log(err || result, this)\n}\n```\n\nOutput:\n```\na b { hello: 'world' } { context: true }\na b { ciao: 'mondo' } { context: true }\na b { winter: 'is coming' } { context: true }\n{ winter: 'has come' } { context: true }\n```\n\nIf you need to release the internal Object holder for performances reasons, you can call the fourth parameter of the iterator: `release.`\n```js\nfunction iterator (fn, result, done, release) {\n  if (someCondition) return release()\n  return fn(this.a, this.b, result, done)\n}\n```\n\n<a name=\"acknowledgements\"></a>\n## Acknowledgements\n\nThis project is kindly sponsored by [LetzDoIt](http://www.letzdoitapp.com/).  \n\n<a name=\"license\"></a>\n## License\n\nLicensed under [MIT](./LICENSE).\n","maintainers":[{"name":"delvedor","email":"tommydelved@gmail.com"}],"time":{"modified":"2022-05-02T04:26:50.009Z","created":"2017-11-15T20:03:37.131Z","0.1.0":"2017-11-15T20:03:37.131Z","0.2.0":"2017-11-16T09:53:21.426Z","0.2.1":"2017-11-16T10:25:06.265Z","0.2.2":"2018-01-18T21:06:08.561Z","0.3.0":"2018-01-20T16:08:10.536Z"},"homepage":"https://github.com/delvedor/fast-iterator#readme","keywords":["speed","value","update","series","each","iterator"],"repository":{"type":"git","url":"git+https://github.com/delvedor/fast-iterator.git"},"author":{"name":"Tomas Della Vedova - @delvedor","url":"http://delved.org"},"bugs":{"url":"https://github.com/delvedor/fast-iterator/issues"},"license":"MIT","readmeFilename":"README.md"}