Socket
Socket
Sign inDemoInstall

buffer-v6-polyfill

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

buffer-v6-polyfill

A polyfill for older versions of node.js for the node v6 Buffer


Version published
Maintainers
1
Created
Source

node-buffer-v6-shim

A shim for older versions of node < v6 for methods such as allow(), from(), etc

'use strict';

if (!(Number(process.version.match(/^v(\d+\.\d+)/)[1]) >= 6.0)) {
  return;
}

function newBuffer(data, encoding, len) {
  return new Buffer(data, encoding, len);
}

function newSlowBuffer(data, encoding, len) {
  var SlowBuffer = require('buffer').SlowBuffer;
  return new SlowBuffer(data, encoding, len);
}

Buffer.alloc = newBuffer;
Buffer.allocUnsafe = newBuffer;
Buffer.allocUnsafeSlow = newSlowBuffer
Buffer.from = newBuffer;

Keywords

FAQs

Package last updated on 04 Aug 2016

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