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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@dsdenes/msgpack

v1.0.0

Published

Byte-compatible, drop-in replacement for @msgpack/msgpack everyday payloads

Readme

@dsdenes/msgpack

A byte-compatible, drop-in replacement for msgpack-javascript 3.1.3 covering everyday payloads: nulls, booleans, numbers, strings, binary data, arrays, maps, timestamps, application-registered extension types, and nested combinations of them.

Install

npm install @dsdenes/msgpack

The package is ESM and CommonJS compatible, ships its own TypeScript declarations, and has no runtime dependencies.

Usage

Named imports:

import { decode, encode } from "@dsdenes/msgpack";

const bytes = encode({ id: 1, name: "widget" });
const value = decode(bytes);

Default import:

import msgpack from "@dsdenes/msgpack";

const bytes = msgpack.encode({ id: 1, name: "widget" });
const value = msgpack.decode(bytes);

The default export holds the named runtime API: each property is the same reference as the corresponding named export (msgpack.encode === encode, msgpack.Decoder === Decoder). The object works with esModuleInterop-compiled CommonJS default imports as well:

const msgpack = require("@dsdenes/msgpack").default;

CommonJS destructuring works too:

const { encode, decode } = require("@dsdenes/msgpack");

API

  • encode(value, options?) returns the MessagePack encoding as a Uint8Array.
  • decode(buffer, options?) accepts a Uint8Array, another ArrayBufferView, an ArrayBuffer, or an array-like of bytes, and decodes exactly one message.
  • decodeMulti(buffer, options?) yields every consecutive message in the buffer, in order.
  • decodeMultiStream(streamLike, options?) and decodeArrayStream(streamLike, options?) return async generators that decode messages, or the items of one array, from an async iterable of chunks or a WHATWG ReadableStream; decodeAsync(streamLike, options?) decodes exactly one message from a stream.
  • new Encoder(options?) with encode and encodeSharedRef.
  • new Decoder(options?) with decode, decodeMulti, decodeStream, decodeArrayStream, and decodeAsync.
  • new ExtensionCodec() with register, tryToEncode, and decode, plus ExtensionCodec.defaultCodec and ExtData.
  • DecodeError, the error class raised by decoder length limits and the default map key converter.
  • Timestamp helpers: EXT_TIMESTAMP, encodeDateToTimeSpec, encodeTimeSpecToTimestamp, decodeTimestampToTimeSpec, encodeTimestampExtension, and decodeTimestampExtension.

Default behaviour matches msgpack-javascript 3.1.3: smallest integer widths, float64 for non-integers, UTF-8 strings with the same fixstr/str8/str16/str32 thresholds, the same bin/array/map widths, plain-object maps with string or number keys, Uint8Array binary values, and the built-in timestamp extension. The same encoding and decoding options are accepted, with the same defaults and the same malformed-input failures.

Subpaths

Besides the package root, these paths resolve:

| Import | Resolves to | | --- | --- | | @dsdenes/msgpack/package.json | the package manifest | | @dsdenes/msgpack/lib/index.mjs | the ESM bundle | | @dsdenes/msgpack/lib/index.cjs | the CommonJS bundle | | @dsdenes/msgpack/lib/index.d.ts | the TypeScript declarations | | @dsdenes/msgpack/lib/msgpack.js | the plain-script UMD bundle |

lib/msgpack.js is built from the same source as the module entry points and defines the same MessagePack global as msgpack-javascript's UMD build, so a page that loads the library with one plain <script src> keeps working:

<script src="https://unpkg.com/@dsdenes/msgpack/lib/msgpack.js"></script>

The package unpkg and cdn fields point at that file.

Reference-internal paths such as dist.esm/*, dist.cjs/*, and src/* are out of scope: this package does not ship shim directories for them. Use the root entry point or the lib/* subpaths above.

License

ISC. See LICENSE.