-
Notifications
You must be signed in to change notification settings - Fork 1
/
package.json
executable file
·49 lines (49 loc) · 2.29 KB
/
package.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
{
"name": "slice-stream",
"version": "0.0.0",
"description": "Pipe data through a stream until some fixed length is reached, then callback.",
"main": "slicestream.js",
"directories": {
"example": "examples",
"test": "test"
},
"scripts": {
"test": "tap ./test/*.js"
},
"repository": {
"type": "git",
"url": "https://github.com/EvanOxfeld/slice-stream.git"
},
"keywords": [
"slice",
"fixed",
"length",
"stream",
"split"
],
"author": {
"name": "Evan Oxfeld",
"email": "eoxfeld@gmail.com"
},
"license": "MIT",
"readmeFilename": "README.md",
"gitHead": "9054cbab67c2e71ab9241dbe88401c786b270f8e",
"dependencies": {
"readable-stream": "~1.0.2"
},
"devDependencies": {
"stream-buffers": "~0.2.4",
"tap": "~0.4.0"
},
"readme": "slice-stream [![Build Status](https://travis-ci.org/EvanOxfeld/slice-stream.png)](https://travis-ci.org/EvanOxfeld/slice-stream)\n============\n\nPipe data through a stream until some fixed length is reached, then callback.\n\n## Installation\n\n```bash\n$ npm install slice-stream\n```\n\n## Quick Example\n\n### End stream once a fixed length has been reached\n\n```javascript\nvar SliceStream = require('../');\nvar streamBuffers = require(\"stream-buffers\");\n\nvar ss = new SliceStream({ length: 5}, function (buf, sliceEnd, extra) {\n if (!sliceEnd) {\n return this.push(buf);\n }\n this.push(buf);\n return this.push(null); //signal end of data\n});\n\nvar sourceStream = new streamBuffers.ReadableStreamBuffer();\nsourceStream.put(\"Hello World\");\nvar writableStream = new streamBuffers.WritableStreamBuffer();\n\nsourceStream\n .pipe(ss)\n .pipe(writableStream)\n .once('close', function () {\n var str = writableStream.getContentsAsString('utf8');\n console.log('First 5 bytes piped:', \"'\" + str + \"'\");\n sourceStream.destroy();\n });\n\n//Output\n//Piped data before pattern occurs: 'Hello'\n```\n\n## License\n\nMIT",
"bugs": {
"url": "https://github.com/EvanOxfeld/slice-stream/issues"
},
"homepage": "https://github.com/EvanOxfeld/slice-stream",
"_id": "slice-stream@0.0.0",
"dist": {
"shasum": "c32fd568d0e64cf8665077dbb0f471f761358f8d"
},
"_from": "slice-stream@0.0.0",
"_resolved": "https://registry.npmjs.org/slice-stream/-/slice-stream-0.0.0.tgz"
}