Security News
GitHub Removes Malicious Pull Requests Targeting Open Source Repositories
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
buffer-alloc-unsafe
Advanced tools
A ponyfill for Buffer.allocUnsafe
.
Works as Node.js: v7.0.0
Works on Node.js: v0.10.0
npm install --save buffer-alloc-unsafe
const allocUnsafe = require('buffer-alloc-unsafe')
console.log(allocUnsafe(10))
//=> <Buffer 78 0c 80 03 01 00 00 00 05 00>
console.log(allocUnsafe(10))
//=> <Buffer 58 ed bf 5f ff 7f 00 00 01 00>
console.log(allocUnsafe(10))
//=> <Buffer 50 0c 80 03 01 00 00 00 0a 00>
allocUnsafe(-10)
//=> RangeError: "size" argument must not be negative
size
<Integer> The desired length of the new Buffer
Allocates a new non-zero-filled Buffer
of size
bytes. The size
must be
less than or equal to the value of buffer.kMaxLength
and greater than or equal
to zero. Otherwise, a RangeError
is thrown.
Buffer.alloc
Buffer.fill
Buffer.from
FAQs
A [ponyfill](https://ponyfill.com) for `Buffer.allocUnsafe`.
The npm package buffer-alloc-unsafe receives a total of 2,159,500 weekly downloads. As such, buffer-alloc-unsafe popularity was classified as popular.
We found that buffer-alloc-unsafe demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
Security News
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
Security News
Node.js will be enforcing stricter semver-major PR policies a month before major releases to enhance stability and ensure reliable release candidates.