{"name":"streamtest","version":"3.0.0","keywords":["test","streams","stream1","stream2"],"author":{"url":"https://insertafter.com/en/index.html","name":"Nicolas Froidure","email":"nicolas.froidure@insertafter.com"},"license":"MIT","_id":"streamtest@3.0.0","contributors":[],"homepage":"https://github.com/nfroidure/streamtest","bugs":{"url":"https://github.com/nfroidure/streamtest/issues"},"dist":{"shasum":"b9d7fb7c2f7befcc2bb347018cd04ad6366ed0da","tarball":"http://registry-npm.ywwl.com/streamtest/download/streamtest-3.0.0.tgz","fileCount":12,"integrity":"sha512-9L31lkT5W8A3ScUfWabVHWU/lH63dKzZYFvRDuvmtUzU2Z+FP9fFKiY86vv5ecVa4dPGFl7Fmjd6AUIu6a8nEw==","signatures":[{"sig":"MEQCICMFK8xSzJ/vgZPSbINBekm7O4KpDqTvHSsv9wr0jBfOAiBW4LlfOKgya3746lMmA3hZA7MJfNK1OPztskjk5o2JnA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":43712,"size":8791,"noattachment":false,"key":"/streamtest/-/streamtest-3.0.0.tgz"},"jest":{"roots":["<rootDir>/src"],"transform":{"^.+\\.tsx?$":["@swc/jest",{}]},"prettierPath":null,"testEnvironment":"node","moduleNameMapper":{"(.+)\\.js":"$1"},"coverageReporters":["lcov"],"extensionsToTreatAsEsm":[".ts"],"testPathIgnorePatterns":["/node_modules/"]},"main":"dist/index.js","type":"module","types":"dist/index.d.ts","config":{"commitizen":{"path":"./node_modules/cz-conventional-changelog"}},"engines":{"node":">=20.11.1"},"gitHead":"f71f0b2d084e2659338bb55b0ba0d0f559990aa4","metapak":{"data":{"files":"'src/**/*.ts'","ignore":["dist"],"distFiles":"'dist/**/*.js'","testsFiles":"'src/**/*.tests.ts'","bundleFiles":["dist","src"]},"configs":["main","readme","tsesm","jest","jsdocs","eslint","ghactions","codeclimate"]},"scripts":{"cz":"env NODE_ENV=${NODE_ENV:-cli} git cz","cli":"env NODE_ENV=${NODE_ENV:-cli}","doc":"echo \"# API\" > API.md; jsdoc2md 'dist/**/*.js' >> API.md && git add API.md","jest":"NODE_OPTIONS=--experimental-vm-modules NODE_ENV=test jest","lint":"eslint 'src/**/*.ts'","test":"npm run jest","build":"rimraf 'dist' && tsc --outDir dist","cover":"npm run jest -- --coverage","precz":"npm t && npm run lint && npm run build && npm run doc && npm run metapak -- -s","format":"npm run prettier","metapak":"metapak","rebuild":"swc ./src -s -d dist -C jsc.target=es2022","version":"npm run changelog","prettier":"prettier --write 'src/**/*.ts'","changelog":"conventional-changelog -p angular -i CHANGELOG.md -s && git add CHANGELOG.md","preversion":"npm t && npm run lint && npm run build && npm run doc && npm run metapak -- -s","type-check":"tsc --pretty --noEmit"},"_npmUser":{"name":"nfroidure","email":"nicolas.froidure@insertafter.com"},"prettier":{"semi":true,"proseWrap":"always","printWidth":80,"singleQuote":true,"trailingComma":"all"},"overrides":{"eslint":"^9.7.0"},"repository":{"url":"git+ssh://git@github.com/nfroidure/streamtest.git","type":"git"},"_npmVersion":"10.7.0","description":"Streams test library","directories":{},"greenkeeper":{"ignore":["commitizen","cz-conventional-changelog","conventional-changelog-cli","typescript","rimraf","@swc/cli","@swc/core","@swc/helpers","jest","@swc/jest","jsdoc-to-markdown","eslint","prettier","eslint-config-prettier","eslint-plugin-prettier","typescript-eslint"]},"_nodeVersion":"20.14.0","_hasShrinkwrap":false,"devDependencies":{"jest":"^29.7.0","eslint":"^9.7.0","rimraf":"^6.0.1","metapak":"6.0.1","@swc/cli":"^0.4.0","prettier":"^3.3.3","@swc/core":"^1.6.13","@swc/jest":"^0.2.36","@eslint/js":"^9.7.0","commitizen":"^4.3.0","typescript":"^5.5.3","@swc/helpers":"^0.5.12","jsdoc-to-markdown":"^8.0.0","metapak-nfroidure":"18.2.0","typescript-eslint":"^7.16.0","eslint-plugin-jest":"^28.6.0","eslint-config-prettier":"^9.1.0","eslint-plugin-prettier":"^5.1.3","cz-conventional-changelog":"^3.3.0","conventional-changelog-cli":"^5.0.0"},"_npmOperationalInternal":{"tmp":"tmp/streamtest_3.0.0_1721143974726_0.11103176451844443","host":"s3://npm-registry-packages"},"readme":"[//]: # ( )\n[//]: # (This file is automatically generated by a `metapak`)\n[//]: # (module. Do not change it  except between the)\n[//]: # (`content:start/end` flags, your changes would)\n[//]: # (be overridden.)\n[//]: # ( )\n# streamtest\n> Streams test library\n\n[![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/nfroidure/streamtest/blob/main/LICENSE)\n\n\n[//]: # (::contents:start)\n\n`streamtest` is a set of utils to test your stream based modules simply.\n\nIn fact, this [repository's tests](https://github.com/nfroidure/streamtest/blob/master/src/index.test.js)\n is a perfect example of its own usage ;).\n\n## Installation\n\nFirst install `streamtest` in your project:\n```sh\nnpm install --save-dev streamtest\n```\n\n## Getting started\n\nThen, use it:\n\n```js\nimport StreamTest from 'streamtest';\n\ndescribe('My Stream Lib', () => {\n\n  // here goes your code\n  it('should work', async (done) => {\n    const [outputStream, resultPromise] = StreamTest.toText();\n\n    StreamTest.fromChunks(['a ', 'chunk', 'and', 'another'])\n      .pipe(myTestedStream)\n      .pipe(outputStream);\n\n    assert.equal(await resultPromise, 'the text as i should be')\n  });\n\n});\n```\n\n## Contribute\n\nFeel free to submit us your improvements. To do so, you must accept to publish\n your code under the MIT license.\n\nTo start contributing, first run the following to setup the development\n environment:\n```sh\ngit clone git@github.com:nfroidure/streamtest.git\ncd streamtest\nnpm install\n```\n\nThen, run the tests:\n```sh\nnpm test\n```\n\n[//]: # (::contents:end)\n\n# API\n<a name=\"StreamTest\"></a>\n\n## StreamTest : <code>object</code>\n**Kind**: global namespace  \n\n* [StreamTest](#StreamTest) : <code>object</code>\n    * [.fromObjects(objects, timeout)](#StreamTest.fromObjects) ⇒\n    * [.fromErroredObjects(err, objects, timeout)](#StreamTest.fromErroredObjects) ⇒\n    * [.fromChunks(chunks, timeout)](#StreamTest.fromChunks) ⇒\n    * [.fromErroredChunks(err, objects, timeout)](#StreamTest.fromErroredChunks) ⇒\n    * [.toObjects()](#StreamTest.toObjects) ⇒\n    * [.toChunks()](#StreamTest.toChunks) ⇒\n    * [.toText()](#StreamTest.toText) ⇒\n\n<a name=\"StreamTest.fromObjects\"></a>\n\n### StreamTest.fromObjects(objects, timeout) ⇒\nCreate a readable stream streaming `objects` each\n `timeout` milliseconds and then end. Usefull for\n testing objectMode based streams.\n\n**Kind**: static method of [<code>StreamTest</code>](#StreamTest)  \n**Returns**: Readable  \n\n| Param | Description |\n| --- | --- |\n| objects | Array<Object> |\n| timeout | number |\n\n<a name=\"StreamTest.fromErroredObjects\"></a>\n\n### StreamTest.fromErroredObjects(err, objects, timeout) ⇒\nCreate a readable stream streaming `objects` each\n `timeout` milliseconds, emit the `err` error and\n then end. Usefull for testing `objectMode` based\n streams.\n\n**Kind**: static method of [<code>StreamTest</code>](#StreamTest)  \n**Returns**: Readable  \n\n| Param | Description |\n| --- | --- |\n| err | Error |\n| objects | Object[] |\n| timeout | number |\n\n<a name=\"StreamTest.fromChunks\"></a>\n\n### StreamTest.fromChunks(chunks, timeout) ⇒\nCreate a readable stream streaming `chunks` each\n `timeout` milliseconds and then end. Usefull for\n testing buffer based streams.\n\n**Kind**: static method of [<code>StreamTest</code>](#StreamTest)  \n**Returns**: Readable  \n\n| Param | Description |\n| --- | --- |\n| chunks | Buffer[] |\n| timeout | number |\n\n<a name=\"StreamTest.fromErroredChunks\"></a>\n\n### StreamTest.fromErroredChunks(err, objects, timeout) ⇒\nCreate a readable stream streaming `chunks` each\n `timeout` milliseconds, emit the `err` error and\n then end. Usefull for testing buffer based streams.\n\n**Kind**: static method of [<code>StreamTest</code>](#StreamTest)  \n**Returns**: Readable  \n\n| Param | Description |\n| --- | --- |\n| err | Error |\n| objects | Object[] |\n| timeout | number |\n\n<a name=\"StreamTest.toObjects\"></a>\n\n### StreamTest.toObjects() ⇒\nCreate a writable stream collecting written `objects`\n and a promise that resolves when it finishes with\n the objects collected.\n\n**Kind**: static method of [<code>StreamTest</code>](#StreamTest)  \n**Returns**: [Writable, Promise<Object>]  \n<a name=\"StreamTest.toChunks\"></a>\n\n### StreamTest.toChunks() ⇒\nCreate a writable stream collecting written `chunks`\n and a promise that resolves when it finishes with\n the chunks collected.\n\n**Kind**: static method of [<code>StreamTest</code>](#StreamTest)  \n**Returns**: [Writable, Promise<Buffer[]>]  \n<a name=\"StreamTest.toText\"></a>\n\n### StreamTest.toText() ⇒\nCreate a writable stream collecting written text\n and a promise that resolves when it finishes with\n the whole text content.\n\n**Kind**: static method of [<code>StreamTest</code>](#StreamTest)  \n**Returns**: [Writable, Promise<string>]  \n\n# Authors\n- [Nicolas Froidure](https://insertafter.com/en/index.html)\n\n# License\n[MIT](https://github.com/nfroidure/streamtest/blob/main/LICENSE)\n","publish_time":1721143974886,"maintainers":[{"name":"nfroidure","email":"nicolas.froidure@insertafter.com"},{"name":"marcus.bitzl","email":"marcus@bitzl.com"}],"_cnpm_publish_time":1721143974886,"dist-tags":{"latest":"4.0.0"}}