
Security News
Meet Socket at Black Hat and DEF CON 2025 in Las Vegas
Meet Socket at Black Hat & DEF CON 2025 for 1:1s, insider security talks at Allegiant Stadium, and a private dinner with top minds in software supply chain security.
offset-buffer
Advanced tools
Node.js Buffer wrapper that keeps track of your read and write offsets.
It also includes support for reading and writing 24-bit and 64-bit integers (via the int24, and ref libraries respectively).
var OffsetBuffer = require('offset-buffer'),
ob = new OffsetBuffer(15),
val;
// write offsets are managed automatically so you can do this:
ob.writeInt8(1); // ob.write_offset = 1
ob.writeInt32BE(100; // ob.write_offset = 5
ob.writeUInt64BE(1000); // ob.write_offset = 13
ob.writeUInt16BE(10); // ob.write_offset = 15
// you can also read from the buffer and it keeps track of your read offset:
val = ob.readInt8(); // ob.read_offset = 1
val = ob.readInt32BE(); // ob.read_offset = 5
val = ob.writeUInt64BE(); // ob.read_offset = 13
val = ob.writeUInt16BE(); // ob.read_offset = 15
// some extra convenience copy methods that keep track of your offsets
// (see code for more)
var buffer1 = new Buffer('abc'),
buffer2 = new Buffer('def'),
ob = new OffsetBuffer(6);
ob.copyFrom(buffer1); // ob == 'abc'
ob.copyFrom(buffer2); // ob == 'abcdef'
npm install offset-buffer
npm test
MIT License
FAQs
Node.js Buffer wrapper that keeps track of your read and write offsets
The npm package offset-buffer receives a total of 1 weekly downloads. As such, offset-buffer popularity was classified as not popular.
We found that offset-buffer 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
Meet Socket at Black Hat & DEF CON 2025 for 1:1s, insider security talks at Allegiant Stadium, and a private dinner with top minds in software supply chain security.
Security News
CAI is a new open source AI framework that automates penetration testing tasks like scanning and exploitation up to 3,600× faster than humans.
Security News
Deno 2.4 brings back bundling, improves dependency updates and telemetry, and makes the runtime more practical for real-world JavaScript projects.