
Research
Security News
The Landscape of Malicious Open Source Packages: 2025 Mid‑Year Threat Report
A look at the top trends in how threat actors are weaponizing open source packages to deliver malware and persist across the software supply chain.
binary-parse-fn
Advanced tools
Painless streaming binary protocol parsers using generators.
npm install binary-parse-fn
This module uses the exact same generator interface as binary-parse-stream, which presents a streaming interface to a generator parser.
var BinaryParser = require('binary-parse-fn')
BinaryParser is a function that takes a buffer and passes the return value of your generator back. When your generator yields a number, it'll be fed a buffer of that length from the input. If it yields -1, it'll be given the value of the first byte instead of a single-byte buffer.
The following module parses a protocol that consists of a 32-bit unsigned big-endian type parameter, an unsigned 8-bit length parameter, and a buffer of the specified length.
It returns {type, buf}
objects.
var BinaryParser = require('binary-parse-fn')
module.exports = BinaryParser(function*() {
var type = (yield 4).readUInt32BE(0, true)
, length = yield -1
, buf = yield length
return { type: type, buf: buf }
})
FAQs
Painless binary protocol parsers using generators.
The npm package binary-parse-fn receives a total of 3 weekly downloads. As such, binary-parse-fn popularity was classified as not popular.
We found that binary-parse-fn 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.
Research
Security News
A look at the top trends in how threat actors are weaponizing open source packages to deliver malware and persist across the software supply chain.
Security News
ESLint now supports HTML linting with 48 new rules, expanding its language plugin system to cover more of the modern web development stack.
Security News
CISA is discontinuing official RSS support for KEV and cybersecurity alerts, shifting updates to email and social media, disrupting automation workflows.