
Security News
Feross on TBPN: How North Korea Hijacked Axios
Socket CEO Feross Aboukhadijeh breaks down how North Korea hijacked Axios and what it means for the future of software supply chain security.
buffer-reader-grabled
Advanced tools
Make reading data from a binary buffer easily.
npm install buffer-reader-grabled
var BufferReader = require('buffer-reader');
var reader = new BufferReader(buffer);
// Read next N bytes as string
var str = reader.nextString(10);
// Read next N bytes as buffer
var buf = reader.nextBuffer(10);
// Read next 2 bytes as Int16LE
var i = reader.nextInt16LE();
// Read next 8 bytes as DoubleLE
var d = reader.nextDoubleLE();
// Get all rest bytes as buffer
var rest = reader.restAll();
// OutOfBound will raise exception
try {
reader.nextString(1);
}cache(e) {
// handle exception
}
// Append buffer to reader
reader.append(newbuffer);
// Read again
reader.nextString(1);
Create a new reader, if no buffer provided, a empty buffer will be used.
Append new buffer to the end of current reader
Return current position of the reader
Set new position of the reader, if the pos is invalid, an exception will be raised
Move the position of reader by offset, offset can be negative; it can be used to skip some bytes
Get all the remaining bytes as a Buffer
Read a buffer with specified length
Read next length of bytes as String, encoding default is 'utf8'
Read next bytes as given types, the value is just as the same format Buffer in nodejs doc.
(The BSD License)
Copyright (c) 2013, Villa.Gao jky239@gmail.com; All rights reserved.
FAQs
a reader for nodejs buffer(fix chinese garbled)
We found that buffer-reader-grabled 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
Socket CEO Feross Aboukhadijeh breaks down how North Korea hijacked Axios and what it means for the future of software supply chain security.

Security News
OpenSSF has issued a high-severity advisory warning open source developers of an active Slack-based campaign using impersonation to deliver malware.

Research
/Security News
Malicious packages published to npm, PyPI, Go Modules, crates.io, and Packagist impersonate developer tooling to fetch staged malware, steal credentials and wallets, and enable remote access.