{"_id":"binary-parse-fn","_rev":"5-c13a0e4aa5b0c9b932bfd004912a9c86","name":"binary-parse-fn","description":"Painless binary protocol parsers using generators.","dist-tags":{"latest":"1.0.0"},"versions":{"1.0.0":{"name":"binary-parse-fn","version":"1.0.0","description":"Painless binary protocol parsers using generators.","main":"index.js","repository":{"type":"git","url":"git://github.com/nathan7/binary-parse-fn.git"},"keywords":["generator","binary","synchronous","parse","parser"],"author":{"name":"Nathan Zadoks"},"license":"ISC","bugs":{"url":"https://github.com/nathan7/binary-parse-fn/issues"},"homepage":"https://github.com/nathan7/binary-parse-fn","dependencies":{"readable":"^1.1.2"},"gitHead":"ffd4f2da2d50482bf9cddebdfac2bf235098eef5","_id":"binary-parse-fn@1.0.0","scripts":{},"_shasum":"a813bb58161b8236864a08abed01e209b1311ad1","_from":".","_npmVersion":"1.4.13","_npmUser":{"name":"nathan7","email":"nathan@nathan7.eu"},"maintainers":[{"name":"nathan7","email":"nathan@nathan7.eu"}],"dist":{"shasum":"a813bb58161b8236864a08abed01e209b1311ad1","tarball":"https://registry.npmjs.org/binary-parse-fn/-/binary-parse-fn-1.0.0.tgz","integrity":"sha512-4MsmJA8aihRiIMYcIExoE0nPH4QaRKVrtbP/mfUitAQ8vn32RkkfPLHuITW4xr/XP8qOC2TubYpPPlMet0sx+g==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEzxbQuOwt4vVIjRAilhWQOLPcL7lvXS8/24SyJ5XRDNAiEA5jSqxsqJPYqAslY+8mAubM5ke7AfkdGg6YfvrIfn4jA="}]}}},"readme":"# binary-parse-fn\n\n  Painless streaming binary protocol parsers using generators.\n\n## Installation\n\n    npm install binary-parse-fn\n\n## Streaming use\n\n  This module uses the exact same generator interface as [binary-parse-stream](https://github.com/nathan7/binary-parse-stream), which presents a streaming interface to a generator parser.\n\n## Usage\n\n```javascript\nvar BinaryParser = require('binary-parse-fn')\n```\n\n  BinaryParser is a function that takes a buffer and passes the return value of your generator back.\n  When your generator yields a number, it'll be fed a buffer of that length from the input.\n  If it yields -1, it'll be given the value of the first byte instead of a single-byte buffer.\n\n## Example\n\n  The following module parses a protocol that consists of a 32-bit unsigned big-endian type parameter, an unsigned 8-bit length parameter, and a buffer of the specified length.\n  It returns `{type, buf}` objects.\n\n```js\nvar BinaryParser = require('binary-parse-fn')\n\nmodule.exports = BinaryParser(function*() {\n  var type = (yield 4).readUInt32BE(0, true)\n    , length = yield -1\n    , buf = yield length\n  return { type: type, buf: buf }\n})\n```\n","maintainers":[],"time":{"modified":"2022-06-13T04:38:08.147Z","created":"2014-05-31T19:59:09.339Z","1.0.0":"2014-05-31T19:59:09.339Z"},"homepage":"https://github.com/nathan7/binary-parse-fn","keywords":["generator","binary","synchronous","parse","parser"],"repository":{"type":"git","url":"git://github.com/nathan7/binary-parse-fn.git"},"author":{"name":"Nathan Zadoks"},"bugs":{"url":"https://github.com/nathan7/binary-parse-fn/issues"},"license":"ISC","readmeFilename":"README.md"}