New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

bindata

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bindata

A structured and understandable way to read/write binary data in Javascript. Inspired by Ruby BinData.

  • 0.0.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1
decreased by-75%
Maintainers
1
Weekly downloads
 
Created
Source

BinData.js

BinData.js is a simple and structured way to read and write binary data. Instead of having to remember a whole table of obscure character codes, you can write and encapsulate chunks of binary data together with ease.

BinData.js aims to be a very close port of Ruby's BinData library.

Examples

Data record definition

class Rectangle extends BinData.Record
  endian: "little"
  define: ->
    @uint16 "len"
    @string "name", length: 4
    @uint32 "width"
    @uint32 "height"

Reading a data record

file = BinData.File.open("/path/to/file")
r = new Rectangle(file)
r.read()

console.log "Rectangle #{r.name} is #{r.width} x #{r.height}"

Keywords

FAQs

Package last updated on 05 Apr 2012

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc