A plugin for nushell that provides the commands
from msgpack
and to msgpack
to convert between Nu types and MsgPack,
which is a JSON-like binary serialization format.
# download and install the plugin
cargo install --git https://github.com/hulthe/nu_plugin_msgpack.git
# register the plugin with nu, you should put this in your `config.nu`
register ~/.cargo/bin/nu_plugin_msgpack
There's not a 1 to 1 mapping between Nu-types and MsgPack-types.
Here are some conversions that to msgpack
does which might trip you up:
filesize
becomes an integer of bytes. This is consistent withto json
.duration
becomes an integer of nanoseconds. This is consistent withto json
.range
becomes an array. This is consistent withto json
.- The following Nu types become nil:
block
,closure
,error
,cell_path
, andmatch_pattern
.
Additionally Nu date
s are converted to the MsgPack timestamp extension type.
This differs from to json
which converts dates to strings.