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

@worthy-ventures/metaglotta-observer

v1.0.1

Published

Traces rendered text back to the translation key that produced it, for in-context editing. Authoring only - never in a production bundle.

Readme

@worthy-ventures/metaglotta-observer

Traces rendered text back to the key that produced it, so ALT+clicking a string on the page can open the right translation.

Authoring only. Nothing in a production build should import this — it reaches it through @worthy-ventures/metaglotta-ngx, which loads the editor on demand, so a page nobody is editing never downloads any of it.

import { createObserver } from '@worthy-ventures/metaglotta-observer';

const observer = createObserver({
  onClick: (keys, target) => open(keys, target),
  keys: ['Alt'],
});

Three jobs, deliberately separate

  1. Mark — every string the runtime produces gets its key appended in invisible characters. This is the runtime's decorate hook, and it is the only place the observer touches the runtime at all.
  2. Scan — as marked text arrives in the DOM, read the keys out and take the marks back out of the node, so nothing can copy them into a clipboard. Remember which element they belonged to.
  3. Point — while the modifier is held, outline whatever is under the cursor and swallow the click, so ALT+clicking a "Delete" button opens the dialog rather than deleting anything.

Keeping them separate is what lets the marks disappear from the DOM before anyone can select them, while the key is still known for the element.

Options

| | | |---|---| | onClick | What to do with an armed click. Receives the keys and the element they were found on. | | keys | Modifiers held to arm it — all of them, if more than one. Default ['Alt']. | | attributes | Attributes whose value may be a translation (a title, a placeholder). | | root | Where to watch. Default: the whole document. | | ignore | A subtree to leave alone entirely — the editing dialog's own, for one. | | highlightColor, highlightWidth | The outline drawn while armed. |

ignore matters more than it looks: without it the observer marks the editor's own UI, and ALT+clicking inside the dialog re-opens the dialog on its own labels.

Marks

mark, unmark, isMarked, readMarks and forgetInterned are exported for the rare caller that needs to handle marked text itself. The marks are zero-width characters, so a marked string measures and renders identically to an unmarked one — but it is not equal to it, which is why anything comparing translated strings must read the marks off first.