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

svg2text

v3.5.18

Published

Web Crypto bitmap SVG encrypt/decrypt.

Readme

svg2text

Encrypt and decrypt small payloads as bitmap-style SVG using Web Crypto (SubtleCrypto). Works in the browser or any runtime with globalThis.crypto.subtle.

Install

npm install svg2text

Usage

import { randomKeyMaterial, keyMaterialToHex, enc, dec } from "svg2text";

const key = randomKeyMaterial();
const svg = await enc(key, "Hello");
const text = await dec(key, svg);

Key: Uint8Array / ArrayBuffer (32 bytes) or a 64-character hex string. Helpers: keyMaterialToHex, hexToKeyMaterial.

External key in pixels: await enc(key, text, { embedKey: false }) — decrypt with dec(key, svg); the SVG marks this with data-s2t-embed="0" (SVG_STREAM_EMBED_ATTR).

By default the 32-byte key material is in the pixel stream (plaintext is still AES-GCM sealed). Treat default SVGs as carrying the key next to the ciphertext unless you use embedKey: false.

Requirements

Secure context (https or http://localhost) for crypto.subtle. Node 20+ for tooling that runs the bundler.

API

| | | |---|---| | enc / dec | Encrypt UTF-8 or Uint8Array ↔ SVG string | | getLibraryVersion, getCryptoProfile, getLimits, getWireFormatSummary, getSubtle | Introspection | | sealPlaintextBytes, openSealedPlaintext, parseBitmapSvg, renderBitmapSvg, … | Lower-level building blocks |

Errors are Svg2TextError with a code (ErrorCode). Use isSvg2TextError(err) to narrow.

Named constants (CELL, LIMITS, AEAD_NAME, …) are re-exported from the package root for tree-shaking.

Bundle for <script>

npx esbuild src/entry.js --bundle --format=iife --global-name=Svg2Text --platform=browser --outfile=dist/bundle.js

Publishing

Run npm login, then npm publish. The name svg2text is already on the registry; you must be a listed maintainer or your publish will fail (often as E404). For a fork under your account, change "name" in package.json (for example a scoped name like @your-username/svg2text) and set "publishConfig": { "access": "public" }.

License

MIT