Socket
Socket
Sign inDemoInstall

binopsy

Package Overview
Dependencies
4
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    binopsy

Reimplementation of binary-parser supporting serialization and streaming


Version published
Weekly downloads
1
decreased by-50%
Maintainers
1
Install size
175 kB
Created
Weekly downloads
 

Readme

Source

binopsy

Reimplementation of keichi/binary-parser, supporting both streams and serialization.

The API is mainly the same as binary-parser's, with a couple of additions and one removed method.

Dropped support for .skip

Due to undefined behavior, .skip is not supported. As a workaround the .buffer method can be used.

.stream

The .stream method returns a transform stream that reads incoming data and emits parser results. The parser instance is looped until the end of the input is reached.

.serialize

As a counterpart to binary-parser's .parse method, .serialize takes an object and returns a buffer representation of it. Optionally, an already allowcated buffer can be passed as a second argument.

.fixedSizeNest

.fixedSizeNest is a variation of nest that ensures the nested parser reads a specific amount of bytes. Fixed-size nested parsers are the only source of ambiguity remaining while serializing, as missing bytes are simply skipped. And error is thrown during serialization if the nested parser attempts to write more bytes than the size permits.

formatters require a deformatter

Properties with a specified formatting function need to also provide a deformatter function that restores the original value.

flatten option

As a very simple extension, the flatten option allows nested parsers to write to the current object. Its motivation is the aim for a flat output structure after .choice calls.

Bitfields can be (almost) infinitely long

A relaxation from the 32 bit limit of binary-parser. Also, a bug of the original project that leads to the bit32 method always parsing a value of 0 is not present.

License: MIT

Keywords

FAQs

Last updated on 29 Sep 2016

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc