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

@slackfmt/clipboard

v0.1.0

Published

Native Node.js addon for reading and writing Slack-formatted content to the system clipboard. Built with Rust using [napi-rs](https://napi.rs) and [clipboard-rs](https://github.com/ChurchTao/clipboard-rs).

Readme

@slackfmt/clipboard

Native Node.js addon for reading and writing Slack-formatted content to the system clipboard. Built with Rust using napi-rs and clipboard-rs.

API

writeClipboard(plainText: string, deltaText: string): void
readClipboard(): { plainText?: string, deltaText?: string }
  • writeClipboard writes plain text and Slack Quill Delta JSON to the clipboard.
  • readClipboard reads both back.

The delta text is stored in a format that Slack's desktop app (Electron) can read natively as rich text.

How it works: org.chromium.web-custom-data

The problem

When Slack's web app copies rich text, it calls:

clipboardData.setData("slack/texty", deltaJson);

slack/texty is a custom MIME type. The browser's Clipboard API only maps standard types (text/plain, text/html) directly to OS clipboard entries. For non-standard MIME types like slack/texty, Chromium bundles them into a single binary blob and writes it to the OS clipboard under the type org.chromium.web-custom-data.

The OS clipboard is flexible

Operating systems accept arbitrary clipboard type identifiers:

  • macOS: NSPasteboard accepts any string as a pasteboard type
  • Windows: RegisterClipboardFormat() registers custom type names
  • Linux: X11 atoms / Wayland MIME types can be any string

The limitation isn't the OS -- it's the browser's Clipboard API that restricts how custom MIME types are persisted. Chromium works around this by using org.chromium.web-custom-data as a container for all non-standard types.

The Chromium Pickle format

The org.chromium.web-custom-data blob uses Chromium's "Pickle" binary serialization:

[u32 LE] payload size
[u32 LE] number of entries
For each entry:
  [u32 LE] MIME type character count (UTF-16 code units)
  [bytes]  MIME type as UTF-16LE
  [bytes]  padding to 4-byte alignment
  [u32 LE] value character count (UTF-16 code units)
  [bytes]  value as UTF-16LE
  [bytes]  padding to 4-byte alignment

For slackfmt, the blob contains a single entry: type slack/texty with the Quill Delta JSON as the value.

Why this works

When you paste into Slack's desktop app (which is Electron/Chromium), it reads the org.chromium.web-custom-data blob from the OS clipboard, decodes the Pickle, finds the slack/texty entry, and interprets it as native Quill Delta rich text -- exactly as if you had copied from Slack itself.

The OS clipboard is just a dumb pipe. Both this addon and Slack's Electron app speak the same Chromium Pickle format, so the round-trip works transparently.

References

Building

Requires Rust toolchain and Node.js:

pnpm install
pnpm build       # release build
pnpm build:debug  # debug build (faster compilation)

Platform support

Pre-built binaries are provided for:

  • macOS (arm64, x64)
  • Windows (x64)
  • Linux (x64, arm64)