Package Exports
- steez
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (steez) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
steez
The g of a mack and the steez of a geezer.
Overview
Implementing pause()/resume() semantics every time you write some code that
you want to use as a stream is annoying. steez tries to make this a thing of the
past by providing a properly extendable base class with some transparent magic
built in to make your stream behave nicely. When you .emit("data", ...), steez
will trap the event and queue it up for later if your stream is paused. It will
also handle all the requisite events and methods for proper pipe() usage.
Installation
Available via npm:
$ npm install steez
Or via git:
$ git clone git://github.com/deoxxa/node-steez.git node_modules/steez
Usage
#!/usr/bin/env node
var fs = require("fs"),
util = require("util");
var Steez = require("./index");
function ChunkReverser() {
Steez.call(this);
}
util.inherits(ChunkReverser, Steez);
ChunkReverser.prototype.write = function write(data) {
this.emit("data", Buffer(data.toString().split("").reverse().join("")));
return this.writable;
};
var chunk_reverser = new ChunkReverser();
var a = fs.createReadStream("./data.in"),
b = fs.createWriteStream("./data.out");
a.pipe(chunk_reverser).pipe(b);License
3-clause BSD. A copy is included with the source.
Contact
- GitHub (deoxxa)
- Twitter (@deoxxa)
- ADN (@deoxxa)
- Email (deoxxa@fknsrs.biz)