Coder Social home page Coder Social logo

browser-buffer's Introduction

browser-buffer

A port of buffer module for cortex from node.js. This is a fork of native-buffer-browserify.

testling badge

It will also be loaded if you use the global Buffer variable.

Features

  • Backed by ArrayBuffer (not Object, so it's fast)
  • Preserves Node API exactly
  • Faster pretty much across the board (see perf results below)
  • .slice() returns instances of the same type
  • Square-bracket buf[4] notation works!
  • Does not modify any browser prototypes.
  • All tests from the original buffer-browserify project pass.
  • Requires browsers to have Uint8Array and DataView support (all modern browsers, IE10+, shim for older browsers included)

How does it work?

The Buffer constructor returns instances of Uint8Array that are augmented with function properties for all the Buffer API functions. We use Uint8Array so that square bracket notation works as expected -- it returns a single octet.

By augmenting the instances, we can avoid modifying the Uint8Array prototype.

MIT License

Copyright (C) 2013 Feross Aboukhadijeh, Romain Beauxis, and other contributors.

browser-buffer's People

Contributors

feross avatar toots avatar tonistiigi avatar andreasmadsen avatar rdrey avatar andrewrk avatar mscdex avatar ysangkok avatar mwilliamson avatar rubenverborgh avatar sokra avatar villadora avatar

Watchers

Kael avatar Spud Hsu avatar Zhi Cun avatar James Cloos avatar wesley avatar Mangix avatar Leo avatar YYY avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.