You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
6 years ago | |
|---|---|---|
| .. | ||
| examples | 6 years ago | |
| node_modules/readable-stream | 6 years ago | |
| .npmignore | 6 years ago | |
| LICENCE | 6 years ago | |
| Makefile | 6 years ago | |
| README.md | 6 years ago | |
| array.js | 6 years ago | |
| index.js | 6 years ago | |
| package.json | 6 years ago | |
README.md
write-stream
Base class for writable streams
Example array
var toArray = require("write-stream").toArray
, array = []
, stream = toArray(array, function end() {
/* never called as process.stdin does not end */
})
process.stdin.pipe(stream)
setInterval(function () {
// peek at the buffered array of chunks from stdin every second
console.log(array)
}, 1000)
Example function
var WriteStream = require("write-stream")
, stream = WriteStream(function write(chunk) {
// chunks from stdin
})
process.stdin.pipe(stream)
Installation
npm install write-stream
Contributors
- Raynos