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

buffer

Package Overview
Dependencies
Maintainers
1
Versions
96
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

buffer - npm Package Compare versions

Comparing version 2.1.1 to 2.1.2

4

package.json
{
"name": "buffer",
"description": "Node.js buffer API that works in the browser",
"version": "2.1.1",
"description": "Node.js Buffer API, for the browser",
"version": "2.1.2",
"author": "Feross Aboukhadijeh <feross@feross.org> (http://feross.org/)",

@@ -6,0 +6,0 @@ "bugs": {

@@ -1,14 +0,14 @@

# native-buffer-browserify
[![Build Status](http://img.shields.io/travis/feross/native-buffer-browserify.svg)](https://travis-ci.org/feross/native-buffer-browserify)
[![NPM Version](http://img.shields.io/npm/v/native-buffer-browserify.svg)](https://npmjs.org/package/native-buffer-browserify)
[![NPM](http://img.shields.io/npm/dm/native-buffer-browserify.svg)](https://npmjs.org/package/native-buffer-browserify)
# buffer (native-buffer-browserify)
[![Build Status](http://img.shields.io/travis/feross/buffer.svg)](https://travis-ci.org/feross/buffer)
[![NPM Version](http://img.shields.io/npm/v/buffer.svg)](https://npmjs.org/package/buffer)
[![NPM](http://img.shields.io/npm/dm/buffer.svg)](https://npmjs.org/package/buffer)
[![Gittip](http://img.shields.io/gittip/feross.svg)](https://www.gittip.com/feross/)
The buffer module from [node.js](http://nodejs.org/), but for browsers. This is a fork of [buffer-browserify](https://github.com/toots/buffer-browserify).
The buffer module from [node.js](http://nodejs.org/), for the browser.
[![testling badge](https://ci.testling.com/feross/native-buffer-browserify.png)](https://ci.testling.com/feross/native-buffer-browserify)
[![testling badge](https://ci.testling.com/feross/buffer.png)](https://ci.testling.com/feross/buffer)
## usage
## install
When you `require('buffer')` or reference the `Buffer` global in [browserify](http://github.com/substack/node-browserify), this module will automatically be loaded.
When you `require('buffer')` or use the `Buffer` global in [browserify](http://github.com/substack/node-browserify), this module will automatically load.

@@ -18,3 +18,3 @@ If you want to manually install it for some reason, do:

```
npm install native-buffer-browserify
npm install buffer
```

@@ -25,4 +25,4 @@

- **Backed by Typed Arrays (`Uint8Array` and `ArrayBuffer`) (not `Object`, so it's fast)**
- **Bundle size is nearly half of the original `buffer-browserify` (35KB vs 65KB!)**
- **Excellent browser support (IE 6+, Chrome 4+, Firefox 3+, Safari 5.1+, Opera 11+, iOS).**
- **Small bundle size (35KB) (half the size of `buffer-browserify`)**
- **Excellent browser support (IE 6+, Chrome 4+, Firefox 3+, Safari 5.1+, Opera 11+, iOS, etc.).**
- Preserves Node API exactly.

@@ -33,10 +33,14 @@ - Faster pretty much across the board (see perf results below)

- Does not modify any browser prototypes.
- All tests from the original `buffer-browserify` project pass, plus additional ones.
- Comprehensive test suite.
## 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.
## usage
By augmenting the instances, we can avoid modifying the `Uint8Array` prototype.
```
var buffer = require('buffer/') // use the npm module, not the core module!
```
The goal is to provide a Buffer API that is 100% identical to node's Buffer API. Read the [official docs](http://nodejs.org/api/buffer.html) for a full list of supported methods.
## important differences

@@ -52,2 +56,10 @@

## 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.
## performance

@@ -146,4 +158,10 @@

## credit
This was originally forked from [buffer-browserify](https://github.com/toots/buffer-browserify).
## license
MIT. Copyright (C) [Feross Aboukhadijeh](http://feross.org), Romain Beauxis, and other contributors.
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