node-msgpack
node-msgpack copied to clipboard
Proposal Update v5
There's been a debate over how to properly handle string serialization in languages with both string and binary support (the case with node.js) and this resulted in the msgpack owners redefining the spec and adding string support.
Please see the proposal update v5 documentation here: https://gist.github.com/frsyuki/5432559
Have you taken a look? What are the plans etc. Anything I can help with?
:+1:
Looks like the v5 has been adopted: https://github.com/msgpack/msgpack/blob/master/spec.md
I'm building in support for the new spec in a feature branch: https://github.com/mikepb/node-msgpack/tree/feature/msgpack-ng
It's a work in progress. The pack() method is slower than before, but more closely follows the JSON.stringify() behaviour, supporting toJSON and ignoring function values in objects in the same way. Using a replacer function is not yet supported. I don't have a need for a replacer right now, so won't spend time implementing it. There are options to serialize functions and RegExp objects as strings, and Date objects as doubles.
I am not focusing on performance, but on correctness instead. As was discussed in #38, we are at the point of diminishing returns for performance. Spending hours of engineering time to shave seconds per day isn't worth it.
FYI I also did the same but decided to base my fork off msgpack-js instead.
Here it is: https://npmjs.org/package/msgpack-js-v5 It's not as comprehensive, but works.