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

@amplib/steganography

v1.2.0

Published

Encoding data into images and decoding it back. The Stegassette (STGC) format carries audio and arbitrary entries in one PNG.

Readme

Steganography

Encoding data into images and decoding it back.

Origin: ja-k-e/stega.

Modules

Stegassette is the current format and the only one carried by the published docs, alongside StegaAnimator and the helper functions. It subsumes what the pre-STGC modules each did separately — text, audio, and arbitrary bytes are all just entries.

| Module | Description | | -------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | Stegassette | Multi-payload STGC format: audio + arbitrary entries, self-describing alpha header, 11 combine ops, 9 traversals, 6 keymaps. See Stegassette.md for format details. | | StegaAnimator| Animates an encoded image on a canvas |

The pre-STGC modules — Stega64, StegaCassette, StegaBinary, StegaKey, and StegaMetadata — were removed in 1.0. Their consumers were already gone: machines/sonic-pixels is retired, and the iOS StegaKit that ported the API to Swift is archived at _archive/stega-player. They were kept only because dropping them was a breaking change. Stegassette supersedes all of them.

To keep using them, pin @amplib/steganography@^0.1.0; that line is not maintained. The 1.0 surface is Stegassette, StegaAnimator, and the file and audio helpers.

Usage

Stegassette

import { Stegassette } from "@amplib/steganography";

// Build an audio entry from decoded PCM channels
const audioEntry = Stegassette.buildAudioEntry({
  channels: [leftChannel, rightChannel], // Float32Array[]
  sampleRate: 44100,
  bitsPerSample: 16,
});

// Encode into an image
const canvas = Stegassette.encode({
  source: image, // HTMLImageElement | HTMLCanvasElement
  entries: [audioEntry],
  combine: "xor", // 11 combine ops available
  traversal: "raster", // 9 traversal patterns
  keymap: "adjacent", // 6 keymaps
});

// Decode — self-keying, no separate key image needed
const { entries, opts } = Stegassette.decode({ source: canvas });
const { channels, sampleRate } = Stegassette.parseAudioEntry(entries[0]);

An entry is a mimetype, an optional name, and bytes — a string is encoded as UTF-8 — so text needs no separate module:

const canvas = Stegassette.encode({
  source: image,
  entries: [{ mimetype: "text/plain", name: "message.txt", data: "Hello world" }],
});

const { entries } = Stegassette.decode({ source: canvas });
const message = new TextDecoder().decode(entries[0].data);

Node.js (read/write PNG files)

import { Stegassette, readPng, writePng } from "@amplib/steganography/node";

const img = await readPng("input.png");
const out = Stegassette.encodeImageData({ source: img, entries: [audioEntry] });
await writePng("output.png", out);
const { entries } = Stegassette.decodeImageData({ source: out });