{"_id":"steez","_rev":"26-036b2ca0524362b8509357054408c509","name":"steez","description":"The g of a mack and the steez of a geezer.","dist-tags":{"latest":"0.4.2"},"versions":{"0.0.1":{"name":"steez","version":"0.0.1","description":"The g of a mack and the steez of a geezer.","main":"index.js","repository":{"type":"git","url":"git://github.com/deoxxa/steez.git"},"keywords":["stream","template","buffer","queue","automatic","pipe","wrapper"],"author":{"name":"Conrad Pankoff","email":"deoxxa@fknsrs.biz","url":"http://www.fknsrs.biz/"},"license":"BSD","_id":"steez@0.0.1","dist":{"shasum":"1a82176dc3438d18a98ba958f58f416d0ec8646b","tarball":"https://registry.npmjs.org/steez/-/steez-0.0.1.tgz","integrity":"sha512-q3kMlGLMB1OgLSs9kK/Pj3rUJJ40PZiF7qzKqrIMF8dGLEte9s5qj7znBw5un8+klkpGJRMDL9ImxruoN1LuAA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICINF593zAP9YBQdWxMHDjJ0rjKbUSs16hXLrKuTAUqEAiEAy0O14nBoiNrikfm0IsUfl+cqCbEX3ixZSJr+avY6RjI="}]},"_npmVersion":"1.1.63","_npmUser":{"name":"deoxxa","email":"deoxxa@fknsrs.biz"},"maintainers":[{"name":"deoxxa","email":"deoxxa@fknsrs.biz"}],"directories":{}},"0.0.2":{"name":"steez","version":"0.0.2","description":"The g of a mack and the steez of a geezer.","main":"index.js","repository":{"type":"git","url":"git://github.com/deoxxa/steez.git"},"keywords":["stream","template","buffer","queue","automatic","pipe","wrapper"],"author":{"name":"Conrad Pankoff","email":"deoxxa@fknsrs.biz","url":"http://www.fknsrs.biz/"},"license":"BSD","_id":"steez@0.0.2","dist":{"shasum":"f343f1ab50ee3466506f8dbba4383bea3ee37e0f","tarball":"https://registry.npmjs.org/steez/-/steez-0.0.2.tgz","integrity":"sha512-wZEIo+0TMaQxjf6nCeorLkH9zfUgpYoy2WumEYI4AxpnApah8Doj6Pfz036k+0gdS8QLmmCAtVUixcnwhPt38w==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGLMyhq83izobrNExjnMkgVE5LEtuoSSvWtqT1hV2fhsAiEA+wByXoodk42ADwTnca/43fxw2GMB/dVR+ocrozksv8M="}]},"_npmVersion":"1.1.63","_npmUser":{"name":"deoxxa","email":"deoxxa@fknsrs.biz"},"maintainers":[{"name":"deoxxa","email":"deoxxa@fknsrs.biz"}],"directories":{}},"0.0.3":{"name":"steez","version":"0.0.3","description":"The g of a mack and the steez of a geezer.","main":"index.js","repository":{"type":"git","url":"git://github.com/deoxxa/steez.git"},"keywords":["stream","template","buffer","queue","automatic","pipe","wrapper"],"author":{"name":"Conrad Pankoff","email":"deoxxa@fknsrs.biz","url":"http://www.fknsrs.biz/"},"license":"BSD","_id":"steez@0.0.3","dist":{"shasum":"2ed1d14c3adea2306186ff64f5ae472ef7504763","tarball":"https://registry.npmjs.org/steez/-/steez-0.0.3.tgz","integrity":"sha512-4w3oWCHZet+Zdz/UIZUtqsI5vlEMseVa3AMcjxdX8IgtxTetQPMXvObOPsxlChjVCJET3+6agwReBwUYDjJ/9g==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDDwAENNl5zlZHF2pwoLaDHe74uILhX0P7vuKPx/6zjJAIgG/7sBBi4pNilQDUEegDIZZnlCM649o7QbCGCSLt6kao="}]},"_npmVersion":"1.1.63","_npmUser":{"name":"deoxxa","email":"deoxxa@fknsrs.biz"},"maintainers":[{"name":"deoxxa","email":"deoxxa@fknsrs.biz"}],"directories":{}},"0.1.1":{"name":"steez","version":"0.1.1","description":"The g of a mack and the steez of a geezer.","main":"index.js","repository":{"type":"git","url":"git://github.com/deoxxa/steez.git"},"keywords":["stream","template","buffer","queue","automatic","pipe","wrapper"],"author":{"name":"Conrad Pankoff","email":"deoxxa@fknsrs.biz","url":"http://www.fknsrs.biz/"},"license":"BSD","_id":"steez@0.1.1","dist":{"shasum":"82b8ce9c3ab8d2c1d1acc5d0b970259c15b15b45","tarball":"https://registry.npmjs.org/steez/-/steez-0.1.1.tgz","integrity":"sha512-M8RMGFpYPVG/Rya4tDRrD6An5iNv6Uea1pnecCX/zwqCcb217A02EiSHYrqmDaj+J6BFRJ0p6/zSzipG8Yh5Kg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGG9iY58sPQQzm9tGBGvufCyP+XftoAcbeWmEGPmd+m/AiA1zpHY9t3GsLcV4nI8yx3rsublB5Yc0ZnrGy73bCenuA=="}]},"_npmVersion":"1.1.63","_npmUser":{"name":"deoxxa","email":"deoxxa@fknsrs.biz"},"maintainers":[{"name":"deoxxa","email":"deoxxa@fknsrs.biz"}],"directories":{}},"0.2.1":{"name":"steez","version":"0.2.1","description":"The g of a mack and the steez of a geezer.","main":"index.js","repository":{"type":"git","url":"git://github.com/deoxxa/steez.git"},"keywords":["stream","template","buffer","queue","automatic","pipe","wrapper"],"author":{"name":"Conrad Pankoff","email":"deoxxa@fknsrs.biz","url":"http://www.fknsrs.biz/"},"license":"BSD","_id":"steez@0.2.1","dist":{"shasum":"4ed1eae732edb736ca7b621e18cb0c71ab94cd78","tarball":"https://registry.npmjs.org/steez/-/steez-0.2.1.tgz","integrity":"sha512-3Liuaa1WXBfyTUSDoKKzmloZ97IghKxQ26ip9rh+fQWzi+7uam1R61z7RY/tbWp+7/AGbnAVupjwMzUO4i6bQA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDCOUd4c5qc2A0aiNcM39nnIE+g1yLQg3T/5bUcMIw4IAiEAwylM/6d0mH33ynQ2PpdGAQLP5H1GDNx8YM3fK++L6pY="}]},"_npmVersion":"1.1.63","_npmUser":{"name":"deoxxa","email":"deoxxa@fknsrs.biz"},"maintainers":[{"name":"deoxxa","email":"deoxxa@fknsrs.biz"}],"directories":{}},"0.2.2":{"name":"steez","version":"0.2.2","description":"The g of a mack and the steez of a geezer.","main":"index.js","repository":{"type":"git","url":"git://github.com/deoxxa/steez.git"},"keywords":["stream","template","buffer","queue","automatic","pipe","wrapper"],"author":{"name":"Conrad Pankoff","email":"deoxxa@fknsrs.biz","url":"http://www.fknsrs.biz/"},"license":"BSD","_id":"steez@0.2.2","dist":{"shasum":"5f986adeeb02fdfec3c339eecda5e00131c7d7f4","tarball":"https://registry.npmjs.org/steez/-/steez-0.2.2.tgz","integrity":"sha512-nsDQHdtmCy/v5oriLCZ1tOqKhelYPLUSh0CsEc9WX6iqRXMwJ1fq4Iyk4Ct05OsEkqSzp4Dvox2R2Uz/uoTChw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEqCpVHWL29hdtdKDihNt6bhDkc09kNcQjdACSrUdeY1AiEAkVNJqqj7CvaiKnwJh1WYU6oMsH3cvKL/FsDkPvvAS5s="}]},"_npmVersion":"1.1.63","_npmUser":{"name":"deoxxa","email":"deoxxa@fknsrs.biz"},"maintainers":[{"name":"deoxxa","email":"deoxxa@fknsrs.biz"}],"directories":{}},"0.3.1":{"name":"steez","version":"0.3.1","description":"The g of a mack and the steez of a geezer.","main":"index.js","repository":{"type":"git","url":"git://github.com/deoxxa/steez.git"},"keywords":["stream","template","buffer","queue","automatic","pipe","wrapper"],"devDependencies":{"buster":"*","concat-stream":"*","async":"*"},"scripts":{"test":"./node_modules/.bin/buster-test"},"author":{"name":"Conrad Pankoff","email":"deoxxa@fknsrs.biz","url":"http://www.fknsrs.biz/"},"license":"BSD","_id":"steez@0.3.1","dist":{"shasum":"6dcf3c93195c1322f2d89a42fa96a5713c5deef2","tarball":"https://registry.npmjs.org/steez/-/steez-0.3.1.tgz","integrity":"sha512-J/BeupS5/XiQZBy2CA2fscROd6J6dNO+zEi01PuYXz/gdLd+XXIEj/aSSul6fjiXcA0znwInIS4C3+WftnH1qg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDRQTeiZFDAQ0T4k3CVnOrsrP6vgi2p4Lr+wl01F1efKgIgbhgWPINK7kj+dvoAiY9DuEEhQghesJ6SDQtexbnCwuQ="}]},"_npmVersion":"1.1.63","_npmUser":{"name":"deoxxa","email":"deoxxa@fknsrs.biz"},"maintainers":[{"name":"deoxxa","email":"deoxxa@fknsrs.biz"}],"directories":{}},"0.4.1":{"name":"steez","version":"0.4.1","description":"The g of a mack and the steez of a geezer.","main":"index.js","repository":{"type":"git","url":"git://github.com/deoxxa/steez.git"},"keywords":["stream","template","buffer","queue","automatic","pipe","wrapper"],"devDependencies":{"buster":"*","concat-stream":"*","async":"*","slow-stream":"*"},"scripts":{"test":"./node_modules/.bin/buster-test"},"author":{"name":"Conrad Pankoff","email":"deoxxa@fknsrs.biz","url":"http://www.fknsrs.biz/"},"license":"BSD","_id":"steez@0.4.1","dist":{"shasum":"e75b1e27f13b1db2d8a433e76398e508458cdfd7","tarball":"https://registry.npmjs.org/steez/-/steez-0.4.1.tgz","integrity":"sha512-DdI33aJp7wp3AUMvA5VSpjNpwMPaLgtW4tbotQu9loA6t9kM2tEn/0+tRpQE5VitwBIqkZ7+fGt15po97e4BJA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFgjAEmjZvHjjOG+kJ5iBO8SbeNCDaF9VDXMBbNevlLuAiBHj/Dw2oCkRdNgH5DotfIKdaZZkQbCmK78CSxsbuk0QQ=="}]},"_npmVersion":"1.1.63","_npmUser":{"name":"deoxxa","email":"deoxxa@fknsrs.biz"},"maintainers":[{"name":"deoxxa","email":"deoxxa@fknsrs.biz"}]},"0.4.2":{"name":"steez","version":"0.4.2","description":"The g of a mack and the steez of a geezer.","main":"index.js","repository":{"type":"git","url":"git://github.com/deoxxa/steez.git"},"keywords":["stream","template","buffer","queue","automatic","pipe","wrapper"],"devDependencies":{"buster":"*","concat-stream":"*","async":"*","slow-stream":"*"},"scripts":{"test":"buster-test"},"author":{"name":"Conrad Pankoff","email":"deoxxa@fknsrs.biz","url":"http://www.fknsrs.biz/"},"license":"BSD","_id":"steez@0.4.2","dist":{"shasum":"cf4938311e5f24d4de26243564008cd95181efca","tarball":"https://registry.npmjs.org/steez/-/steez-0.4.2.tgz","integrity":"sha512-eWKdF3W7iWCrY71Pgrv2BABApvYajo6aWzo276n8KZfzkOtKB5mNqq2Uuj55W3Yy2TCrPSLDgkIBk+9BEEVO0Q==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCYcyHJEcy+hUz8ay98ypF8RpHrgO1RE5OrEADfHeWtOgIhAJI2+JP8AWt+iR0URl/Zo9Gh1Q/FFZAL6D2WScH5qJYz"}]},"_npmVersion":"1.1.63","_npmUser":{"name":"deoxxa","email":"deoxxa@fknsrs.biz"},"maintainers":[{"name":"deoxxa","email":"deoxxa@fknsrs.biz"}]}},"readme":"Steez\n=====\n\nThe g of a mack and the steez of a geezer.\n\nOverview\n--------\n\nSteez helps you create well behaved streams in a very unobtrusive manner. It\ndoes this by hijacking your outgoing `data` events, implementing buffering,\nproviding accurate `pause()`/`resume()` behaviour and trying really hard to play\nnicely with all manners of `pipe()` usage.\n\nRationale\n---------\n\nImplementing `pause()`/`resume()`/`end()`/etc semantics every time you write\nsome code that you want to use as a stream is annoying. Steez tries to make this\na thing of the past by providing an extendable base class with some transparent\nmagic built in to make your stream behave nicely.\n\nFeatures\n--------\n\n* Transparent `data` event queueing (by hijacking `emit()`) ([more](#buffering))\n* Accurate `pause()`, `resume()`, `end()`, `destroySoon()` and `destroy()`\n  implementations out of the box\n* Ability to override certain behaviours on a per-implementation basis\n  ([more](#overridable-methods))\n* Multi-target stream synchronisation (more on this [below](#multi-target-pipe))\n\nBuffering\n---------\n\nSteez internally hijacks your `emit()` method, catching `data` events and\nqueueing them if the stream is in a paused state (if `this.paused` is true).\nWhen emitting data, it's advised that you check for the state of `this.paused`;\nif it's not `0`, hold off on sending any more data until Steez emits a `drain`\nevent.\n\n**WARNING**: If you continue to emit data at a high rate while the stream is\npaused, there's a chance you'll blow out your memory usage as events will be\nindefinitely buffered.\n\nOverridable Methods\n-------------------\n\nSteez has a few methods you can implement to alter its behaviour; they are as\nfollows:\n\n`can_destroy`: return a truthy value if the stream has no pending tasks and can\nbe destroyed safely. This is useful if you perform any asynchronous tasks in\nyour stream, as they will not count towards the stream's internal queue.\n\n`on_pause`: this is called (if it exists) when Steez goes from being not paused\nto paused. Note that this is not as simple as just being called every time\n`pause()` is called, due to the multi-target stream synchronisation.\n\n`on_resume`: this is called (if it exists) when Steez goes from being paused to\nnot paused. This is the same as `on_pause` in that it's not just called whenever\n`resume()` is called, but rather when all streams have `resume()`ed the stream.\n\nMulti-Target `pipe()`\n---------------------\n\nWith a regular [stream](http://nodejs.org/docs/latest/api/all.html#all_stream),\nif you pipe to more than one target and more than one of those targets initiates\nor relays `pause()` or `resume()` calls, you can end up with some very strange\nbehaviour.\n\nTake this code for example:\n\n```javascript\nvar fs = require(\"fs\"),\n    util = require(\"util\");\n\nvar src = fs.createReadStream(\"/mnt/my_ssd/src\"),\n    fast_dst = fs.createWriteStream(\"/mnt/my_ssd/dst\"),\n    slow_dst = fs.createWriteStream(\"/mnt/my_floppy_drive/dst\");\n\nsrc.pipe(fast_dst);\nsrc.pipe(slow_dst);\n```\n\nIn this case, you would logically expect the `src` stream to be limited to the\nslower of the two `dst` streams. This, however, is not the case. In reality, the\nyou will end up with the `src` stream flipping rapidly between paused and\nunpaused. This is why:\n\n1. `slow_dst` stream will `pause()` the `src` stream as it will block on writing\n    much quicker than `fast_dst`.\n2. Before `slow_dst` has become ready for writing again, `fast_dst` will\n   `resume()` `src` as its write buffer will have emptied (after `slow_dst`\n   called `pause()` on `src`).\n3. Upon emitting another chunk of data, `slow_dst` will immediately `pause()`\n   `src` again, as it's still not ready for writing.\n4. Points 2 and 3 will be repeated for a while, until either `fast_dst` finishes\n   or `slow_dst` collapses under the weight of its own internal buffering\n   mechanism (hey, it could happen).\n\nTo solve this, Steez keeps a record of which `pipe()`ed streams have asked to\n`pause()` or `resume()` the Steez instance and only resumes emitting data after\nall targets are ready.\n\nInstallation\n------------\n\nAvailable via [npm](http://npmjs.org/):\n\n> $ npm install steez\n\nOr via git:\n\n> $ git clone git://github.com/deoxxa/steez.git node_modules/steez\n\nUsage\n-----\n\n```javascript\n#!/usr/bin/env node\n\nvar fs = require(\"fs\"),\n    util = require(\"util\");\n\nvar Steez = require(\"steez\");\n\nfunction ChunkReverser() {\n  Steez.call(this);\n}\nutil.inherits(ChunkReverser, Steez);\n\nChunkReverser.prototype.write = function write(data) {\n  this.emit(\"data\", Buffer(data.toString().split(\"\").reverse().join(\"\")));\n\n  return !this.paused && this.writable;\n};\n\nvar chunk_reverser = new ChunkReverser();\n\nvar a = fs.createReadStream(\"./data.in\"),\n    b = fs.createWriteStream(\"./data.out\");\n\na.pipe(chunk_reverser).pipe(b);\n```\n\nLicense\n-------\n\n3-clause BSD. A copy is included with the source.\n\nContributors\n------------\n\n* [deoxxa](http://github.com/deoxxa)\n* [rvagg](http://github.com/rvagg)\n\nContact\n-------\n\n* GitHub ([deoxxa](http://github.com/deoxxa))\n* Twitter ([@deoxxa](http://twitter.com/deoxxa))\n* ADN ([@deoxxa](https://alpha.app.net/deoxxa))\n* Email ([deoxxa@fknsrs.biz](mailto:deoxxa@fknsrs.biz))\n","maintainers":[{"name":"deoxxa","email":"deoxxa@fknsrs.biz"}],"time":{"modified":"2022-06-27T00:18:28.511Z","created":"2012-10-14T01:44:25.336Z","0.0.1":"2012-10-14T01:44:29.366Z","0.0.2":"2012-10-14T03:46:57.628Z","0.0.3":"2012-10-14T03:53:48.279Z","0.1.1":"2012-10-19T13:43:00.897Z","0.2.1":"2012-10-19T13:44:04.183Z","0.2.2":"2012-10-19T13:45:08.287Z","0.3.1":"2012-10-20T05:29:56.686Z","0.4.1":"2012-10-23T05:43:59.553Z","0.4.2":"2012-10-23T13:12:54.121Z"},"author":{"name":"Conrad Pankoff","email":"deoxxa@fknsrs.biz","url":"http://www.fknsrs.biz/"},"repository":{"type":"git","url":"git://github.com/deoxxa/steez.git"},"users":{"fgribreau":true},"keywords":["stream","template","buffer","queue","automatic","pipe","wrapper"],"license":"BSD","readmeFilename":""}