
Security News
Browserslist-rs Gets Major Refactor, Cutting Binary Size by Over 1MB
Browserslist-rs now uses static data to reduce binary size by over 1MB, improving memory use and performance for Rust-based frontend tools.
buffer-fill
Advanced tools
A ponyfill for Buffer.fill
.
Works as Node.js: v6.4.0
Works on Node.js: v0.10.0
npm install --save buffer-fill
const fill = require('buffer-fill')
const buf = Buffer.allocUnsafe(5)
console.log(buf.fill(8))
//=> <Buffer 08 08 08 08 08>
console.log(buf.fill(9, 2, 4))
//=> <Buffer 08 08 09 09 08>
console.log(buf.fill('linus', 'latin1'))
//=> <Buffer 6c 69 6e 75 73>
console.log(buf.fill('\u0222'))
//=> <Buffer c8 a2 c8 a2 c8>
value
<String> | <Buffer> | <Integer> The value to fill buf
withoffset
<Integer> Where to start filling buf
. Default: 0
end
<Integer> Where to stop filling buf
(not inclusive). Default: buf.length
encoding
<String> If value
is a string, this is its encoding. Default: 'utf8'
buf
Fills buf
with the specified value
. If the offset
and end
are not given,
the entire buf
will be filled. This is meant to be a small simplification to
allow the creation and filling of a Buffer
to be done on a single line.
If the final write of a fill()
operation falls on a multi-byte character, then
only the first bytes of that character that fit into buf
are written.
Buffer.allocUnsafe
Buffer.alloc
Buffer.from
FAQs
A [ponyfill](https://ponyfill.com) for `Buffer.fill`.
The npm package buffer-fill receives a total of 5,171,103 weekly downloads. As such, buffer-fill popularity was classified as popular.
We found that buffer-fill 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
Browserslist-rs now uses static data to reduce binary size by over 1MB, improving memory use and performance for Rust-based frontend tools.
Research
Security News
Eight new malicious Firefox extensions impersonate games, steal OAuth tokens, hijack sessions, and exploit browser permissions to spy on users.
Security News
The official Go SDK for the Model Context Protocol is in development, with a stable, production-ready release expected by August 2025.