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

@insanity-on-a-machine/katana-text

v1.0.4

Published

Lightweight scraping prevention system for text content

Readme

Katana-text

Website scraping prevention system for text content

How it works

Katana uses the Pretext library (ironic that it's used here to stop AI scraping while AI made part of it, plus the guy works at Midjourney now) to tell where each word of your element needs to be, then-

  • Absolutely positions the words as spans which are shuffled in the DOM structure, and
  • Some of them overlap
  • A custom font is applied that maps each character to a different one, so the actual text content is Quasi-Caesar'd around a bit

Why use Katana?

If you want to protect against your run-of-the-mill scraper from taking the text on your site, while not requiring a performance-heavy solution like Anubis or setting up and managing a tar pit, Katana-text is a good choice

(ya can still do those things though!)

How to use it

  • Run loadAndShuffleFont(), passing in the url to a .woff file and the name you want to call the resulting font; this returns a Font management object

  • For every text block you want to render, call createKatanaTextComponent(), passing in:

    • The font object you got earlier
    • The text it should contain
    • The height in pixels of the text
    • The line height (should be more than the height in pixels)

This returns a React function component you can use wherever you want;

It will automatically update its height based on the text inside it, but it is recommended that you set the width explicitly, though it seems to have no issues with it.

    <createdComponentFunction width="75%"/>

See the demos folder on Github for a good idea of how it should be used.

Note:

createKatanaTextComponent() is not a React component, it returns a function that is.

The backstory

Katana-text is a subproject related to Katana, the system used to prevent AI from scraping the images at ungenerated.io; Katana's code is private for security reasons, but Katana-text is planned to be a free React library