{"name":"it-pipe","version":"3.0.1","description":"Utility to \"pipe\" async iterables together","author":{"name":"Alan Shaw"},"license":"Apache-2.0 OR MIT","homepage":"https://github.com/alanshaw/it-pipe#readme","repository":{"type":"git","url":"git+https://github.com/alanshaw/it-pipe.git"},"bugs":{"url":"https://github.com/alanshaw/it-pipe/issues"},"keywords":["async","await","iterable","iterator","pipe","pipeline","pull","pump","stream"],"engines":{"node":">=16.0.0","npm":">=7.0.0"},"type":"module","types":"./dist/src/index.d.ts","exports":{".":{"types":"./dist/src/index.d.ts","import":"./dist/src/index.js"}},"eslintConfig":{"extends":"ipfs","parserOptions":{"sourceType":"module"}},"release":{"branches":["master"],"plugins":[["@semantic-release/commit-analyzer",{"preset":"conventionalcommits","releaseRules":[{"breaking":true,"release":"major"},{"revert":true,"release":"patch"},{"type":"feat","release":"minor"},{"type":"fix","release":"patch"},{"type":"docs","release":"patch"},{"type":"test","release":"patch"},{"type":"deps","release":"patch"},{"scope":"no-release","release":false}]}],["@semantic-release/release-notes-generator",{"preset":"conventionalcommits","presetConfig":{"types":[{"type":"feat","section":"Features"},{"type":"fix","section":"Bug Fixes"},{"type":"chore","section":"Trivial Changes"},{"type":"docs","section":"Documentation"},{"type":"deps","section":"Dependencies"},{"type":"test","section":"Tests"}]}}],"@semantic-release/changelog","@semantic-release/npm","@semantic-release/github","@semantic-release/git"]},"scripts":{"clean":"aegir clean","lint":"aegir lint","dep-check":"aegir dep-check","build":"aegir build","test":"aegir test","test:chrome":"aegir test -t browser --cov","test:chrome-webworker":"aegir test -t webworker","test:firefox":"aegir test -t browser -- --browser firefox","test:firefox-webworker":"aegir test -t webworker -- --browser firefox","test:node":"aegir test -t node --cov","test:electron-main":"aegir test -t electron-main","release":"aegir release","docs":"aegir docs"},"dependencies":{"it-merge":"^3.0.0","it-pushable":"^3.1.2","it-stream-types":"^2.0.1"},"devDependencies":{"aegir":"^38.1.8","delay":"^5.0.0","it-all":"^3.0.1","it-drain":"^3.0.1","it-map":"^3.0.2","p-defer":"^4.0.0","streaming-iterables":"^7.0.4"},"gitHead":"5d7eb2697a32d738bd9e6d0df6934e2883468feb","_id":"it-pipe@3.0.1","_nodeVersion":"18.15.0","_npmVersion":"8.19.4","dist":{"integrity":"sha512-sIoNrQl1qSRg2seYSBH/3QxWhJFn9PKYvOf/bHdtCBF0bnghey44VyASsWzn5dAx0DCDDABq1hZIuzKmtBZmKA==","shasum":"b25720df82f4c558a8532602b5fbc37bbe4e7ba5","tarball":"http://registry-npm.ywwl.com/it-pipe/download/it-pipe-3.0.1.tgz","fileCount":10,"unpackedSize":38948,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDQ8IteNvwkedm4wmUb+p/1aVUXFfRo3p9x3gmAG9B3NAiA4e/VLfB6stYanooBFi97FXc9sKZkM7tg+qX26nMejJQ=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkLAX8ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqLpg//fEz36pqplL3DnBKCVUE0mY2Ci/lbHcBWVAkSEh7LjrWEO7H/\r\ntfH6Ya/rTb8b9T03SjUCIC+cIyH9iyQl9wzGf0MjY9K2/CrudLRmUcD1Hru/\r\nyrHYFX+u1fKU/jALhjID0n5n4sUsa4QuS0JESoda/aCzZSe2wd+MCWpI7hPF\r\n/51oxqa3+77eYZAtFK+wFuS18KF4sXEnt1LiXFMvoWMVZE8FcmacPlfInWPR\r\nA3DRcckJ4V4dWe2MvQ8Gw9Odcifel/8Y4pz6d9gmPF0zyxh2rTV+FJRxaODq\r\n8FEHQVTyARDjHPTIKq9HYnta+9fPBEYpLME5Dk/j0vInnEr2MIm5V2IlpTxh\r\nGol56mhaCEoEM9g73h6tRe8KlDu6f4cP2czD2b671n/VZNKz3hqFjHgVVLkJ\r\nd163NyWO0suCOnGFv7uMqFXnXn3Jkn9g4KmHZzQqAs4ew573JxjzWTJtipTT\r\nqcPxF74/221S2s7qWiZRyz7CfF3QgMRYyhFwICBdBUWIBmEQPCBs+Smwgtyn\r\nzAzC+wgEmllvRFvKXcOeNh6K2wKaQTb41B7gYlnHO0Zb6OfzdxyWZ1h9cQxm\r\ngBhM5goiLkWR0x+qknvNeJSyV+vwlI/4g1s2jows+XiYSd4VTePxb6AFIWHJ\r\n7RuhYe+gqpY17TrwLc+UcyNddKiPjxhYyOo=\r\n=2YIc\r\n-----END PGP SIGNATURE-----\r\n","size":8091,"noattachment":false,"key":"/it-pipe/-/it-pipe-3.0.1.tgz"},"_npmUser":{"name":"alanshaw","email":"alan138@gmail.com"},"directories":{},"maintainers":[{"name":"achingbrain","email":"alex@achingbrain.net"},{"name":"alanshaw","email":"alan138@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/it-pipe_3.0.1_1680606716069_0.802136054652709"},"_hasShrinkwrap":false,"readme":"# it-pipe <!-- omit in toc -->\n\n[![codecov](https://img.shields.io/codecov/c/github/alanshaw/it-pipe.svg?style=flat-square)](https://codecov.io/gh/alanshaw/it-pipe)\n[![CI](https://img.shields.io/github/actions/workflow/status/alanshaw/it-pipe/js-test-and-release.yml?branch=master\\&style=flat-square)](https://github.com/alanshaw/it-pipe/actions/workflows/js-test-and-release.yml?query=branch%3Amaster)\n\n> Utility to \"pipe\" async iterables together\n\n## Table of contents <!-- omit in toc -->\n\n- [Install](#install)\n  - [Browser `<script>` tag](#browser-script-tag)\n- [Usage](#usage)\n- [API](#api)\n  - [`pipe(firstFn, ...fns)`](#pipefirstfn-fns)\n- [API Docs](#api-docs)\n- [License](#license)\n- [Contribution](#contribution)\n\n## Install\n\n```console\n$ npm i it-pipe\n```\n\n### Browser `<script>` tag\n\nLoading this module through a script tag will make it's exports available as `ItPipe` in the global namespace.\n\n```html\n<script src=\"https://unpkg.com/it-pipe/dist/index.min.js\"></script>\n```\n\nBased on this definition of streaming iterables <https://gist.github.com/alanshaw/591dc7dd54e4f99338a347ef568d6ee9>.\n\nAlmost identical to the [`pipeline`](https://github.com/bustle/streaming-iterables#pipeline) function from the [`streaming-iterables`](https://www.npmjs.com/package/streaming-iterables) module except that it supports duplex streams *and* will automatically wrap a \"source\" as the first param in a function.\n\n## Usage\n\n```js\nimport { pipe } from 'it-pipe'\n\nconst result = await pipe(\n  // A source is just an iterable, this is shorthand for () => [1, 2, 3]\n  [1, 2, 3],\n  // A transform takes a source, and returns a source.\n  // This transform doubles each value asynchronously.\n  function transform (source) {\n    return (async function * () { // A generator is async iterable\n      for await (const val of source) yield val * 2\n    })()\n  },\n  // A sink, it takes a source and consumes it, optionally returning a value.\n  // This sink buffers up all the values from the source and returns them.\n  async function collect (source) {\n    const vals = []\n    for await (const val of source) {\n      vals.push(val)\n    }\n    return vals\n  }\n)\n\nconsole.log(result) // 2,4,6\n```\n\n## API\n\n### `pipe(firstFn, ...fns)`\n\nCalls `firstFn` and then every function in `fns` with the result of the previous function. The final return is the result of the last function in `fns`.\n\nNote:\n\n- `firstFn` may be a `Function` or an `Iterable`\n- `firstFn` or any of `fns` may be a [duplex object](https://gist.github.com/alanshaw/591dc7dd54e4f99338a347ef568d6ee9#duplex-it) (an object with a `sink` and `source`).\n\n## API Docs\n\n- <https://alanshaw.github.io/it-pipe>\n\n## License\n\nLicensed under either of\n\n- Apache 2.0, ([LICENSE-APACHE](LICENSE-APACHE) / <http://www.apache.org/licenses/LICENSE-2.0>)\n- MIT ([LICENSE-MIT](LICENSE-MIT) / <http://opensource.org/licenses/MIT>)\n\n## Contribution\n\nUnless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.\n","publish_time":1680606716264,"_cnpm_publish_time":1680606716264,"dist-tags":{"latest":"3.0.1"}}