Sign Up for Free

RunKit +

Try any Node.js package right in your browser

This is a playground to test code. It runs a full Node.js environment and already has all of npm’s 400,000 packages pre-installed, including node-buffer-as-typedarray with all npm packages installed. Try it out:

var nodeBufferAsTypedarray = require("node-buffer-as-typedarray")

This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.

node-buffer-as-typedarray v0.0.2

No copy wrap node Buffer as one of the typed array views

node-buffer-as-typedarray

No copy wrap node Buffer as one of the typed array views

This is a simple wrapper for node Buffer, that will simply add array like getters and setters, allowing you to use Buffer with existing js libraries, without need to copy entire Buffer.

This library uses Little Endian only.

It's unlikely anyone will need this.

#installation

$ npm install node-buffer-as-typedarray
var fs = require('fs');
var wrapper = require('node-buffer-as-typedarray');
var uint32Array = new wrapper.Uint32Array(10);

uint32Array[0] = 10;
console.log(uint32Array[0]); //10
RunKit is a free, in-browser JavaScript dev environment for prototyping Node.js code, with every npm package installed. Sign up to share your code.
Sign Up for Free