{"name":"jdataview","version":"2.3.0","description":"A unique way to work with a binary file in the browser and the server.","keywords":["buffer","binary","data","file","dataview","read","write","manipulation"],"homepage":"http://blog.vjeux.com/2011/javascript/jdataview-read-binary-file.html","author":{"name":"Vjeux","email":"vjeuxx@gmail.com","url":"http://blog.vjeux.com/"},"contributors":[{"name":"Vjeux","email":"vjeuxx@gmail.com","url":"http://blog.vjeux.com/"},{"name":"RReverser","email":"me@rreverser.com","url":"http://rreverser.com"}],"files":["src/jdataview.js"],"main":"src/jdataview.js","scripts":{"test":"cd test && node test.runner","posttest":"node test/publish"},"repository":{"type":"git","url":"git://github.com/jDataView/jDataView.git"},"devDependencies":{"jshint":">= 2.1.0","npm":"*","mocha":"~1.12.0","qunit-mocha-ui":"*"},"bugs":{"url":"https://github.com/jDataView/jDataView/issues"},"_id":"jdataview@2.3.0","dist":{"shasum":"4982f4bb80f201ff046aa846f706f2ce1f72bf3d","tarball":"http://registry-npm.ywwl.com/jdataview/download/jdataview-2.3.0.tgz","integrity":"sha512-HtNrHJaqvdwXMXBIxmnpjOj0KM0H0OS4uhp6Q5dEH9u3rEpIip0A0ao7h4Segf5hb5RvOEF4Hfq146Iot294Mw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBxBu3TJOnjO/M245K7HYrCpJRKP0hUYcIXDTu5JSPB/AiEAo9O3Q8/Ba+d9/rmBExHe1pxHLfmcK6HWCP9jkpPRAqU="}],"size":9560,"noattachment":false,"key":"/jdataview/-/jdataview-2.3.0.tgz"},"_from":".","_npmVersion":"1.2.30","_npmUser":{"name":"rreverser","email":"me@rreverser.com"},"maintainers":[{"name":"rreverser","email":"me@rreverser.com"}],"directories":{},"readme":"[![Gitter](https://badges.gitter.im/Join Chat.svg)](https://gitter.im/jDataView/jDataView?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)\n[![Build Status](https://travis-ci.org/jDataView/jDataView.png?branch=master)](https://travis-ci.org/jDataView/jDataView)\n[![NPM version](https://badge.fury.io/js/jdataview.png)](https://npmjs.org/package/jdataview)\n[jDataView](http://blog.vjeux.com/2011/javascript/jdataview-read-binary-file.html) - A unique way to work with a binary file in JavaScript.\n================================\n\njDataView provides convenient way to read and/or modify binary data in all the browsers. It follows the [DataView Specification](http://www.khronos.org/registry/typedarray/specs/latest/#8) and even extends it for a more practical use.\n\nExplanation\n===========\n\nThere are three ways to read a binary file from the browser.\n\n* The first one is to download the file through XHR with [charset=x-user-defined](https://developer.mozilla.org/en/using_xmlhttprequest#Receiving_binary_data). You get the file as a **String**, convert it to byte **Array** and you have to rewrite all the decoding and encoding functions (getUint16, getFloat32, ...). All the browsers support this.\n\n* Then browsers that implemented **Canvas** also added **CanvasPixelArray** as part of **ImageData**. It is fast byte array that is created and used internally by `<canvas />` element for manipulating low-level image data. We can create such host element and use it as factory for our own instances of this array.\n\n* Then browsers that implemented **WebGL** added **ArrayBuffer**. It is a plain buffer that can be read with views called **TypedArrays** (Int32Array, Float64Array, ...). You can use them to decode the file but this is not very handy. It has big drawback, it can't read non-aligned data (but we can actually hack that). So they replaced **CanvasPixelArray** with **Uint8ClampedArray** (same as Uint8Array, but cuts off numbers outside 0..255 range).\n\n* A new revision of the specification added **DataViews**. It is a view around your buffer that can read/write arbitrary data types directly through functions: getUint32, getFloat64 ...\n\nAnd one way to read a binary file from the server.\n\n* **NodeJS Buffers**. They appeared in [Node 0.4.0](http://nodejs.org/docs/v0.4.0/api/buffers.html). [Node 0.5.0](http://nodejs.org/docs/v0.5.0/api/buffers.html) added a DataView-like API. And [Node 0.6.0](http://nodejs.org/docs/v0.6.0/api/buffers.html) changed the API naming convention.\n\n**jDataView** provides the **DataView API** with own convenient extensions using the best available option between Arrays, TypedArrays, NodeJS Buffers and DataViews.\n\nDocumentation\n=============\n\n  * API\n    * [jDataView constructor](https://github.com/jDataView/jDataView/wiki/jDataView-constructor)\n    * [DataView Specification](http://www.khronos.org/registry/typedarray/specs/latest/#8)\n    * Extended Specification\n      * [Operation control](https://github.com/jDataView/jDataView/wiki/Operation-control)\n      * [writeXXX methods](https://github.com/jDataView/jDataView/wiki/writeXXX-methods)\n      * [Strings and Blobs](https://github.com/jDataView/jDataView/wiki/Strings-and-Blobs)\n      * [64-bit integers](https://github.com/jDataView/jDataView/wiki/64-bit-integers)\n      * [Bitfields](https://github.com/jDataView/jDataView/wiki/Bitfields)\n      * [Internal utilities](https://github.com/jDataView/jDataView/wiki/Internal-utilities)\n  * [Example](https://github.com/jDataView/jDataView/wiki/Example)\n  * [Changelog](https://github.com/jDataView/jDataView/blob/master/CHANGELOG.md)\n\nAdvanced usage ([jBinary](https://github.com/jDataView/jBinary))\n========================\n\nFor complicated binary structures, it may be hard enough to use only low-level get/set operations for parsing,\nprocessing and writing data.\n\nIn addition, most likely you might need convenient I/O methods for retrieving data from external sources such like\nlocal files (using File API or from Node.js), remote files (via HTTP(S)), data-URIs, Node.js streams etc. as well\nas for displaying generated content to user on webpage in image/video/audio/... containers\nor even as simple download link.\n\nIf you faced any of these problems, you might want to check out new [jBinary](https://github.com/jDataView/jBinary)\nlibrary that works on top of **jDataView** and allows to operate with binary data in structured and convenient way.\n\nDemos\n=====\n\n[HTTP Live Streaming realtime converter and player demo](http://rreverser.github.io/mpegts/) implemented using [jBinary](https://github.com/jDataView/jBinary) data structures.\n[![Screenshot](http://rreverser.github.io/mpegts/screenshot.png?)](http://rreverser.github.io/mpegts/)\n\n---\n\nA [World of Warcraft Model Viewer](http://jdataview.github.io/jsWoWModelViewer/). It uses [jDataView](https://github.com/jDataView/jDataView)+[jBinary](https://github.com/jDataView/jBinary) to read the binary file and then WebGL to display it.\n[![Screenshot](http://jdataview.github.io/jsWoWModelViewer/images/modelviewer.png)](http://jdataview.github.io/jsWoWModelViewer/)\n\n---\n\nA [PhotoSynth WebGL Viewer](http://www.visual-experiments.com/2011/04/05/photosynth-webgl-viewer/) by Visual Experiments. It uses jDataView to read the binary file and then WebGL to display it.\n[![Screenshot](http://i.imgur.com/HRHXo.jpg)](http://www.visual-experiments.com/2011/04/05/photosynth-webgl-viewer/)\n\n---\n\nA [simple tar viewer](http://jdataview.github.io/jDataView/untar/). It is a \"Hello World\" demo of how easy it is to use the library.\n\n---\n\nJavaScript [TrueTypeFont library demo](http://ynakajima.github.io/ttf.js/demo/glyflist/) which uses jDataView to read and display glyphs from TrueType file.\n\n--\n\n[jBinary.Repo](https://jdataview.github.io/jBinary.Repo) ready-to-use typesets and corresponding demos of using\n[jDataView](https://github.com/jDataView/jDataView)+[jBinary](https://github.com/jDataView/jBinary)\nfor reading popular file formats like\n[GZIP archives](https://jdataview.github.io/jBinary.Repo/demo/#gzip),\n[TAR archives](https://jdataview.github.io/jBinary.Repo/demo/#tar),\n[ICO images](https://jdataview.github.io/jBinary.Repo/demo/#ico),\n[BMP images](https://jdataview.github.io/jBinary.Repo/demo/#bmp),\n[MP3 tags](https://jdataview.github.io/jBinary.Repo/demo/#mp3)\netc.\n\n---\n\n[Talking image](http://hacksparrow.github.io/talking-image/) - animation and audio in one package powered by\nHTML5 Audio, [jDataView](https://github.com/jDataView/jDataView) and [jBinary](https://github.com/jDataView/jBinary).\n\n---\n\n*Please tell us if you made something with jDataView :)*\n\nLicense\n=======\n\njDataView is issued under [Do What The Fuck You Want To Public License](http://sam.zoy.org/wtfpl/) :)\n","publish_time":1374940802136,"_cnpm_publish_time":1374940802136,"dist-tags":{"latest":"2.5.0"}}