{
  "name": "bytebuffer",
  "version": "2.3.1",
  "author": {
    "name": "Daniel Wirtz",
    "email": "dcode@dcode.io"
  },
  "description": "A full-featured ByteBuffer implementation using typed arrays.",
  "main": "ByteBuffer.js",
  "repository": {
    "type": "git",
    "url": "https://github.com/dcodeIO/ByteBuffer.js.git"
  },
  "bugs": {
    "url": "https://github.com/dcodeIO/ByteBuffer.js/issues"
  },
  "keywords": [
    "net",
    "array",
    "buffer",
    "arraybuffer",
    "typed array",
    "bytebuffer",
    "json",
    "websocket",
    "webrtc"
  ],
  "dependencies": {
    "long": "latest"
  },
  "devDependencies": {
    "testjs": "latest",
    "preprocessor": "latest",
    "closurecompiler": "latest"
  },
  "license": "Apache-2.0",
  "engines": {
    "node": ">=0.8"
  },
  "scripts": {
    "prepublish": "npm test",
    "test": "node node_modules/testjs/bin/testjs tests/suite.js",
    "make": "npm run-script build && npm run-script compile && npm run-script noexpose && npm test && npm run-script jsdoc",
    "build": "node build.js",
    "compile": "ccjs ByteBuffer.js --create_source_map=ByteBuffer.min.map --compilation_level=ADVANCED_OPTIMIZATIONS --externs=externs/minimal-env.js --externs=externs/Long.js > ByteBuffer.min.js",
    "noexpose": "cat ByteBuffer.js | grep -v @expose > ByteBuffer.noexpose.js",
    "jsdoc": "jsdoc -c jsdoc.json"
  },
  "readme": "![ByteBuffer.js - A full-featured ByteBuffer implementation in JavaScript](https://raw.github.com/dcodeIO/ByteBuffer.js/master/ByteBuffer.png)\r\n======================================\r\nProvides a full-featured ByteBuffer implementation using typed arrays. It's one of the core components driving\r\n[ProtoBuf.js](https://github.com/dcodeIO/ProtoBuf.js) and the [PSON](https://github.com/dcodeIO/PSON) reference\r\nimplementation.\r\n\r\n*Note:* The API behind #toHex and #toString has changed with ByteBuffer 2, which is a generally revised release, in\r\nfavor of making this more intuitive.\r\n\r\nWhat can it do?\r\n---------------\r\n* Mimics Java ByteBuffers as close as reasonable while using typed array terms\r\n* Signed and unsigned integers (8, 16, 32, 64 bit through [Long.js](https://github.com/dcodeIO/Long.js)) with endianness support\r\n* 32 and 64 bit floats\r\n* Varints as known from protobuf including zig-zag encoding\r\n* Includes an UTF8 and Base64 en-/decoder\r\n* C-strings, V(arint-prefixed)-strings and UTF8 L(ength-prefixed)-strings \r\n* Rich string toolset (to hex, base64, binary, utf8, debug, columns)\r\n* Relative and absolute zero-copy operations\r\n* Manual and automatic resizing (efficiently doubles capacity)\r\n* Chaining of all operations that do not return a specific value\r\n* Slicing, appending, prepending, reversing, flip, mark, reset, etc.\r\n\r\nAnd much more...\r\n\r\nFeatures\r\n--------\r\n* [CommonJS](http://www.commonjs.org/) compatible\r\n* [RequireJS](http://requirejs.org/)/AMD compatible\r\n* [node.js](http://nodejs.org) compatible, also available via [npm](https://npmjs.org/package/bytebuffer)\r\n* Browser compatible\r\n* [Closure Compiler](https://developers.google.com/closure/compiler/) ADVANCED_OPTIMIZATIONS compatible (fully annotated,\r\n  `ByteBuffer.min.js` has been compiled this way, `ByteBuffer.min.map` is the source map)\r\n* Fully documented using [jsdoc3](https://github.com/jsdoc3/jsdoc)\r\n* Well tested through [nodeunit](https://github.com/caolan/nodeunit)\r\n* Zero production dependencies (Long.js is optional)\r\n* Small footprint\r\n\r\nUsage\r\n-----\r\n### Node.js / CommonJS ###\r\n* Install: `npm install bytebuffer`\r\n\r\n```javascript\r\nvar ByteBuffer = require(\"bytebuffer\");\r\nvar bb = new ByteBuffer();\r\nbb.writeLString(\"Hello world!\").flip();\r\nconsole.log(bb.readLString()+\" from ByteBuffer.js\");\r\n```\r\n\r\n### Browser ###\r\n\r\nOptionally depends on [Long.js](https://github.com/dcodeIO/Long.js) for long (int64) support. If you do not require long\r\nsupport, you can skip the Long.js include.\r\n\r\n```html\r\n<script src=\"Long.min.js\"></script>\r\n<script src=\"ByteBuffer.min.js\"></script>\r\n```\r\n\r\n```javascript\r\nvar ByteBuffer = dcodeIO.ByteBuffer;\r\nvar bb = new ByteBuffer();\r\nbb.writeLString(\"Hello world!\").flip();\r\nalert(bb.readLString()+\" from ByteBuffer.js\");\r\n```\r\n\r\n### Require.js / AMD ###\r\n\r\nOptionally depends on [Long.js](https://github.com/dcodeIO/Long.js) for long (int64) support. If you do not require long\r\nsupport, you can skip the Long.js config. [Require.js](http://requirejs.org/) example:\r\n\r\n```javascript\r\nrequire.config({\r\n    \"paths\": {\r\n        \"Long\": \"/path/to/Long.js\"\r\n        \"ByteBuffer\": \"/path/to/ByteBuffer.js\"\r\n    }\r\n});\r\nrequire([\"ByteBuffer\"], function(ByteBuffer) {\r\n    var bb = new ByteBuffer();\r\n    bb.writeLString(\"Hello world!\");\r\n    bb.flip();\r\n    alert(bb.readLString()+\" from ByteBuffer.js\");\r\n});\r\n```\r\n\r\nOn long (int64) support\r\n-----------------------\r\nAs of the [ECMAScript specification](http://ecma262-5.com/ELS5_HTML.htm#Section_8.5), number types have a maximum value\r\nof 2^53. Beyond that, behaviour might be unexpected. However, real long support requires the full 64 bits\r\nwith the possibility to perform bitwise operations on the value for varint en-/decoding. So, to enable true long support\r\nin ByteBuffer.js, it optionally depends on [Long.js](https://github.com/dcodeIO/Long.js), which actually utilizes two\r\n32 bit numbers internally. If you do not require long support at all, you can skip it and save the additional bandwidth.\r\nOn node, long support is available by default through the [long](https://npmjs.org/package/long) dependency.\r\n\r\nDownloads\r\n---------\r\n* [ZIP-Archive](https://github.com/dcodeIO/ByteBuffer.js/archive/master.zip)\r\n* [Tarball](https://github.com/dcodeIO/ByteBuffer.js/tarball/master)\r\n\r\nDocumentation\r\n-------------\r\n* [View the API documentation](http://htmlpreview.github.com/?http://github.com/dcodeIO/ByteBuffer.js/master/docs/ByteBuffer.html)\r\n\r\nTests (& Examples) [![Build Status](https://travis-ci.org/dcodeIO/ByteBuffer.js.png?branch=master)](https://travis-ci.org/dcodeIO/ByteBuffer.js)\r\n------------------\r\n* [View source](https://github.com/dcodeIO/ByteBuffer.js/blob/master/tests/suite.js)\r\n* [View report](https://travis-ci.org/dcodeIO/ByteBuffer.js)\r\n\r\nSupport for IE<10, FF<15, Chrome<9 etc.\r\n---------------------------------------\r\n* Requires working ArrayBuffer & DataView implementations (i.e. use a [polyfill](https://github.com/inexorabletash/polyfill#typed-arrays-polyfill))\r\n\r\nContributors\r\n------------\r\n[Dretch](https://github.com/Dretch) (IE8 compatibility)\r\n\r\nLicense\r\n-------\r\nApache License, Version 2.0 - http://www.apache.org/licenses/LICENSE-2.0.html\r\n",
  "readmeFilename": "README.md",
  "_id": "bytebuffer@2.3.1",
  "dist": {
    "shasum": "fba3d33e1337ee95c33aee88da1950f846bd441a"
  },
  "_from": "bytebuffer@>=2.2 <3",
  "_resolved": "https://registry.npmjs.org/bytebuffer/-/bytebuffer-2.3.1.tgz"
}
