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

compress-to-url

v1.0.18

Published

Compress HTML to fit in a URL.

Readme

compress-to-url

npm version

Compress a webpage into a shareable URL. This library enables you to encode HTML content, including social media metadata (Open Graph, Twitter Cards, JSON-LD), into compact URLs. It’s perfect for testing how web pages render on social platforms, prototyping lightweight HTML snippets, or sharing temporary web content without server storage.

The tool is hosted at: onthefly.dobuki.net.

icon

Features

  • Compress HTML: Encode full HTML pages, including metadata, into URLs.
  • Social Metadata Testing: Preview and tweak Open Graph, Twitter Cards, and JSON-LD for social sharing.
  • No Server Storage: Pages are generated from URL parameters, powered by Cloudflare Workers for low-cost serving.
  • Editor Interface: Use the hosted tool to edit HTML, add metadata, and generate shareable links.
  • Versatile Uses: Share prototypes, create educational demos, or test layouts on the fly.

Usage

Online Tool

Visit onthefly.dobuki.net to use the interactive editor:

  1. Enter or paste HTML into the textarea.
  2. Add social metadata or JSON-LD with one-click buttons.
  3. Edit metadata fields (title, description, image, URL) in the right panel.
  4. Share the compressed URL to test or demo your page.

The editor dynamically updates the browser URL with ?edit=1 for editing, while the shareable link uses ?u=... for rendering.

Library

Install the library via npm:

npm install compress-to-url

Use it to compress or decompress HTML

const { compressToUrl, decompressFromUrl } = require('compress-to-url');

async function example() {
  const html = '<!DOCTYPE html><html><head><title>Test</title></head><body><h1>Hello</h1></body></html>';
  
  // Compress
  const { payload } = await compressToUrl(html, { inputType: 'string', mimeType: 'text/html' });
  console.log('Compressed URL:', payload);
  
  // Decompress
  const { data } = await decompressFromUrl(payload);
  console.log('Decompressed HTML:', data);
}

example();

Build

To build the library:

./build.sh

Run Example

To run the local example:

./sample.sh

Motivation

This project started as a way to test social media metadata on the fly, without hosting or complex setups. Built as an experiment in Vibe coding (intuitive, flow-driven development), it uses Cloudflare Workers to serve pages serverlessly. To avoid storage costs, all content is encoded in the URL itself, making every page self-contained.

Technical Details

Cloudflare Workers: Enables server-side rendering for social platform scraping, keeping costs low. No Storage: Pages are generated from URL parameters, eliminating database needs. React + TypeScript: The editor is built for a smooth, interactive experience. Compression: Efficiently encodes HTML to fit within URL length limits. Contributing Feel free to open issues or submit pull requests on GitHub. Feedback and ideas are welcome!

Github Source

https://github.com/jacklehamster/compress-to-url