Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

bufferview

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bufferview

A DataView for node Buffers.

  • 1.0.1
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

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

Keywords

FAQs

Package last updated on 04 Jan 2014

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc