binary-parser
binary-parser copied to clipboard
Packet assembly
Have you considered adding the generation of an assemble method (or whatever you want to call it) where you pass in an object and the parser converts it to a buffer?
Yes I did think about adding binary serialization feature, however, when I first began implementig this library, just parsing was enough. If there are requests for such feature, I could start working on it.
It seems like there are very few modules on npm that is capable of both parsing and generating binary data to/from structured data, so more or less, there should be a demand for that kind of a module.
deoxxa/dissolve has a partner module deoxxa/concentrate ... https://github.com/bigeasy/packet can do it.
Ah, this is exactly what I meant! Personally, that DSL-based API isn't very attractive though. What are your opinions?
I don't like it much. I suspect most of the right thing can happen with the current syntax of binary-parser. One issue would be for skip, but that's something that can be solved.
+1 would like to see this
+1 would like to see this
+1 would like to see this.
+1 from me too :]
:+1:
In case anyone is interested: I started working on this at fb55/binary-serializer.
I've gone a different way with this and begun implementing a parallel solution from the ground-up that does both serialization and parsing. https://github.com/ryan-rowland/binary-schema
I'm writing the backlog via GitHub issues if anybody is interested in contributing.
It's already on npm as binary-schema
PR #73 aims to provide the desired functionality. Care to comment on, or lend support for that PR?