{"metapak":{"configs":["main","readme","tsesm","jest","jsdocs","eslint","ghactions","codeclimate"],"data":{"files":"'src/**/*.ts'","testsFiles":"'src/**/*.tests.ts'","distFiles":"'dist/**/*.js'","ignore":["dist"],"bundleFiles":["dist","src"]}},"name":"streamtest","version":"3.0.1","description":"Streams test library","main":"dist/index.js","scripts":{"build":"rimraf 'dist' && tsc --outDir dist","changelog":"conventional-changelog -p angular -i CHANGELOG.md -s && git add CHANGELOG.md","cli":"env NODE_ENV=${NODE_ENV:-cli}","cover":"npm run jest -- --coverage","cz":"env NODE_ENV=${NODE_ENV:-cli} git cz","doc":"echo \"# API\" > API.md; jsdoc2md 'dist/**/*.js' >> API.md && git add API.md","format":"npm run prettier","jest":"NODE_OPTIONS=--experimental-vm-modules NODE_ENV=test jest","lint":"eslint 'src/**/*.ts'","metapak":"metapak","precz":"npm t && npm run lint && npm run build && npm run doc && npm run metapak -- -s","prettier":"prettier --write 'src/**/*.ts'","preversion":"npm t && npm run lint && npm run build && npm run doc && npm run metapak -- -s","rebuild":"swc ./src -s -d dist -C jsc.target=es2022","test":"npm run jest","type-check":"tsc --pretty --noEmit","version":"npm run changelog"},"repository":{"type":"git","url":"git+ssh://git@github.com/nfroidure/streamtest.git"},"keywords":["test","streams","stream1","stream2"],"author":{"name":"Nicolas Froidure","email":"nicolas.froidure@insertafter.com","url":"https://insertafter.com/en/index.html"},"license":"MIT","bugs":{"url":"https://github.com/nfroidure/streamtest/issues"},"homepage":"https://github.com/nfroidure/streamtest","devDependencies":{"@eslint/js":"^9.7.0","@swc/cli":"^0.4.0","@swc/core":"^1.6.13","@swc/helpers":"^0.5.12","@swc/jest":"^0.2.36","commitizen":"^4.3.0","conventional-changelog-cli":"^5.0.0","cz-conventional-changelog":"^3.3.0","eslint":"^9.7.0","eslint-config-prettier":"^9.1.0","eslint-plugin-jest":"^28.6.0","eslint-plugin-prettier":"^5.1.3","jest":"^29.7.0","jsdoc-to-markdown":"^8.0.0","metapak":"6.0.1","metapak-nfroidure":"18.2.0","prettier":"^3.3.3","rimraf":"^6.0.1","typescript":"^5.5.3","typescript-eslint":"^7.16.0"},"engines":{"node":">=20.11.1"},"config":{"commitizen":{"path":"./node_modules/cz-conventional-changelog"}},"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"]},"prettier":{"semi":true,"printWidth":80,"singleQuote":true,"trailingComma":"all","proseWrap":"always"},"contributors":[],"overrides":{"eslint":"^9.7.0"},"type":"module","types":"dist/index.d.ts","jest":{"coverageReporters":["lcov"],"testPathIgnorePatterns":["/node_modules/"],"roots":["<rootDir>/src"],"transform":{"^.+\\.tsx?$":["@swc/jest",{}]},"testEnvironment":"node","moduleNameMapper":{"(.+)\\.js":"$1"},"extensionsToTreatAsEsm":[".ts"],"prettierPath":null},"_id":"streamtest@3.0.1","gitHead":"d30ec6081ee2562f77b9504bd3aad57722d46d52","_nodeVersion":"20.14.0","_npmVersion":"10.7.0","dist":{"integrity":"sha512-LuZ5TnL3IX4pORrmfMVKtHXabqO+MYuxCcLXVJ3aPtTnobrixMBXyHpmtPmfNzKngEwwBfQXwWxWkvAZpI8fmw==","shasum":"5ed2a1217196deeb55d9a2fab028d0b9d4e0d320","tarball":"http://registry-npm.ywwl.com/streamtest/download/streamtest-3.0.1.tgz","fileCount":12,"unpackedSize":46216,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCP9pWicVFyyD/w63Tz3OF6WFHXSQaIaRhmwrSDdcIhnAIhAP3Q5zPzD5r+FWihvlQhyZJdFyvKPLehfoCR8VGHHcrT"}],"size":9304,"noattachment":false,"key":"/streamtest/-/streamtest-3.0.1.tgz"},"_npmUser":{"name":"nfroidure","email":"nicolas.froidure@insertafter.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/streamtest_3.0.1_1721248429376_0.8731256877037399"},"_hasShrinkwrap":false,"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":1721248429557,"maintainers":[{"name":"nfroidure","email":"nicolas.froidure@insertafter.com"},{"name":"marcus.bitzl","email":"marcus@bitzl.com"}],"_cnpm_publish_time":1721248429557,"dist-tags":{"latest":"4.0.0"}}