Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/hulthe/nu_plugin_msgpack
Nushell plugin for converting to and from msgpack.
https://github.com/hulthe/nu_plugin_msgpack
msgpack nu nushell plugin
Last synced: about 1 month ago
JSON representation
Nushell plugin for converting to and from msgpack.
- Host: GitHub
- URL: https://github.com/hulthe/nu_plugin_msgpack
- Owner: hulthe
- License: mpl-2.0
- Archived: true
- Created: 2023-11-30T20:28:39.000Z (about 1 year ago)
- Default Branch: master
- Last Pushed: 2024-04-19T12:51:14.000Z (8 months ago)
- Last Synced: 2024-08-02T10:27:30.818Z (4 months ago)
- Topics: msgpack, nu, nushell, plugin
- Language: Rust
- Homepage:
- Size: 377 KB
- Stars: 3
- Watchers: 2
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome-nu - nu_plugin_msgpack
README
# nu_plugin_msgpack
A plugin for [nushell](https://nushell.sh/) that provides the commands
`from msgpack` and `to msgpack` to convert between Nu types and [MsgPack](https://msgpack.org/),
which is a JSON-like binary serialization format.![ls-to-msgpack.gif](https://github.com/hulthe/nu_plugin_msgpack/blob/master/showcase/ls-to-msgpack.gif)
## Installation
```sh
# 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
```## Quirks
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 with `to json`.
- `duration` becomes an integer of nanoseconds. This is consistent with `to json`.
- `range` becomes an array. This is consistent with `to json`.
- The following Nu types become nil: `block`, `closure`, `error`, `cell_path`, and `match_pattern`.Additionally Nu `date`s are converted to the MsgPack [timestamp extension type](https://github.com/msgpack/msgpack/blob/master/spec.md#timestamp-extension-type).
This differs from `to json` which converts dates to strings.