![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
buffer-v6-polyfill
Advanced tools
A shim for older versions of node < v6 for methods such as allow()
, from()
, etc
# Latest v1.x
npm install --save git+https://git.daplie.com/Daplie/node-buffer-v6-shim.git#v1
# Whatever happens to be in npm
npm install --save buffer-v6-shim
'use strict';
require('buffer-v6-polyfill');
// all your codez ...
'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);
}
if (!Buffer.alloc) {
Buffer.alloc = newBuffer;
}
if (!Buffer.allocUnsafe) {
Buffer.allocUnsafe = newBuffer;
}
if (!Buffer.allocUnsafeSlow) {
Buffer.allocUnsafeSlow = newSlowBuffer;
}
if (!Buffer.from) {
Buffer.from = newBuffer;
}
try {
Buffer.from('1337', 'hex');
} catch(e) {
// wish I could do something here to fix the broken Buffer.from
try {
Buffer.from = newBuffer;
} catch(e) {
// but alas, I cannot
console.warn("Your node version has buggy Buffer.from support. Please update to node >= v4.5 or >= v6.3");
}
}
FAQs
A polyfill for older versions of node.js for the node v6 Buffer
The npm package buffer-v6-polyfill receives a total of 2,171 weekly downloads. As such, buffer-v6-polyfill popularity was classified as popular.
We found that buffer-v6-polyfill demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 7 open source maintainers collaborating on the project.
Did you know?
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.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.