![Create React App Officially Deprecated Amid React 19 Compatibility Issues](https://cdn.sanity.io/images/cgdhsj6q/production/04fa08cf844d798abc0e1a6391c129363cc7e2ab-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Create React App Officially Deprecated Amid React 19 Compatibility Issues
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
buffercursor.ts
Advanced tools
A simple package that allows you to traverse a Buffer iteratively
A simple package that allows you to traverse a Buffer iteratively. You
can read and write different types and the cursor's position will update with the proper size, which you can see through .tell()
you can also
.seek()
import { BufferCursor } from "buffercursor.ts";
const bc = new BufferCursor(Buffer.alloc(10));
bc.writeUInt16BE(123456789);
bc.writeUInt8(123456789);
bc.writeUInt32BE(123456789);
bc.seek(0);
bc.readUInt16BE();
bc.readUInt8();
bc.readUInt32BE();
console.log(bc.tell()); // Current cursor position (7)
See .d.ts
For the most part BufferCursor
and Buffer
share the same methods, there's just a slight alteration in method signature, read and write methods don't take an offset. (BigInt support)
So .readUInt16LE(10)
in Buffer
is equivalent to bc.seek(10); bc.readUInt16LE();
All read
and write
methods are reproduced, as are toString
, write
, fill
, copy
, and slice
. All of these methods will move the cursor through the buffer and do not take an offset parameter, where an end
parameter would normaly be used, here you supply a length
.
Additional methods:
move(steps)
Moves the cursors by the amount of steps given.seek(value)
Moves the cursor to given position.tell()
Return the cursor position.eof()
Checks and returns if the cursor is at the end of the buffer.getBuffer()
Makes a copy of the part of the buffer before the cursor position.writeBuff(buff, length)
Writes a buffer to the buffer of given length.buffer
The raw bufferlength
Size of the raw bufferThe OverflowError
is throw when trying to read or write beyond buffer.
This project was heavily inspired by node-buffercursor by tjfontaine, but it is sadly no longer maintained. My first attempt at building this library was based on a fork of node-buffercursor. Since the project has matured, it was moved out to its own repository.
FAQs
A simple package that allows you to traverse a Buffer iteratively
The npm package buffercursor.ts receives a total of 3 weekly downloads. As such, buffercursor.ts popularity was classified as not popular.
We found that buffercursor.ts demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 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
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.