pack / unpack functions for node.js

27,562

Solution 1

https://github.com/pgriess/node-jspack appears to be a straight-up port of Python's struct API for packing binary data, but it's implemented in JS. It doesn't appear to be packaged for npm yet.

https://github.com/substack/node-binary provides unpacking, also implemented in JS, and you can install it with npm install binary if you have npm installed.

Solution 2

https://github.com/ryanrolds/bufferpack is another solution

Share:
27,562

Related videos on Youtube

Adam M-W
Author by

Adam M-W

Swinburne University of Technology Student (2011 - present):Studying Bachelor of Science (Computer Science) and Engineering (Telecommunications and Networks)

Updated on July 09, 2022

Comments

  • Adam M-W
    Adam M-W over 1 year

    Are there any modules that provide pack / unpack functionality for nodejs similar to python's struct module? I haven't found any specifically for node, and I'd assume that javascript implementations would be significantly slower.

    Thanks.

  • KhoPhi
    KhoPhi almost 7 years
  • natevw
    natevw about 6 years
    I've also made github.com/natevw/struct-fu which lets you define structures with a C-like feel and pack/unpack them.

Related