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

web-stamp

v1.0.4

Published

Stamp collecting for the web!

Downloads

18

Readme

web-stamp

Stamp collecting for the web!

This is a silly idea of mine to make visiting websites more fun! Visitors can bring their own stamp cards and collect stamps from websites that uses this library.

Usage for users

Depending on how the website implement the trigger, you should find a way to open the stamp card uploader, which looks like this:

Upload your own stamp card here! If you don't have one, you may click the "Give me a new stamp card!" button.

A stamp card and a stamp should appear. Both of them can be dragged separately (even with touch controls!)

Line them up and click on the stamp to STAMP!

The "Take Back" button will download the image as a PNG file. You now have the stamp of the website!

Usage for developers

Adding this feature to your own website is very easy!

This library is available as a minified script and an npm package.

Minified script

To use the minified script, you should include it in an HTML file like this:

<html>
	<head>
		<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/web-stamp/dist/style.min.css" />
	</head>
	<body>
		<button onclick="openUI()">Open Stamp UI</button>
		<div web-stamp ws-src="link.to/stamp/image" ws-disabled></div>
		<script src="https://cdn.jsdelivr.net/npm/web-stamp/dist/web-stamp.min.js"></script>
		<script>
			function openUI() {
				document.querySelector("*[web-stamp]").removeAttribute("ws-disabled");
			}
		</script>
	</body>
</html>

The script will automatically convert the first element with web-stamp attribute into the stamper UI.

The element with web-stamp can hold more attributes to provide further options:

  • ws-src: A URL to the image to be stamped
  • ws-card-src: A URL to a custom stamp card image that will be provided for users who clicked the "Give me a new stamp card!" button
  • ws-disabled: Disable the stamp UI. You probably want to disable the UI at the start
  • ws-noise: Probability of a pixel being blank when stamping, between 0 and 1
  • ws-lang: A JSON language map to use for text from this library

The default language map looks like this:

const defaultMap: LangMap = {
	"main.new": "Give me a new stamp card!",
	"main.upload": "Put your stamp card here!",
	"main.exit": "Never mind",

	"stamp.noTilt": "No Tilt",
	"stamp.randomTilt": "Random Tilt",
	"stamp.reset": "Reset View",
	"stamp.change": "Change Card",

	"stamp.done.take": "Take Back",
	"stamp.done.change": "Throw Away",

	"thank.main": "Thank you for using",
	"thank.hint": "This component will close in 3 seconds"
};

npm package

You can install web-stamp as an npm package if you want to integrate it directly into your React project.

npm i web-stamp
import { useState } from "react";
import WebStamp from "web-stamp";
// Do this if you have css import set up
// Otherwise, link the stylesheet in the HTML file
import "web-stamp/dist/style.min.css";

export default function App() {
	const [opened, setOpened] = useState(false);

	return <>
		<button onClick={() => setOpened(true)}>Open Stamp UI</button>
		{opened && <WebStamp src="link.to/stamp/image" onClose={() => setOpened(false)} />}
	</>;

	return 
}

Styling

Check out the style.css file. It defines all the styles needed for this library. However, they may not always suit the website. In those cases, you can modify the styles with your own CSS.

To override styles, simply put your styles in higher priority, for example:

div .ws-container {
	background-color: #000a;
	backdrop-filter: blur(1vmax);
}

Known issues

preact-render-to-string error

When a WebStamp component is rendered under the element that is used to call renderToString from preact-render-to-string, an error will be thrown.

To workaround this, make WebStamp NOT render in the initial state. The code in Usage for developers is an example.

If you REALLY want the stmap UI to show up as soon as the website loads, consider using useEffect or static import of the script.