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

@seobryn/ghost-glyph

v0.1.1

Published

Hide and recover text using zero-width characters.

Downloads

106

Readme

ghost-glyph

A tiny TypeScript library to hide and recover text using zero-width Unicode characters.

ghost-glyph encodes UTF-8 bytes into invisible characters:

  • \u200B (zero-width space) represents bit 0
  • \u200C (zero-width non-joiner) represents bit 1

Installation

pnpm add @seobryn/ghost-glyph

Quick Example

import { decode, embed, encode, extract } from "@seobryn/ghost-glyph";

const hidden = encode("Hi 👋");
console.log(hidden); // invisible string

const original = decode(hidden);
console.log(original); // "Hi 👋"

const carrier = "Release notes are ready.";
const embedded = embed("Ship at 17:00", carrier);
const revealed = extract(embedded);
console.log(revealed); // "Ship at 17:00"

API

encode(input: string): string

Converts a string into an invisible zero-width sequence.

  • Input is encoded as UTF-8 bytes.
  • Each byte is converted into 8 bits.
  • Bit 0 becomes \u200B, bit 1 becomes \u200C.

decode(input: string): string

Converts an invisible zero-width sequence back into the original string.

Behavior:

  • Returns "" for empty input.
  • Ignores non-zero-width characters in the provided input.
  • Throws an error if the filtered encoded length is not divisible by 8.

embed(secret: string, carrier: string): string

Appends an invisible payload to visible carrier text.

  • Uses invisible start/end delimiters around the encoded payload.
  • Keeps your visible carrier text unchanged.

extract(carrier: string): string

Extracts and decodes a hidden payload from carrier text created with embed.

  • Reads payload between invisible start/end delimiters.
  • Throws if no embedded payload is found.

invisibleCharacters

Exposes the character mapping used by the library:

{
  zero: "\u200B",
  one: "\u200C",
  carrierStart: "\u2063",
  carrierEnd: "\u2064"
}

CLI Usage

Local development

You can use the CLI locally via pnpm scripts:

# Encode to invisible
pnpm run cli encode "Secret message"

# Decode from invisible
pnpm run cli decode "<invisible>"

# Embed secret in carrier
pnpm run cli embed "hidden" "Visible text"

# Extract secret from carrier
pnpm run cli extract "Visible text<invisible>"

Run pnpm run cli for help and usage info.

Published package

When this package is published, the CLI is available through the ghost-glyph binary.

# pnpm dlx
pnpm dlx @seobryn/ghost-glyph encode "Secret message"

# pnpx
pnpx @seobryn/ghost-glyph encode "Secret message"

The package publish flow builds dist/index.js, types, and dist/cli.js automatically through the prepack script.

Install dependencies

pnpm install

Type check

pnpm run typecheck

Run tests

pnpm test

Watch tests

pnpm run test:watch

Build

pnpm run build

Build output is generated in dist/ as ESM JavaScript and TypeScript declarations.

Notes

  • This is text obfuscation, not cryptographic security.
  • Some systems may normalize or strip zero-width characters, which can break roundtrips.