{"name":"pbf","version":"3.2.1","description":"a low-level, lightweight protocol buffers implementation in JavaScript","main":"index.js","unpkg":"dist/pbf.js","jsdelivr":"dist/pbf.js","scripts":{"bench":"node bench/bench.js","test":"eslint index.js compile.js test/*.js bench/bench-tiles.js bin/pbf && tap test/*.test.js && npm run build-min","cov":"tap test/*.test.js --cov --coverage-report=html","build-min":"mkdirp dist && browserify index.js -s Pbf | uglifyjs -c -m > dist/pbf.js","build-dev":"mkdirp dist && browserify index.js -d -s Pbf > dist/pbf-dev.js","prepublishOnly":"npm run build-dev && npm run build-min"},"bin":{"pbf":"bin/pbf"},"repository":{"type":"git","url":"git+ssh://git@github.com/mapbox/pbf.git"},"keywords":["protocol","buffer","pbf","protobuf","binary","format","serialization","encoder","decoder"],"author":{"name":"Konstantin Kaefer"},"license":"BSD-3-Clause","bugs":{"url":"https://github.com/mapbox/pbf/issues"},"homepage":"https://github.com/mapbox/pbf","dependencies":{"ieee754":"^1.1.12","resolve-protobuf-schema":"^2.1.0"},"devDependencies":{"benchmark":"^2.1.4","browserify":"^16.2.3","eslint":"^5.15.1","eslint-config-mourner":"^2.0.3","mkdirp":"^0.5.1","protobufjs":"^6.8.8","protocol-buffers":"^4.1.0","tap":"^12.6.0","tile-stats-runner":"^1.0.0","uglify-js":"^3.6.1"},"eslintConfig":{"extends":"mourner","rules":{"space-before-function-paren":[2,"never"],"key-spacing":0,"no-empty":0,"global-require":0,"no-cond-assign":0,"indent":[2,4,{"flatTernaryExpressions":true}]}},"gitHead":"b4eab649287544e2654f480145fdf5db8ac3d6ee","_id":"pbf@3.2.1","_nodeVersion":"10.16.3","_npmVersion":"6.11.3","dist":{"integrity":"sha512-ClrV7pNOn7rtmoQVF4TS1vyU0WhYRnP92fzbfF75jAIwpnzdJXf8iTd4CMEqO4yUenH6NDqLiwjqlh6QgZzgLQ==","shasum":"b4c1b9e72af966cd82c6531691115cc0409ffe2a","tarball":"http://registry-npm.ywwl.com/pbf/download/pbf-3.2.1.tgz","fileCount":8,"unpackedSize":124748,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdoJX3CRA9TVsSAnZWagAAYjoP/0kzS0gvdJh53NYCk30q\niry8qDRZQ0SHAUnDUY6uteow4G8Yso7YEX9VsQEyYejlxC2SQqLzLgy3/tIg\nLH1CdQpZiVU2GUamP5qu2ZNkjwItG9tmmwCNeltCaMb/khSSgb3Vfu9lMuDN\nKxlQR1CnyOegzw3KNuCs5X/TkH8zHCPDJrIBZgqkU8+C9a9wCF/PtkthDICY\nbW4neg9nUwqnTD24A3b/3u7EswGPIt7Qu3uIcq26nan//jok5pj6VyXAmh01\nt3PZsWgA7Y59ixR6tq7U8VnvaxzQ1q2ttlXtg/agKypz+vmP16lii8b6eccP\nv9WrL7zuCDw1KEp2Ah4IeblsPOK2q3Dg4gvwYAb/VDMlgqpnT8+SsONfilFj\ns+qQs0wQcBHn+ropb0+ZJn5yuwJi5y/CrEYyTSRIgwf19ZRnFPtUpoOsaBYg\nLfzFuMUrLzzDdtin+qDUL2tZAA5A8bLg+ZLo6vsH083NHtg97RuvybiA4MvZ\nQq5e1Pfi6OcYRAcs3OMFTWfBWdF/+Tmo4NNwAUUVCHjdloDYqxOOgFKYSIdu\nUWfSkECR/0oz4C5zJutLQmUnql8GYGg5Jt2MOeMBdUfNRkiuMElAaycn/Wtf\n25qcMq8GKTtfNH+Jjp8t0cz549l6N7R+hMFcLpM3o+EPv1gyEYaZOqygGsPu\nJOuE\r\n=eus4\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC/7LX4Pnm+EI/n4AZwXRtutxRSJtJ/07pkxtzb/+V5WgIgOka1LF4NEtnRas7UE04juhFXniKF4w7asCHbiz3btfs="}],"size":27180,"noattachment":false,"key":"/pbf/-/pbf-3.2.1.tgz"},"maintainers":[{"email":"aarthy@mapbox.com","name":"aarthykc"},{"email":"aj@mapbox.com","name":"ajashton"},{"email":"ranka.aj@gmail.com","name":"ajithranka"},{"email":"alice@mapbox.com","name":"aliceykuo"},{"email":"alinapaz@gmail.com","name":"alinapaz"},{"email":"aileen.s.rowan@gmail.com","name":"allierowan"},{"email":"ulsh@mapbox.com","name":"alulsh"},{"email":"amisha@mapbox.com","name":"amishas157"},{"email":"amyleewalton@gmail.com","name":"amyleew"},{"email":"vestibule@anandthakker.net","name":"anandthakker"},{"email":"ansis.brammanis@gmail.com","name":"ansis"},{"email":"alex.parlato@mapbox.com","name":"aparlato"},{"email":"andrew@mapbox.com","name":"apendleton"},{"email":"aruna@mapbox.com","name":"arunasank"},{"email":"benjamin@mapbox.com","name":"benjamintd"},{"email":"bryan@mapbox.com","name":"bhousel"},{"email":"bhargav.kowshik@gmail.com","name":"bkowshik"},{"email":"blannon@gmail.com","name":"boblannon"},{"email":"brendan@mapbox.com","name":"brendanmcfarland"},{"email":"bharata+npm@mapbox.com","name":"bsrinivasa"},{"email":"bobby@mapbox.com","name":"bsudekum"},{"email":"camilla@mapbox.com","name":"camillacaros"},{"email":"nadia.barbosa@mapbox.com","name":"captainbarbosa"},{"email":"hello@chau-nguyen.de","name":"chaupow"},{"email":"chethan@mapbox.com","name":"chetangowda"},{"email":"chris.loer@mapbox.com","name":"chrisloer"},{"email":"colleen.mcginnis@mapbox.com","name":"colleenmcginnis"},{"email":"daniel+npm@trvx.org","name":"danieljh"},{"email":"danpat@danpat.net","name":"danpat"},{"email":"dan@mapbox.com","name":"danswick"},{"email":"dana.sulit@mapbox.com","name":"dasulit"},{"email":"david.dave.clark@gmail.com","name":"davidtheclark"},{"email":"damon@mapbox.com","name":"dnomadb"},{"email":"emily@mapbox.com","name":"emilymcafee"},{"email":"dubois@mapbox.com","name":"emilymdubois"},{"email":"fischer@mapbox.com","name":"enf"},{"email":"gokul.ganesan@mapbox.com","name":"fa7c0n"},{"email":"spam@freenerd.de","name":"freenerd"},{"email":"sajjadkm@gmail.com","name":"geohacker"},{"email":"ghoshkaj@gmail.com","name":"ghoshkaj"},{"email":"carol@mapbox.com","name":"gretacb"},{"email":"ian.villeda@gmail.com","name":"ian29"},{"email":"ian@mapbox.com","name":"ianshward"},{"email":"ingalls@protonmail.com","name":"ingalls"},{"email":"siyu.song@gmail.com","name":"isiyu"},{"email":"hi@jacquestardie.org","name":"jacquestardie"},{"email":"john.firebaugh@gmail.com","name":"jfirebaugh"},{"email":"jothirnadh@mapbox.com","name":"jothirnadh"},{"email":"jake@jakepruitt.com","name":"jrpruit1"},{"email":"kara.e.mahoney@gmail.com","name":"k-mahoney"},{"email":"kai@mapbox.com","name":"kaibot3000"},{"email":"kai@mapbox.com","name":"kaidalgleish"},{"email":"karen@mapbox.com","name":"karenzshea"},{"email":"decorah@mapbox.com","name":"katydecorah"},{"email":"0o3ko0@gmail.com","name":"kepta"},{"email":"mail@kkaefer.com","name":"kkaefer"},{"email":"laurier@mapbox.com","name":"l-r"},{"email":"l@pwd.io","name":"laurier"},{"email":"lauren@mapbox.com","name":"lbud"},{"email":"lily@mapbox.com","name":"lily-chai"},{"email":"lindsay@mapbox.com","name":"lndsay"},{"email":"me@lukasmartinelli.ch","name":"lukasmartinelli"},{"email":"alex@mapbox.com","name":"lxbarth"},{"email":"lyzi@mapbox.com","name":"lyzidiamond"},{"email":"emmanuel.sambale@gmail.com","name":"maning"},{"email":"manohar@mapbox.com","name":"manoharuss"},{"email":"accounts@mapbox.com","name":"mapbox-admin"},{"email":"accounts+npm-mapbox-machine-user@mapbox.com","name":"mapbox-machine-user"},{"email":"accounts+npmjs@mapbox.com","name":"mapbox-npm"},{"email":"accounts+npmjs-01@mapbox.com","name":"mapbox-npm-01"},{"email":"accounts+npmjs-02@mapbox.com","name":"mapbox-npm-02"},{"email":"accounts+npmjs-03@mapbox.com","name":"mapbox-npm-03"},{"email":"accounts+npmjs-04@mapbox.com","name":"mapbox-npm-04"},{"email":"accounts+npmjs-05@mapbox.com","name":"mapbox-npm-05"},{"email":"accounts+npmjs-06@mapbox.com","name":"mapbox-npm-06"},{"email":"accounts+npmjs-07@mapbox.com","name":"mapbox-npm-07"},{"email":"accounts+npmjs-08@mapbox.com","name":"mapbox-npm-08"},{"email":"accounts+npmjs-09@mapbox.com","name":"mapbox-npm-09"},{"email":"accounts+npmjs-advanced-actions@mapbox.com","name":"mapbox-npm-advanced-actions"},{"email":"accounts+npmjs-npm-ci@mapbox.com","name":"mapbox-npm-ci"},{"email":"sam@mapbox.com","name":"mapsam"},{"email":"matt@mattficke.com","name":"mattficke"},{"email":"mcwhittemore@gmail.com","name":"mcwhittemore"},{"email":"jeff@miccolis.net","name":"miccolis"},{"email":"mrcsother@gmail.com","name":"miles-dev"},{"email":"mollylloyd@gmail.com","name":"mollymerp"},{"email":"morgan.herlocker@gmail.com","name":"morganherlocker"},{"email":"agafonkin@gmail.com","name":"mourner"},{"email":"max@mapbox.com","name":"msirenko"},{"email":"krishna@mapbox.com","name":"nammala"},{"email":"nat@mapbox.com","name":"natslaughter"},{"email":"nick.cordella@mapbox.com","name":"nickcordella"},{"email":"nicki@mapbox.com","name":"nickidlugash"},{"email":"nikinfour@gmail.com","name":"nikhilprabhakar"},{"email":"oindrila.gupta92@gmail.com","name":"oini"},{"email":"olivia.brundage@mapbox.com","name":"oliikit"},{"email":"michael.krasnyk@gmail.com","name":"oxidase"},{"email":"paul@mapbox.com","name":"pdgoodman"},{"email":"perry@mapbox.com","name":"perrygeo"},{"email":"arun.planemad@gmail.com","name":"planemad"},{"email":"pratik@mapbox.com","name":"pratikyadav"},{"email":"rasagy@mapbox.com","name":"rasagy"},{"email":"ryan.clark.j@gmail.com","name":"rclark"},{"email":"r.ragupathy85@gmail.com","name":"rumc"},{"email":"ryan.baumann@mapbox.com","name":"ryan-baumann"},{"email":"abhishek@mapbox.com","name":"saikia.abhishek"},{"email":"saman@mapbox.com","name":"samanbb"},{"email":"eliane@mapbox.com","name":"samely"},{"email":"tlee@mapbox.com","name":"sbma44"},{"email":"sean@mapbox.com","name":"sgillies"},{"email":"dane@mapbox.com","name":"springmeyer"},{"email":"srividyabharadwaj26@gmail.com","name":"srividyacb"},{"email":"tim.channell@gmail.com","name":"tcql"},{"email":"patrick@mapbox.com","name":"themarex"},{"email":"tony.chen@mapbox.com","name":"tony-cj"},{"email":"tristen.brown@gmail.com","name":"tristen"},{"email":"upendra@mapbox.com","name":"upendrayadav"},{"email":"vincent.sarago@mapbox.com","name":"vincents"},{"email":"virginia@mapbox.com","name":"virginiayung"},{"email":"will@mapbox.com","name":"willwhite"},{"email":"young@mapbox.com","name":"yhahn"},{"email":"mully@mapbox.com","name":"zmully"}],"_npmUser":{"name":"mourner","email":"agafonkin@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/pbf_3.2.1_1570805238285_0.9869911493287453"},"_hasShrinkwrap":false,"readme":"# pbf\n\n[![build status](https://secure.travis-ci.org/mapbox/pbf.svg)](http://travis-ci.org/mapbox/pbf) [![Coverage Status](https://coveralls.io/repos/mapbox/pbf/badge.svg)](https://coveralls.io/r/mapbox/pbf)\n\nA low-level, fast, ultra-lightweight (3KB gzipped) JavaScript library for decoding and encoding [protocol buffers](https://developers.google.com/protocol-buffers), a compact binary format for structured data serialization. Works both in Node and the browser. Supports lazy decoding and detailed customization of the reading/writing code.\n\n## Performance\n\nThis library is extremely fast — much faster than native `JSON.parse`/`JSON.stringify`\nand the [protocol-buffers](https://github.com/mafintosh/protocol-buffers) module.\nHere's a result from running a real-world benchmark on Node v6.5\n(decoding and encoding a sample of 439 vector tiles, 22.6 MB total):\n\n- **pbf** decode: 387ms, or 57 MB/s\n- **pbf** encode: 396ms, or 56 MB/s\n- **protocol-buffers** decode: 837ms, or 26 MB/s\n- **protocol-buffers** encode: 4197ms, or 5 MB/s\n- **JSON.parse**: 1540ms, or 125 MB/s (parsing an equivalent 77.5 MB JSON file)\n- **JSON.stringify**: 607ms, or 49 MB/s\n\n## Examples\n\n#### Using Compiled Code\n\nInstall `pbf` and compile a JavaScript module from a `.proto` file:\n\n```bash\n$ npm install -g pbf\n$ pbf example.proto > example.js\n```\n\nThen read and write objects using the module like this:\n\n```js\nvar Pbf = require('pbf');\nvar Example = require('./example.js').Example;\n\n// read\nvar pbf = new Pbf(buffer);\nvar obj = Example.read(pbf);\n\n// write\nvar pbf = new Pbf();\nExample.write(obj, pbf);\nvar buffer = pbf.finish();\n```\n\nAlternatively, you can compile a module directly in the code:\n\n```js\nvar compile = require('pbf/compile');\nvar schema = require('protocol-buffers-schema');\n\nvar proto = schema.parse(fs.readFileSync('example.proto'));\nvar Test = compile(proto).Test;\n```\n\nIf you use `webpack` as your module bundler, you can use [pbf-loader](https://github.com/trivago/pbf-loader)\nto load .proto files directly. It returns a compiled module ready to be used.\n\nGiven you already configured your `webpack.config.js`, the code above would look like:\n```js\nvar Pbf = require('pbf');\nvar proto = require('./example.proto');\n\nvar Test = proto.Test;\n```\n\n#### Custom Reading\n\n```js\nvar data = new Pbf(buffer).readFields(readData, {});\n\nfunction readData(tag, data, pbf) {\n    if (tag === 1) data.name = pbf.readString();\n    else if (tag === 2) data.version = pbf.readVarint();\n    else if (tag === 3) data.layer = pbf.readMessage(readLayer, {});\n}\nfunction readLayer(tag, layer, pbf) {\n    if (tag === 1) layer.name = pbf.readString();\n    else if (tag === 3) layer.size = pbf.readVarint();\n}\n```\n\n#### Custom Writing\n\n```js\nvar pbf = new Pbf();\nwriteData(data, pbf);\nvar buffer = pbf.finish();\n\nfunction writeData(data, pbf) {\n    pbf.writeStringField(1, data.name);\n    pbf.writeVarintField(2, data.version);\n    pbf.writeMessage(3, writeLayer, data.layer);\n}\nfunction writeLayer(layer, pbf) {\n    pbf.writeStringField(1, layer.name);\n    pbf.writeVarintField(2, layer.size);\n}\n```\n\n## Install\n\nNode and Browserify:\n\n```bash\nnpm install pbf\n```\n\nMaking a browser build:\n\n```bash\nnpm install\nnpm run build-dev # dist/pbf-dev.js (development build)\nnpm run build-min # dist/pbf.js (minified production build)\n```\n\nCDN link: https://unpkg.com/pbf@3.0.5/dist/pbf.js\n\n## API\n\nCreate a `Pbf` object, optionally given a `Buffer` or `Uint8Array` as input data:\n\n```js\n// parse a pbf file from disk in Node\nvar pbf = new Pbf(fs.readFileSync('data.pbf'));\n\n// parse a pbf file in a browser after an ajax request with responseType=\"arraybuffer\"\nvar pbf = new Pbf(new Uint8Array(xhr.response));\n```\n\n`Pbf` object properties:\n\n```js\npbf.length; // length of the underlying buffer\npbf.pos; // current offset for reading or writing\n```\n\n#### Reading\n\nRead a sequence of fields:\n\n```js\npbf.readFields(function (tag) {\n    if (tag === 1) pbf.readVarint();\n    else if (tag === 2) pbf.readString();\n    else ...\n});\n```\n\nIt optionally accepts an object that will be passed to the reading function for easier construction of decoded data,\nand also passes the `Pbf` object as a third argument:\n\n```js\nvar result = pbf.readFields(callback, {})\n\nfunction callback(tag, result, pbf) {\n    if (tag === 1) result.id = pbf.readVarint();\n}\n```\n\nTo read an embedded message, use `pbf.readMessage(fn[, obj])` (in the same way as `read`).\n\nRead values:\n\n```js\nvar value = pbf.readVarint();\nvar str = pbf.readString();\nvar numbers = pbf.readPackedVarint();\n```\n\nFor lazy or partial decoding, simply save the position instead of reading a value,\nthen later set it back to the saved value and read:\n\n```js\nvar fooPos = -1;\npbf.readFields(function (tag) {\n    if (tag === 1) fooPos = pbf.pos;\n});\n...\npbf.pos = fooPos;\npbf.readMessage(readFoo);\n```\n\nScalar reading methods:\n\n* `readVarint(isSigned)` (pass `true` if you expect negative varints)\n* `readSVarint()`\n* `readFixed32()`\n* `readFixed64()`\n* `readSFixed32()`\n* `readSFixed64()`\n* `readBoolean()`\n* `readFloat()`\n* `readDouble()`\n* `readString()`\n* `readBytes()`\n* `skip(value)`\n\nPacked reading methods:\n\n* `readPackedVarint(arr, isSigned)` (appends read items to `arr`)\n* `readPackedSVarint(arr)`\n* `readPackedFixed32(arr)`\n* `readPackedFixed64(arr)`\n* `readPackedSFixed32(arr)`\n* `readPackedSFixed64(arr)`\n* `readPackedBoolean(arr)`\n* `readPackedFloat(arr)`\n* `readPackedDouble(arr)`\n\n#### Writing\n\nWrite values:\n\n```js\npbf.writeVarint(123);\npbf.writeString(\"Hello world\");\n```\n\nWrite an embedded message:\n\n```js\npbf.writeMessage(1, writeObj, obj);\n\nfunction writeObj(obj, pbf) {\n    pbf.writeStringField(obj.name);\n    pbf.writeVarintField(obj.version);\n}\n```\n\nField writing methods:\n\n* `writeVarintField(tag, val)`\n* `writeSVarintField(tag, val)`\n* `writeFixed32Field(tag, val)`\n* `writeFixed64Field(tag, val)`\n* `writeSFixed32Field(tag, val)`\n* `writeSFixed64Field(tag, val)`\n* `writeBooleanField(tag, val)`\n* `writeFloatField(tag, val)`\n* `writeDoubleField(tag, val)`\n* `writeStringField(tag, val)`\n* `writeBytesField(tag, buffer)`\n\nPacked field writing methods:\n\n* `writePackedVarint(tag, val)`\n* `writePackedSVarint(tag, val)`\n* `writePackedSFixed32(tag, val)`\n* `writePackedSFixed64(tag, val)`\n* `writePackedBoolean(tag, val)`\n* `writePackedFloat(tag, val)`\n* `writePackedDouble(tag, val)`\n\nScalar writing methods:\n\n* `writeVarint(val)`\n* `writeSVarint(val)`\n* `writeSFixed32(val)`\n* `writeSFixed64(val)`\n* `writeBoolean(val)`\n* `writeFloat(val)`\n* `writeDouble(val)`\n* `writeString(val)`\n* `writeBytes(buffer)`\n\nMessage writing methods:\n\n* `writeMessage(tag, fn[, obj])`\n* `writeRawMessage(fn[, obj])`\n\nMisc methods:\n\n* `realloc(minBytes)` - pad the underlying buffer size to accommodate the given number of bytes;\n   note that the size increases exponentially, so it won't necessarily equal the size of data written\n* `finish()` - make the current buffer ready for reading and return the data as a buffer slice\n* `destroy()` - dispose the buffer\n\nFor an example of a real-world usage of the library, see [vector-tile-js](https://github.com/mapbox/vector-tile-js).\n\n\n## Proto Schema to JavaScript\n\nIf installed globally, `pbf` provides a binary that compiles `proto` files into JavaScript modules. Usage:\n\n```bash\n$ pbf <proto_path> [--no-write] [--no-read] [--browser]\n```\n\nThe `--no-write` and `--no-read` switches remove corresponding code in the output.\nThe `--browser` switch makes the module work in browsers instead of Node.\n\nThe resulting module exports each message by name with the following methods:\n\n* `read(pbf)` - decodes an object from the given `Pbf` instance\n* `write(obj, pbf)` - encodes an object into the given `Pbf` instance (usually empty)\n\nThe resulting code is clean and simple, so feel free to customize it.\n\n## Changelog\n\n#### 3.2.1 (Oct 11, 2019)\n\n- Significantly improved performance when decoding large strings in the browser.\n\n#### 3.2.0 (Mar 11, 2019)\n\n- Improved decoding to be able to parse repeated fields even if they were specified as packed, and vise versa.\n- Improved packed encoding to skip empty arrays (previously, it would write a tag).\n- Fixed an off-by-one data corruption bug when writing a message larger than 0x10000000 bytes.\n\n#### 3.1.0 (Sep 27, 2017)\n\n- Added support for Protocol Buffer 3 [maps](https://developers.google.com/protocol-buffers/docs/proto3#maps) to proto compiler.\n\n#### 3.0.5 (Nov 30, 2016)\n\n- Fixed an error appearing in some versions of IE11 and old Android browsers.\n\n#### 3.0.4 (Nov 14, 2016)\n\n- Fixed compiling repeated packed enum fields.\n\n#### 3.0.3 (Nov 14, 2016)\n\n- Fixed a regression that broke compiling repeated enum fields with defaults.\n\n#### 3.0.2 (Sep 30, 2016)\n\n- Fixed a regression that broke decoding of packed fields with a tag that didn't fit into one byte.\n\n#### 3.0.1 (Sep 20, 2016)\n\n- Fixed a regression that broke encoding of long strings.\n\n#### 3.0.0 (Aug 30, 2016)\n\nThis release include tons of compatibility/robustness fixes, and a more reliable Node implementation. Decoding performance is expected to get up to ~15% slower than v2.0 in Node (browsers are unaffected), but encoding got faster by ~15% in return.\n\n##### Encoder/decoder\n\n- **Breaking**: changed Node implementation to use `Uint8Array` instead of `Buffer` internally (and produce corresponding result on `finish()`), making it fully match the browser implementation for consistency and simplicity.\n- Fixed `writeVarint` to write `0` when given `NaN` or other non-number to avoid producing a broken Protobuf message.\n- Changed `readPacked*` methods signature to accept an optional `arr` argument to append the results to (to support messages with repeated fields that mix packed/non-packed encoding).\n- Added an optional `isSigned` argument to `readVarint` that enables proper reading of negative varints.\n- Deprecated `readVarint64()` (it still works, but it's recommended to be changed to `readVarint(true)`).\n- Faster string encoding.\n\n##### Proto compiler\n\n- **Breaking:** Full support for defaults field values (both implicit and explicit); they're now included in the decoded JSON objects.\n- Fixed reading of repeated fields with mixed packed/non-packed encoding for compatibility.\n- Fixed proto3 compiler to use packed by default for repeated scalar fields.\n- Fixed reading of negative varint types.\n- Fixed packed fields to decode into `[]` if they're not present.\n- Fixed nested message references handling.\n- Fixed `packed=false` being interpreted as packed.\n- Added a comment to generated code with pbf version number.\n\n#### 2.0.1 (May 28, 2016)\n\n- Fixed a regression with `writeVarint` that affected certain numbers.\n\n#### 2.0.0 (May 28, 2016)\n\n- Significantly improved the proto compiler, which now produces a much safer reading/writing code.\n- Added the ability to compile a read/write module from a protobuf schema directly in the code.\n- Proto compiler: fixed name resolutions and collisions in schemas with nested messages.\n- Proto compiler: fixed broken top-level enums.\n\n#### 1.3.7 (May 28, 2016)\n\n- Fixed a regression with `writeVarint` that affected certain numbers.\n\n#### 1.3.6 (May 27, 2016)\n\n- Improved read and write performance (both ~15% faster).\n- Improved generated code for default values.\n\n#### 1.3.5 (Oct 5, 2015)\n\n- Added support for `syntax` keyword proto files (by updating `resolve-protobuf-schema` dependency).\n\n#### 1.3.4 (Jul 31, 2015)\n\n- Added `writeRawMessage` method for writing a message without a tag, useful for creating pbfs with multiple top-level messages.\n\n#### 1.3.2 (Mar 5, 2015)\n\n- Added `readVarint64` method for proper decoding of negative `int64`-encoded values.\n\n#### 1.3.1 (Feb 20, 2015)\n\n- Fixed pbf proto compile tool generating broken writing code.\n\n#### 1.3.0 (Feb 5, 2015)\n\n- Added `pbf` binary that compiles `.proto` files into `Pbf`-based JavaScript modules.\n\n#### 1.2.0 (Jan 5, 2015)\n\n##### Breaking API changes\n\n- Changed `writeMessage` signature to `(tag, fn, obj)` (see example in the docs)\n  for a huge encoding performance improvement.\n- Replaced `readPacked` and `writePacked` methods that accept type as a string\n  with `readPackedVarint`, etc. for each type (better performance and simpler API).\n\n##### Improvements\n\n- 5x faster encoding in Node (vector tile benchmark).\n- 40x faster encoding and 3x faster decoding in the browser (vector tile benchmark).\n\n#### 1.1.4 (Jan 2, 2015)\n\n- Significantly improved `readPacked` and `writePacked` performance (the tile reading benchmark is now 70% faster).\n\n#### 1.1.3 (Dec 26, 2014)\n\nBrings tons of improvements and fixes over the previous version (`0.0.2`).\nBasically makes the library complete.\n\n##### Improvements\n\n- Improved performance of both reading and writing.\n- Made the browser build 3 times smaller.\n- Added convenience `readFields` and `readMessage` methods for a much easier reading API.\n- Added reading methods: `readFloat`, `readBoolean`, `readSFixed32`, `readSFixed64`.\n- Added writing methods: `writeUInt64`, `writeSFixed32`, `writeSFixed64`.\n- Improved `readDouble` and `readString` to use native Buffer methods under Node.\n- Improved `readString` and `writeString` to use HTML5 `TextEncoder` and `TextDecoder` where available.\n- Made `Pbf` `buffer` argument optional.\n- Added extensive docs and examples in the readme.\n- Added an extensive test suite that brings test coverage up to 100%.\n\n##### Breaking API changes\n\n- Renamed `readBuffer`/`writeBuffer` to `readBytes`/`writeBytes`.\n- Renamed `readUInt32`/`writeUInt32` to `readFixed32`/`writeFixed32`, etc.\n- Renamed `writeTaggedVarint` to `writeVarintField`, etc.\n- Changed `writePacked` signature from `(type, tag, items)` to `(tag, type, items)`.\n\n##### Bugfixes\n\n- Fixed `readVarint` to handle varints bigger than 6 bytes.\n- Fixed `readSVarint` to handle number bigger than `2^30`.\n- Fixed `writeVarint` failing on some integers.\n- Fixed `writeVarint` not throwing an error on numbers that are too big.\n- Fixed `readUInt64` always failing.\n- Fixed writing to an empty buffer always failing.\n","publish_time":1570805238397,"_cnpm_publish_time":1570805238397,"dist-tags":{"latest":"5.2.0"}}