to-data-view
Create a `DataView` over an `ArrayBuffer`/8-bit typed array (commonly used in the browsers) or a `Buffer` (commonly used in Node.js).
Last updated 3 years ago by linusu .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ npm install to-data-view 
SYNC missed versions from official npm registry.

To DataView

Create a DataView over an ArrayBuffer/8-bit typed array (commonly used in the browsers) or a Buffer (commonly used in Node.js).

Supported inputs:

Installation

npm install --save to-data-view

Usage

import toDataView from 'to-data-view'

// This function will accept both `ArrayBuffer` and `Buffer` as input
function awesomeParser (source) {
  const view = toDataView(source)

  // ...
}

API

toDataView(data)

  • data (ArrayBuffer | Int8Array | Uint8Array | Uint8ClampedArray, required)
  • returns DataView

Return a DataView instance that uses the same memory as the provided ArrayBuffer, 8-bit typed array or Buffer.

Current Tags

  • 2.0.0                                ...           latest (3 years ago)

3 Versions

  • 2.0.0                                ...           3 years ago
  • 1.1.0                                ...           5 years ago
  • 1.0.0                                ...           7 years ago
Maintainers (1)
Downloads
Total 0
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (0)
None
Dev Dependencies (2)
Dependents (3)

© 2010 - cnpmjs.org x YWFE | Home | YWFE