{"_id":"dataview2","_rev":"4212312","name":"dataview2","description":"Efficient DataView for isomorphic libraries","dist-tags":{"latest":"1.0.0"},"maintainers":[{"name":"mohayonao","email":""}],"time":{"modified":"2026-03-04T17:06:57.000Z","created":"2015-05-04T03:52:13.645Z","1.0.0":"2015-12-04T21:35:06.089Z","0.1.0":"2015-05-04T03:52:13.645Z"},"users":{},"author":{"name":"nao yonamine","email":"mohayonao@gmail.com"},"repository":{"type":"git","url":"git://github.com/mohayonao/dataview2.git"},"versions":{"1.0.0":{"name":"dataview2","description":"Efficient DataView for isomorphic libraries","version":"1.0.0","author":{"name":"nao yonamine","email":"mohayonao@gmail.com"},"bugs":{"url":"https://github.com/mohayonao/dataview2/issues"},"dependencies":{"buffer-dataview":"0.0.2"},"devDependencies":{"mocha":"^2.3.4"},"files":["package.json","index.js","README.md"],"homepage":"http://mohayonao.github.io/dataview2/","keywords":["dataview"],"license":"MIT","main":"./index.js","repository":{"type":"git","url":"git://github.com/mohayonao/dataview2.git"},"scripts":{"test":"mocha","travis":"npm run test"},"gitHead":"bf246e38b6c6e0533246898ea7fbfb5d4783054a","_id":"dataview2@1.0.0","_shasum":"a17d327d0b511ce954ef23ebfb0e2875d294440e","_from":".","_npmVersion":"3.3.6","_nodeVersion":"4.1.2","_npmUser":{"name":"mohayonao","email":"mohayonao@gmail.com"},"dist":{"shasum":"a17d327d0b511ce954ef23ebfb0e2875d294440e","size":1195,"noattachment":false,"key":"/dataview2/-/dataview2-1.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/dataview2/download/dataview2-1.0.0.tgz"},"maintainers":[{"name":"mohayonao","email":""}],"directories":{},"publish_time":1449264906089,"_hasShrinkwrap":false,"_cnpm_publish_time":1449264906089,"_cnpmcore_publish_time":"2021-12-17T11:01:03.261Z"},"0.1.0":{"name":"dataview2","description":"isomorphic DataView API","version":"0.1.0","author":{"name":"nao yonamine","email":"mohayonao@gmail.com"},"bugs":{"url":"https://github.com/mohayonao/dataview2/issues"},"dependencies":{"buffer-dataview":"0.0.2"},"devDependencies":{"mocha":"^2.2.4"},"files":["package.json","index.js","README.md"],"homepage":"http://mohayonao.github.io/dataview2/","keywords":["dataview"],"license":"MIT","main":"./index.js","repository":{"type":"git","url":"git://github.com/mohayonao/dataview2.git"},"scripts":{"test":"mocha","travis":"npm run test"},"gitHead":"4029b88a5b583265901a3a707ed511fb11cae3ef","_id":"dataview2@0.1.0","_shasum":"c7a35e236adfe4fafebf0c8b2c8b0fbc459327d8","_from":".","_npmVersion":"2.5.1","_nodeVersion":"0.12.0","_npmUser":{"name":"mohayonao","email":"mohayonao@gmail.com"},"maintainers":[{"name":"mohayonao","email":""}],"dist":{"shasum":"c7a35e236adfe4fafebf0c8b2c8b0fbc459327d8","size":1185,"noattachment":false,"key":"/dataview2/-/dataview2-0.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/dataview2/download/dataview2-0.1.0.tgz"},"directories":{},"publish_time":1430711533645,"_hasShrinkwrap":false,"_cnpm_publish_time":1430711533645,"_cnpmcore_publish_time":"2021-12-17T11:01:03.489Z"}},"readme":"# dataview2\n[![Build Status](http://img.shields.io/travis/mohayonao/dataview2.svg?style=flat-square)](https://travis-ci.org/mohayonao/dataview2)\n[![NPM Version](http://img.shields.io/npm/v/dataview2.svg?style=flat-square)](https://www.npmjs.org/package/dataview2)\n[![License](http://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square)](http://mohayonao.mit-license.org/)\n> Efficient DataView for isomorphic libraries\n\n## Installation\n\nnpm:\n\n```\nnpm install dataview2\n```\n\n## API\n- `DataView2(buffer: Buffer|ArrayBuffer): BufferDataView|DataView`\n  - node.js: returns an instance of [`BufferDataView`](https://github.com/TooTallNate/node-buffer-dataview)\n  - browser: returns an instance of `DataView`\n- `Buffer2(n: size): Buffer|ArrayBuufer`\n  - node.js: return an instance of `Buffer`\n  - browser: return an instance of `ArrayBuffer`\n\n## Examples\n\nuse Buffer in the Node.js\n\n```js\nvar buffer = new Buffer2(4); // → Buffer\nvar view = new DataView2(buffer); // → BufferDataView\n\n// set a \"float\" in the data view\nview.setFloat32(0, 1337.1234, true);\n\n// ensure that the original Buffer was modified\nconsole.log(buffer.readFloatLE(0));\n// → 1337.1234130859375\n\nconsole.log(view.buffer instanceof Buffer);\n// → true\n```\n\nuse ArrayBuffer in the browser\n\n```js\nvar buffer new Buffer2(4); // → ArrayBuffer\nvar view = new DataView2(buffer); // → DataView\n\n// set a \"float\" in the data view\nview.setFloat32(0, 1337.1234, true);\n\nconsole.log(view.buffer instanceof ArrayBuffer);\n// → true\n\n// ensure that the original ArrayBuffer was modified\nconsole.log(new Float32Array(buffer)[0]);\n// → 1337.1234130859375\n```\n\n## License\nMIT\n","_attachments":{},"homepage":"http://mohayonao.github.io/dataview2/","bugs":{"url":"https://github.com/mohayonao/dataview2/issues"},"license":"MIT"}