New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

binreader

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

binreader

A basic binary reader for Node.js

latest
Source
npmnpm
Version
0.0.6
Version published
Maintainers
1
Created
Source

binreader

A basic buffered binary reader for Node.js.

Basic Examples

const BinReader = require('binreader');

const reader = new BinReader({
  filename: 'hello.dat'
});

reader.seek(512);
const x = reader.nextInt();

API

  • constructor(options): options contains properties: filename, byteOrder (optional), bufferSize (optional)

  • Number: length: returns the length of the file

  • Boolean: canRead: returns true if the stream is not at the end

  • Number: nextLong(): reads signed 64 bit number. note that the max precision in javascript is only 53 bits!

  • Number: nextULong(): reads an unsigned 64 bit number. note that the max precision in javascript is only 53 bits!

  • Number: nextInt(): reads a 32 bit signed number

  • Number: nextUInt(): reads a 32 bit unsigned number

  • Number: nextShort(): reads a 16 bit signed number

  • Number: nextUShort(): reads a 16 bit unsigned number

  • Number: nextByte(): reads a 8 bit unsigned number

  • Number: nextSByte(): reads a 8 bit signed number

Keywords

binary

FAQs

Package last updated on 07 Feb 2017

Did you know?

Socket

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.

Install

Related posts