bufferview
A DataView for node Buffers.
Last updated 13 years ago by dcode .
Apache-2.0 · Repository · Bugs · Original npm · Tarball · package.json
$ npm install bufferview 
SYNC missed versions from official npm registry.

BufferView - A DataView for node Buffers

This one is simple: It's doing exactly what DataView does but takes a node.js Buffer for it. The sole difference is that it additionally provides some convenience methods to work with interchangeable BufferView and DataView instances, depending on the backing buffer:

  • BufferView.create(Buffer|ArrayBuffer):BufferView|DataView creates a BufferView if wrapping a Buffer and a DataView otherwise
  • BufferView.isBufferView(*):boolean tests if a view is a BufferView wrapping a Buffer
  • BufferView.isDataView(*):boolean tests if a view is a DataView wrapping an ArrayBuffer

This basically lets you write code that is independent of what kind of buffer your backing buffer is, so that your library does not need to copy back and forth between Buffers and ArrayBuffers - that would be sad.

  • Extends DataView for instanceof compatibility
  • Well tested
  • Lean (BufferView.min.js is ~3KB)

License: Apache License, Version 2.0

Current Tags

  • 2.0.0                                ...           latest (9 years ago)

3 Versions

  • 2.0.0                                ...           9 years ago
  • 1.0.1                                ...           13 years ago
  • 1.0.0                                ...           13 years ago
Maintainers (1)
Downloads
Total 12
Today 0
This Week 0
This Month 6
Last Day 0
Last Week 0
Last Month 2
Dependencies (0)
None
Dev Dependencies (3)
Dependents (1)

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