{"_id":"stream-spec","_rev":"32-82d90cd9890832936ccdb1f457c415a5","name":"stream-spec","description":"executable specification for Stream (to make testing streams easy)","dist-tags":{"latest":"0.3.6"},"versions":{"0.0.0":{"name":"stream-spec","version":"0.0.0","description":"executable specification for Stream (to make testing streams easy)","main":"index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"git://github.com/dominictarr/stream-spec.git"},"keywords":["stream","spec","streams","test"],"dependencies":{"macgyver":"~1.6.1"},"author":{"name":"Dominic Tarr"},"license":["MIT","Apache2"],"_id":"stream-spec@0.0.0","dist":{"shasum":"e9ce6eefcc423f893c28cb6e433a91d01cf4c228","tarball":"https://registry.npmjs.org/stream-spec/-/stream-spec-0.0.0.tgz","integrity":"sha512-a0rN5Xkcv05pm6+TfcNEEEAGe4Xe+97rqerZ30Ab6eDMWjXQng1q3jylX2t5flYMHazPSJ2kntj0Y3OhvnkqAA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD+hUo1xanfgciAfYQq+nYimME4hBDmfDFSEQvMfLSB0wIgbbqSNIaIRzl4v97BMgr7lt9h9eBBtcqED/wJIOBCpTc="}]},"maintainers":[{"name":"dominictarr","email":"dominic.tarr@gmail.com"}],"directories":{}},"0.1.0":{"name":"stream-spec","version":"0.1.0","description":"executable specification for Stream (to make testing streams easy)","main":"index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"git://github.com/dominictarr/stream-spec.git"},"keywords":["stream","spec","streams","test"],"dependencies":{"macgyver":"~1.6.1"},"author":{"name":"Dominic Tarr"},"license":["MIT","Apache2"],"_id":"stream-spec@0.1.0","dist":{"shasum":"d90cd4a96befe1bf09a36d7b53d15b31ad85725a","tarball":"https://registry.npmjs.org/stream-spec/-/stream-spec-0.1.0.tgz","integrity":"sha512-0XY9koVEulRCc/8FFsYkB0DLsv31wUt8xh9RUWS+A/pqgOPzlckg14fBrig6fN54wKdkX34px04of6/jKO8u8g==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGPiByXdmsiFMQo3qFijarj+ldx+L1xRuDh1sEilyvcPAiEA06aNyKaY4jvYG8MSX0iUMT9NoseIk9iKDm07g7H1uWQ="}]},"maintainers":[{"name":"dominictarr","email":"dominic.tarr@gmail.com"}],"directories":{}},"0.1.1":{"name":"stream-spec","version":"0.1.1","description":"executable specification for Stream (to make testing streams easy)","main":"index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"git://github.com/dominictarr/stream-spec.git"},"keywords":["stream","spec","streams","test"],"dependencies":{"macgyver":"~1.6.1","assertions":"2.3"},"author":{"name":"Dominic Tarr"},"license":["MIT","Apache2"],"_id":"stream-spec@0.1.1","dist":{"shasum":"99d44c24c406c83a492bfff036977c2c31205c64","tarball":"https://registry.npmjs.org/stream-spec/-/stream-spec-0.1.1.tgz","integrity":"sha512-8z0aFqiNtmNdicpzb/dg5OyvM1s2cZ3fsfaTwsPt2Xtad5xRv65faMFyFOqbNcDwJ2F4EQFZ/BI0sQ7WGK7lTw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHyLwP8OC8tGAOUL5brFx3zjMZYPrHReo3n3KL0hoZ0aAiBvIOUvbTnGLsO3YjXwwForF3uHGAKgWBrGiy2LNva3fg=="}]},"maintainers":[{"name":"dominictarr","email":"dominic.tarr@gmail.com"}],"directories":{}},"0.1.2":{"name":"stream-spec","version":"0.1.2","description":"executable specification for Stream (to make testing streams easy)","main":"index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"git://github.com/dominictarr/stream-spec.git"},"keywords":["stream","spec","streams","test"],"dependencies":{"macgyver":"~1.6.1","assertions":"2.3"},"author":{"name":"Dominic Tarr"},"license":["MIT","Apache2"],"_id":"stream-spec@0.1.2","dist":{"shasum":"9976a0166f4ff8baf00c80fdc36914d4d122cdbe","tarball":"https://registry.npmjs.org/stream-spec/-/stream-spec-0.1.2.tgz","integrity":"sha512-wmtyHrmoPkSP7N/vTae1Jn6ngv7ux1G3yMk+AqZmaB+SwdhOxn8DcOmckH8uWS7CMeDujXUvYG4ZhUyBL61AgQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHG2T4lsEtlHJYEGr8HhagWHdbPjKf0ADS3b+kjZWoozAiEAgGiFe71Qu43MqLvhWYxNjMoj8v1S00MimrWb7O/YOZI="}]},"maintainers":[{"name":"dominictarr","email":"dominic.tarr@gmail.com"}],"directories":{}},"0.2.0":{"name":"stream-spec","version":"0.2.0","description":"executable specification for Stream (to make testing streams easy)","main":"index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"git://github.com/dominictarr/stream-spec.git"},"keywords":["stream","spec","specification","streams","test"],"dependencies":{"macgyver":"~1.6.1","assertions":"2.3"},"author":{"name":"Dominic Tarr"},"license":["MIT","Apache2"],"_id":"stream-spec@0.2.0","dist":{"shasum":"a515798f1b1e690ff314053e4ffa2e281e40b1aa","tarball":"https://registry.npmjs.org/stream-spec/-/stream-spec-0.2.0.tgz","integrity":"sha512-3D2T0ELWpfJC/vCoxVn+LZu5XECPXMd/RE7u51jeKRXKWAHiklN0lUpeKf/lCBjhoUKmOotmy0Ib2nfy9Ip/XQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICdb+lLZiME+nqcb00MwB0gAEyBFb8ZJVj3rnoDcdQK9AiBE7ptvD8N1d7WHWCyHH6JhLqoQaCwKfaWfAkfKnIyQnw=="}]},"maintainers":[{"name":"dominictarr","email":"dominic.tarr@gmail.com"}],"directories":{}},"0.2.1":{"name":"stream-spec","version":"0.2.1","description":"executable specification for Stream (to make testing streams easy)","main":"index.js","scripts":{"test":"node test/writable.js; node test/readable.js"},"repository":{"type":"git","url":"git://github.com/dominictarr/stream-spec.git"},"keywords":["stream","spec","specification","streams","test"],"dependencies":{"macgyver":"~1.6.1","assertions":"2.3"},"author":{"name":"Dominic Tarr"},"license":["MIT","Apache2"],"_id":"stream-spec@0.2.1","dist":{"shasum":"bee11553f251243935c87375d0212b517d797f72","tarball":"https://registry.npmjs.org/stream-spec/-/stream-spec-0.2.1.tgz","integrity":"sha512-kKINMjDHEpU6Pu7Y4JSXikSVMVoesxS4MDksx9YDxq4H+n76Fod7Q9YCRQ5h+sqyB8MHm2Ky9Wg2gkLymFbQlA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCDMcwVKFV2Zf7LE2kKiUgpqpWlZg3cFhdTvaeYXV1IJgIgENn0CHIjX9O4gBmpB+VS47u77kGFXTt0G3GUbO5qlFo="}]},"maintainers":[{"name":"dominictarr","email":"dominic.tarr@gmail.com"}],"directories":{}},"0.3.0":{"name":"stream-spec","version":"0.3.0","description":"executable specification for Stream (to make testing streams easy)","main":"index.js","scripts":{"test":"node test/writable.js; node test/readable.js"},"repository":{"type":"git","url":"git://github.com/dominictarr/stream-spec.git"},"keywords":["stream","spec","specification","streams","test"],"dependencies":{"macgyver":"~1.6.1","assertions":"2.3"},"author":{"name":"Dominic Tarr"},"license":["MIT","Apache2"],"_id":"stream-spec@0.3.0","dist":{"shasum":"f3c375798c1eb42440a749de11d9765fa0064ccb","tarball":"https://registry.npmjs.org/stream-spec/-/stream-spec-0.3.0.tgz","integrity":"sha512-vaqIi825J/yhjTP9NRjXyxUH+mrW00obQ0O+GaLALYuDZpPK0OQ6gkoXbbb5xgGCbh18Ih345H06+e89RloeaQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIB4choPe/amYe7w0o9WlIjx+GbU4ibu0Hi5ZCxlAKDYnAiEA4AugfgDKHicTHNgGgPSpc+dSxzb0S1IpYMMU0Fp380k="}]},"maintainers":[{"name":"dominictarr","email":"dominic.tarr@gmail.com"}],"directories":{}},"0.3.1":{"name":"stream-spec","version":"0.3.1","description":"executable specification for Stream (to make testing streams easy)","main":"index.js","scripts":{"test":"node test/writable.js; node test/readable.js"},"repository":{"type":"git","url":"git://github.com/dominictarr/stream-spec.git"},"keywords":["stream","spec","specification","streams","test"],"dependencies":{"macgyver":"~1.6.1","assertions":"2.3"},"author":{"name":"Dominic Tarr"},"license":["MIT","Apache2"],"_id":"stream-spec@0.3.1","dist":{"shasum":"b8eb3194c67b021ef83f3626011df0202dc7861d","tarball":"https://registry.npmjs.org/stream-spec/-/stream-spec-0.3.1.tgz","integrity":"sha512-tgXkIZgds4BaK9RE8ONemCJPdvJ3JfzfDP3D46skjCWrCZsBnufbr7zrYrrlwOGz4bpJLE4SFNv5wmIQLqenaQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDg1AQLrQYZE92p54DxREyAjVlv0wRftsGPjndXBqwGxAiA/rYetCE/asU8d43Qf7sHgooFEMstEg0LkdEmf5l9IoA=="}]},"maintainers":[{"name":"dominictarr","email":"dominic.tarr@gmail.com"}],"directories":{}},"0.3.2":{"name":"stream-spec","version":"0.3.2","description":"executable specification for Stream (to make testing streams easy)","main":"index.js","scripts":{"test":"node test/writable.js; node test/readable.js"},"repository":{"type":"git","url":"git://github.com/dominictarr/stream-spec.git"},"keywords":["stream","spec","specification","streams","test"],"dependencies":{"macgyver":"~1.6.1","assertions":"2.3"},"author":{"name":"Dominic Tarr"},"license":["MIT","Apache2"],"_id":"stream-spec@0.3.2","dist":{"shasum":"c9463196ca9921958c5bea05dddfb9d6bf5cb4c3","tarball":"https://registry.npmjs.org/stream-spec/-/stream-spec-0.3.2.tgz","integrity":"sha512-3OiM0g3M83Tz6EuRK+tfAdTqJepWDhkhNPVplCDyggBNodS7W9kU6ZMD7gFyhwm8lPWpyC0cqQLXSGJf3w0v9w==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEhVhpWyEHncLRwwQOLQf0+dAk/Cl6BI3RIULOlJwqfzAiEAhAgkjZyCVO4dD++05Spd9s1tNztslP7OiwQ7P+rrduE="}]},"_npmVersion":"1.1.65","_npmUser":{"name":"dominictarr","email":"dominic.tarr@gmail.com"},"maintainers":[{"name":"dominictarr","email":"dominic.tarr@gmail.com"}],"directories":{}},"0.3.3":{"name":"stream-spec","version":"0.3.3","description":"executable specification for Stream (to make testing streams easy)","main":"index.js","scripts":{"test":"node test/writable.js; node test/readable.js"},"repository":{"type":"git","url":"git://github.com/dominictarr/stream-spec.git"},"keywords":["stream","spec","specification","streams","test"],"dependencies":{"macgyver":"~1.6.1"},"author":{"name":"Dominic Tarr"},"license":["MIT","Apache2"],"_id":"stream-spec@0.3.3","dist":{"shasum":"895ebbb5bba185f8f0babc9d076473d56a7527ad","tarball":"https://registry.npmjs.org/stream-spec/-/stream-spec-0.3.3.tgz","integrity":"sha512-qFnb3yGr1UV0LDf1VCosyZqtVysmmRWrNqu8wpsF0nNzsp1mMJW/E+pTr4HlnE1mL5NUWnpK3ZxqW+Px2RC4vw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIG4UyLcRioCnMi/c+TAxJzATrMxOF13OiPAgXPlT/bfYAiEApE8Tptu1xlrnOAo58rjyrJLKOnQzVmrGXhWFV0byPzs="}]},"_from":".","_npmVersion":"1.2.3","_npmUser":{"name":"dominictarr","email":"dominic.tarr@gmail.com"},"maintainers":[{"name":"dominictarr","email":"dominic.tarr@gmail.com"}],"directories":{}},"0.3.4":{"name":"stream-spec","version":"0.3.4","description":"executable specification for Stream (to make testing streams easy)","main":"index.js","scripts":{"test":"node test/writable.js; node test/readable.js"},"repository":{"type":"git","url":"git://github.com/dominictarr/stream-spec.git"},"keywords":["stream","spec","specification","streams","test"],"dependencies":{"macgyver":"~1.10"},"author":{"name":"Dominic Tarr"},"license":["MIT","Apache2"],"_id":"stream-spec@0.3.4","dist":{"shasum":"67fc7a72df3bac1a1146a96e8414c4d4dc5c6b12","tarball":"https://registry.npmjs.org/stream-spec/-/stream-spec-0.3.4.tgz","integrity":"sha512-VE2S4tIGN4vuwASsqTwPp+YbgDto1oVjy/cgwKRzp0bZ7hjF5lVN4GCl1cup8QixnJHIT167LBD9cGv4RFqk3A==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIG0x/DC02SkNVOJJa/0hUzVy5O1LraUaN+IXqeQadf3NAiB/3hgjskHoMWo/oc0K4a6bBgeNFps177gW30tiHnEZsg=="}]},"_from":".","_npmVersion":"1.2.3","_npmUser":{"name":"dominictarr","email":"dominic.tarr@gmail.com"},"maintainers":[{"name":"dominictarr","email":"dominic.tarr@gmail.com"}],"directories":{}},"0.3.5":{"name":"stream-spec","version":"0.3.5","description":"executable specification for Stream (to make testing streams easy)","main":"index.js","scripts":{"test":"node test/writable.js; node test/readable.js"},"repository":{"type":"git","url":"git://github.com/dominictarr/stream-spec.git"},"keywords":["stream","spec","specification","streams","test"],"dependencies":{"macgyver":"~1.10"},"author":{"name":"Dominic Tarr"},"license":["MIT","Apache2"],"_id":"stream-spec@0.3.5","dist":{"shasum":"22a61cc92f9e6d32e414724ad171b57ffd188022","tarball":"https://registry.npmjs.org/stream-spec/-/stream-spec-0.3.5.tgz","integrity":"sha512-wp+1aUp9nkERH9fVAT+Xmx8nay8mQB40/EHXFdSapKdwsDDDZqK+wGsBLJ0G+6FtFR0BZEgvfycFM16t88lmYw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDc6MTzm66AhORZ4m6YVncdgMs66XyzPCgdtgMHy2ttOAIhAPuuO2omKvAh/mDBHzbFSTZOOsA7Lml9KKAxHB3YCj2L"}]},"_from":".","_npmVersion":"1.2.3","_npmUser":{"name":"dominictarr","email":"dominic.tarr@gmail.com"},"maintainers":[{"name":"dominictarr","email":"dominic.tarr@gmail.com"}],"directories":{}},"0.3.6":{"name":"stream-spec","version":"0.3.6","description":"executable specification for Stream (to make testing streams easy)","main":"index.js","scripts":{"test":"node test/writable.js; node test/readable.js"},"repository":{"type":"git","url":"git://github.com/dominictarr/stream-spec.git"},"keywords":["stream","spec","specification","streams","test"],"dependencies":{"macgyver":"~1.10"},"author":{"name":"Dominic Tarr"},"license":"(MIT OR Apache-2.0)","gitHead":"614b6732098cf06ef36b639387c551b41a0bb2ae","bugs":{"url":"https://github.com/dominictarr/stream-spec/issues"},"homepage":"https://github.com/dominictarr/stream-spec#readme","_id":"stream-spec@0.3.6","_shasum":"2fddac4a07bf3e9f8963c677a6b5a6cc2115255e","_from":".","_npmVersion":"2.14.8","_nodeVersion":"4.2.1","_npmUser":{"name":"dominictarr","email":"dominic.tarr@gmail.com"},"maintainers":[{"name":"dominictarr","email":"dominic.tarr@gmail.com"}],"dist":{"shasum":"2fddac4a07bf3e9f8963c677a6b5a6cc2115255e","tarball":"https://registry.npmjs.org/stream-spec/-/stream-spec-0.3.6.tgz","integrity":"sha512-Z/sMb/c3tvqWfwW0+NM86MvesniOygbN0J6r2QzufIU13MemcSDNeS3UYy2Le3t8ojXVBX9NyJD9Z14LFA4oeA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCID+YyCzkPBavApoZ9Qb9Z7/zXoylfrgQTML9t+l7omMRAiEAnjZxiUnQLGSr8Qy838NJX0OMLY40P5HI0JqzoiEdpQc="}]},"directories":{}}},"readme":"# StreamSpec\n\nAutomatic checking of the Stream implementations.\n`stream-spec` instruments your stream to verify that it has correct behaviour.\nAll you need to do to test a stream is to wrap it with `stream-spec`, and then pipe\nsome test data through it.\nit's purpose it to make it easy to test user-land streams have correct behavour.\n\ncorrect stream behaviour [illustrated](https://github.com/dominictarr/stream-spec/blob/master/states.markdown)  \n\ncorrect stream behaviour [explained](https://github.com/dominictarr/stream-spec/blob/master/stream_spec.md)  \n\nstream api design [style](https://github.com/dominictarr/stream-spec/blob/master/api-style.markdown) \n\n## a simple test\n\nusing [stream-tester](https://github.com/dominictarr/stream-tester) \n\n``` js\nvar spec = require('stream-spec')\nvar tester = require('stream-tester')\n\nspec(stream)\n  .through({strict: true})\n  .validateOnExit()\n\ntester.createRandomStream(function () {\n    return 'line ' + Math.random() + '\\n'\n  }, 1000)\n  .pipe(stream)\n  .pipe(tester.createPauseStream())\n\n```\n\nsend 1000 random lines through the stream and check that\nit buffers on pause.\n\n## types of `Stream`\n\n### Writable (but not readable)\n\na `WritableStream` must implement `write`, `end`, `destroy` and emit `'drain'` if it pauses,\nand `'close'` after the stream ends, or is destroyed.\n\nIf the stream is sync (does no io) it probably does not need to pause, so the `write()` should never equal `false`\n\n``` js\nspec(stream)\n  .writable()\n  .drainable()\n  .validateOnExit()\n```\n\n### Readable (but not writable)\n\na `ReadableStream` must emit `'data'`, `'end'`, and implement `destroy`,\nand `'close'` after the stream ends, or is destroyed.\nis strongly recommended to implement `pause` and `resume`\n\nIf the option `{strict: true}` is passed, it means the stream is not allowed to emit\n`'data'` or `'end'` when the stream is paused.\n\nIf the option `{end: false}` is passed, then end may not be emitted.\n\n``` js\nspec(stream)\n  .readable()\n  .pausable({strict: true})) //strict is optional.\n  .validateOnExit()\n```\n\n### Through (sync writable and readable, aka: 'filter')\n\nA `Stream` that is both readable and writable, and where the input is processed and then emitted as output, more or less directly. \nExample, [zlib](http://nodejs.org/api/zlib.html). contrast this with duplex stream.\n\nwhen you call `pause()` on a `ThroughStream`, it should change it into a paused state on the writable side also,\nand `write()===false`. Calling `resume()` should cause `'drain'` to be emitted eventually.\n\nIf the option `{strict: true}` is passed, it means the stream is not allowed to emit\n`'data'` or `'end'` when the stream is paused.\n\n``` js\nspec(stream)\n  .through({strict: true}) //strict is optional. \n  .validateOnExit()\n```\n\n### Duplex\n\nA `Stream` that is both readable and writable, but the streams go off to some other place or thing,\nand are not coupled directly. The readable and writable side of a `DuplexStream` each have their own pause state.\n\nIf the option `{strict: true}` is passed, it means the stream is not allowed to emit\n`'data'` or `'end'` when the stream is paused.\n\n``` js\nspec(stream)\n  .duplex({strict: true})\n  .validateOnExit()\n```\n\n### other options\n\n``` js\nspec(stream, name) //use name as the name of the stream in error messages.\n\nspec(stream, {\n  name: name,   //same as above.\n  strict: true, //'data' nor 'end' may be emitted when paused.\n  error: true,  //this stream *must* error.\n  error: false, //this stream *must not* error.\n                //if neither error: boolean option is passed, the stream *may* error.\n  })\n\n\n\n```\n","maintainers":[{"email":"nopersonsmodules@gmail.com","name":"nopersonsmodules"}],"time":{"modified":"2022-06-27T00:49:47.973Z","created":"2012-07-04T14:46:31.468Z","0.0.0":"2012-07-04T14:46:35.963Z","0.1.0":"2012-07-04T16:32:35.262Z","0.1.1":"2012-07-04T17:08:44.477Z","0.1.2":"2012-07-07T03:30:25.136Z","0.2.0":"2012-07-11T05:17:45.899Z","0.2.1":"2012-07-12T04:20:00.741Z","0.3.0":"2012-07-23T20:34:43.900Z","0.3.1":"2012-07-25T19:39:37.528Z","0.3.2":"2012-11-26T04:46:24.766Z","0.3.3":"2013-03-12T05:28:26.744Z","0.3.4":"2013-03-13T07:44:18.933Z","0.3.5":"2013-03-13T08:43:56.085Z","0.3.6":"2015-10-23T21:14:11.291Z"},"author":{"name":"Dominic Tarr"},"repository":{"type":"git","url":"git://github.com/dominictarr/stream-spec.git"},"users":{"fgribreau":true,"xrush":true},"homepage":"https://github.com/dominictarr/stream-spec#readme","keywords":["stream","spec","specification","streams","test"],"bugs":{"url":"https://github.com/dominictarr/stream-spec/issues"},"license":"(MIT OR Apache-2.0)","readmeFilename":"readme.markdown"}