npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

rmpp

v0.1.10

Published

Precise types for RMP

Downloads

432

Readme

RMPP - Rust MessagePack Precise 📐

RMPP is a pure Rust MessagePack implementation based on RMP crate. It aims to accurately preserve the original types metadata in Rust as well as JavaScript. It's incredibly useful in cases the data is sensitive to strict typing.


Rust 🦀

You can install the crate using the following cargo command:

cargo add rmpp

Sample unpack usage:

use rmpp;

let binary: Vec<u8> = vec![
    0x82, 0xA3, 0x69, 0x6E, 0x74, 0x01, 0xA5,
    0x66, 0x6C, 0x6F, 0x61, 0x74, 0xCB, 0x3F,
    0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
];

let json_string: String = rmpp::unpack_json(&binary, Some(true))?;

Sample pack usage:

use rmpp;

let rmpp_json: String = r###"
{
    "raw_marker": 195,
    "basic_type": "Bool",
    "data": {
        "type": "Bool",
        "value": true
    }
}
"###;

let vec: Vec<u8> = rmpp::pack_json(json);
assert_eq!(vec![0xC3], vec);

The crate also provides a handy MsgPackEntry type that rmpp::pack() and rmpp::unpack() work with.


JavaScript ⭐

You can install the package using the following npm command:

npm i rmpp

Sample unpack usage:

import { unpack_json } from 'rmpp';

const binary: Uint8Array = new Uint8Array([
    0x82, 0xA3, 0x69, 0x6E, 0x74, 0x01, 0xA5,
    0x66, 0x6C, 0x6F, 0x61, 0x74, 0xCB, 0x3F,
    0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
]);

const jsonString: string = unpack_json(binary);

Sample pack usage:

import { pack_json } from 'rmpp';

const rmppJson: string = `
{
    "raw_marker": 195,
    "basic_type": "Bool",
    "data": {
        "type": "Bool",
        "value": true
    }
}`;

let array: Uint8Array = pack_json(rmppJson);
console.assert(array[0] == 0xC3);

Json format 🗃️

Previous unpack examples produce a json string that looks something like the following. It preserves all of the important metadata you might need. The pack_json method operates on json strings formatted like that.

{
  "raw_marker": 130,
  "basic_type": "Map",
  "data": {
    "type": "FixMap",
    "value": [
      [
        {
          "raw_marker": 163,
          "basic_type": "String",
          "data": {
            "type": "FixStr",
            "value": "int"
          }
        },
        {
          "raw_marker": 1,
          "basic_type": "Number",
          "data": {
            "type": "FixPos",
            "value": 1
          }
        }
      ],
      [
        {
          "raw_marker": 165,
          "basic_type": "String",
          "data": {
            "type": "FixStr",
            "value": "float"
          }
        },
        {
          "raw_marker": 203,
          "basic_type": "Number",
          "data": {
            "type": "F64",
            "value": 1.0
          }
        }
      ]
    ]
  }
}

That's about it!