Security News
Node.js EOL Versions CVE Dubbed the "Worst CVE of the Year" by Security Experts
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
@endeo/output
Advanced tools
Send bytes to buffer list or stream.
See packages:
npm install --save @endeo/output
// get the builder
var Output = require('@endeo/output')
// build one for synchronous operation
var output = new Output()
// or, build one for async operation
var stream = getSomeStream()
// target a Writable stream
var output = new Output(stream.write, stream)
// target a Transform stream
var output = new Output(transform.push, transform)
// optionally have output prepare to accept a
// certain number of bytes.
output.prepare(8)
// either way, it is used the same.
// specify a single byte value.
// this is appended to an internal buffer.
// when the buffer is full:
// 1. the sync version stores it in an array of buffers
// 2. the async version sends it to the stream
output.byte(0xAB)
// send more than one byte at once:
output.byte2(0x01, 0x02)
output.byte3(0x01, 0x02, 0x03)
output.byte4(0x01, 0x02, 0x03, 0x04)
// send specific number sizes:
// 'short' is 2 bytes
output.short(12345)
// int is for 1 to 6 bytes ints.
output.int(1234567890, 4)
// and floats (4 bytes, 8 bytes):
output.float4(1.25)
output.float8(12345.123456789)
// and a string:
// Note: UTF8 encoding is used
output.string('some string')
// finally, a Buffer
output.buffer(someBuffer)
// when all bytes have been provided get the result:
//
// 1. sync operation provides a single Buffer with all content
buffer = output.complete()
//
// 2. async operation ensures what's left is sent forward.
// (basically, flush)
result = output.complete()
//
// the result for async is something to show success:
result = {
success: true
}
FAQs
Send bytes to buffer list or stream
The npm package @endeo/output receives a total of 0 weekly downloads. As such, @endeo/output popularity was classified as not popular.
We found that @endeo/output demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 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
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
Security News
cURL and Go security teams are publicly rejecting CVSS as flawed for assessing vulnerabilities and are calling for more accurate, context-aware approaches.
Security News
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.