GT2/GT2-iOS/node_modules/stream-parser/package.json

88 lines
6.5 KiB
JSON

{
"_args": [
[
{
"raw": "stream-parser@~0.3.1",
"scope": null,
"escapedName": "stream-parser",
"name": "stream-parser",
"rawSpec": "~0.3.1",
"spec": ">=0.3.1 <0.4.0",
"type": "range"
},
"/Volumes/2009-SSD/GT2/GT2-iOS/node_modules/probe-image-size"
]
],
"_from": "stream-parser@>=0.3.1 <0.4.0",
"_id": "stream-parser@0.3.1",
"_inCache": true,
"_location": "/stream-parser",
"_nodeVersion": "0.12.4",
"_npmUser": {
"name": "tootallnate",
"email": "nathan@tootallnate.net"
},
"_npmVersion": "2.10.1",
"_phantomChildren": {},
"_requested": {
"raw": "stream-parser@~0.3.1",
"scope": null,
"escapedName": "stream-parser",
"name": "stream-parser",
"rawSpec": "~0.3.1",
"spec": ">=0.3.1 <0.4.0",
"type": "range"
},
"_requiredBy": [
"/probe-image-size"
],
"_resolved": "https://registry.npmjs.org/stream-parser/-/stream-parser-0.3.1.tgz",
"_shasum": "1618548694420021a1182ff0af1911c129761773",
"_shrinkwrap": null,
"_spec": "stream-parser@~0.3.1",
"_where": "/Volumes/2009-SSD/GT2/GT2-iOS/node_modules/probe-image-size",
"author": {
"name": "Nathan Rajlich",
"email": "nathan@tootallnate.net",
"url": "http://tootallnate.net"
},
"bugs": {
"url": "https://github.com/TooTallNate/node-stream-parser/issues"
},
"dependencies": {
"debug": "2"
},
"description": "Generic interruptible \"parser\" mixin for Transform & Writable streams",
"devDependencies": {
"mocha": "*",
"readable-stream": "1.0"
},
"directories": {},
"dist": {
"shasum": "1618548694420021a1182ff0af1911c129761773",
"tarball": "https://registry.npmjs.org/stream-parser/-/stream-parser-0.3.1.tgz"
},
"gitHead": "a0e021b9757be0dce764b7f60e23dd678b05f12f",
"homepage": "https://github.com/TooTallNate/node-stream-parser#readme",
"license": "MIT",
"main": "index.js",
"maintainers": [
{
"name": "tootallnate",
"email": "nathan@tootallnate.net"
}
],
"name": "stream-parser",
"optionalDependencies": {},
"readme": "node-stream-parser\n==================\n### Generic interruptible \"parser\" mixin for Transform & Writable streams\n[![Build Status](https://secure.travis-ci.org/TooTallNate/node-stream-parser.svg)](http://travis-ci.org/TooTallNate/node-stream-parser)\n\nThis module offers the `stream-parser` mixin, which provides an easy-to-use API\nfor parsing bytes from `Writable` and/or `Transform` stream instances. This module\nis great for implementing streaming parsers for standardized file formats.\n\nFor `Writable` streams, the parser takes control over the `_write` callback\nfunction. For `Transform` streams, the parser controls the `_transform` callback\nfunction.\n\nInstallation\n------------\n\n``` bash\n$ npm install stream-parser\n```\n\n\nExample\n-------\n\nLet's create a quick `Transform` stream subclass that utilizes the parser's\n`_bytes()` and `_passthrough()` functions to parse a theoretical file format that\nhas an 8-byte header we want to parse, and then pass through the rest of the data.\n\n``` javascript\nvar Parser = require('stream-parser');\nvar inherits = require('util').inherits;\nvar Transform = require('stream').Transform;\n\n// create a Transform stream subclass\nfunction MyParser () {\n Transform.call(this);\n\n // buffer the first 8 bytes written\n this._bytes(8, this.onheader);\n}\ninherits(MyParser, Transform);\n\n// mixin stream-parser into MyParser's `prototype`\nParser(MyParser.prototype);\n\n// invoked when the first 8 bytes have been received\nMyParser.prototype.onheader = function (buffer, output) {\n // parse the \"buffer\" into a useful \"header\" object\n var header = {};\n header.type = buffer.readUInt32LE(0);\n header.name = buffer.toString('utf8', 4);\n this.emit('header', header);\n\n // it's usually a good idea to queue the next \"piece\" within the callback\n this._passthrough(Infinity);\n};\n\n\n// now we can *use* it!\nvar parser = new MyParser();\nparser.on('header', function (header) {\n console.error('got \"header\"', header);\n});\nprocess.stdin.pipe(parser).pipe(process.stdout);\n```\n\nHere's an example of manually creating a `Transform` stream and turning it into a\n\"pass through\" stream equivalent to the one built into node core:\n\n``` javascript\nvar Parser = require('stream-parser');\nvar Transform = require('stream').Transform;\n\n// create a Transform instance and extend it with \"stream-parser\"\nvar p = new Transform();\nParser(p);\n\n// pass through `Infinity` bytes... forever...\np._passthrough(Infinity);\n\n// now `p` is equivalent to a stream.PassThrough instance\nprocess.stdin.pipe(p).pipe(process.stdout);\n```\n\nSee the `test` directory for some more example code in the test cases.\n\nA list of known concrete implementations is here (send pull requests for more!):\n\n * [node-icecast][]\n * [node-throttle][]\n * [node-flv][]\n * [node-wav][]\n\nAPI\n---\n\n - [Parser()](#parser)\n - [._bytes(n, cb)](#_bytesn-cb)\n - [._skipBytes(n, cb)](#_skipbytesn-cb)\n - [._passthrough(n, cb)](#_passthroughn-cb)\n\n## Parser()\n\n The `Parser` stream mixin works with either `Writable` or `Transform` stream\n instances/subclasses. Provides a convenient generic \"parsing\" API:\n\n```js\n_bytes(n, cb) - buffers \"n\" bytes and then calls \"cb\" with the \"chunk\"\n_skipBytes(n, cb) - skips \"n\" bytes and then calls \"cb\" when done\n```\n\n If you extend a `Transform` stream, then the `_passthrough()` function is also\n added:\n\n```js\n_passthrough(n, cb) - passes through \"n\" bytes untouched and then calls \"cb\"\n```\n\n### ._bytes(n, cb)\n\n Buffers `n` bytes and then invokes `cb` once that amount has been collected.\n\n### ._skipBytes(n, cb)\n\n Skips over the next `n` bytes and then invokes `cb` once that amount has been\n discarded.\n\n### ._passthrough(n, cb)\n\n Passes through `n` bytes to the readable side of this stream untouched,\n then invokes `cb` once that amount has been passed through. This function is only defined\n when stream-parser is extending a `Transform` stream.\n\n[node-icecast]: https://github.com/TooTallNate/node-icecast\n[node-throttle]: https://github.com/TooTallNate/node-throttle\n[node-flv]: https://github.com/TooTallNate/node-flv\n[node-wav]: https://github.com/TooTallNate/node-wav\n",
"readmeFilename": "README.md",
"repository": {
"type": "git",
"url": "git://github.com/TooTallNate/node-stream-parser.git"
},
"scripts": {
"test": "mocha --reporter spec"
},
"version": "0.3.1"
}