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.
aligned-block-file
Advanced tools
read and write to a file in a cache-friendly way by using aligned blocks.
read and write to a file in a cache-friendly way by using aligned blocks.
This module provides an interface to read arbitary buffers from a file, and manages it as a series of aligned buffers. This allows you to write high performance binary file formats, where many reads do not necessarily mean many fs reads.
create an instance, block_size
is the size of the underlying block.
I suggest 1024 or 4096 or some multiple of your OS block size.
flags
is passed to fs.open
read a buffer from the file. If the range is already in the cache
cb
will be called synchronously.
read a UInt32BE from the file. (cb
may be sync, if the buffer is already in cache)
read a UInt48BE from the file. (cb
may be sync, if the buffer is already in cache)
read a UInt64BE from the file, since javascript numbers are restricted to double
this will only set the first 53 bits. Take care with your 53 bit int! if you use bitwise
operations it will collapse back to 32 bit, you need to use *2
instead of << 1
, etc.
(cb
may be sync, if the buffer is already in cache)
an observable of the files size.
an observable of the end of the file
append buf
to the file.
this must not be called again until the previous call has returned.
updated values for size and offset will be triggered immediately before the cb
is called.
shorten the file to length
removing anything after that point.
MIT
FAQs
read and write to a file in a cache-friendly way by using aligned blocks.
The npm package aligned-block-file receives a total of 72 weekly downloads. As such, aligned-block-file popularity was classified as not popular.
We found that aligned-block-file demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 4 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.