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

@hyperscript-tools/multilingual

v2.7.2

Published

Write original _hyperscript in 24 languages — Japanese, Korean, Spanish, Arabic, Chinese, Turkish, and more

Readme

@hyperscript-tools/multilingual

Write original _hyperscript in 24 languages — Spanish, Japanese, Korean, Arabic, Chinese, Turkish, French, Portuguese, German, Hindi, Indonesian, Italian, Polish, Russian, Swahili, Thai, Tagalog, Ukrainian, Vietnamese, Hebrew, Bengali, Malay, Quechua, English.

The plugin intercepts _="..." attributes at runtime, translates non-English input to English via semantic analysis, and hands the result to the standard _hyperscript parser. No fork, no patches, no AST changes.

Quick start (CDN, single language)

<script src="https://unpkg.com/hyperscript.org"></script>
<script src="https://unpkg.com/@hyperscript-tools/multilingual/dist/hyperscript-i18n-es.global.js"></script>

<button _="on click alternar .active on me">Alternar</button>

That's it. The script auto-registers as a _hyperscript plugin on load.

Quick start (CDN, all languages)

<script src="https://unpkg.com/hyperscript.org"></script>
<script src="https://unpkg.com/@hyperscript-tools/multilingual/dist/hyperscript-i18n.global.js"></script>

<button _="on click alternar .active on me" data-hyperscript-lang="es">ES</button>
<button _="on click 切り替え .active on me" data-hyperscript-lang="ja">JA</button>
<button _="on click 토글 .active on me" data-hyperscript-lang="ko">KO</button>

data-hyperscript-lang cascades up the DOM, so you can set it once on <html> or <body> and have every descendant inherit.

Bundle size table

| Bundle | URL suffix | Size | Languages | | --------------------------- | ------------------------------------------------- | ------- | ------------------ | | All 24 | dist/hyperscript-i18n.global.js | ~720 KB | All | | Western | dist/hyperscript-i18n-western.global.js | ~190 KB | en, es, pt, fr, de | | East Asian | dist/hyperscript-i18n-east-asian.global.js | ~186 KB | ja, ko, zh | | South Asian | dist/hyperscript-i18n-south-asian.global.js | ~160 KB | hi, bn | | Southeast Asian | dist/hyperscript-i18n-southeast-asian.global.js | ~183 KB | id, ms, th, tl, vi | | Slavic | dist/hyperscript-i18n-slavic.global.js | ~195 KB | pl, ru, uk | | Single language (e.g. es) | dist/hyperscript-i18n-es.global.js | ~140 KB | es | | Lite (BYO semantic) | dist/hyperscript-i18n-lite.global.js | ~2 KB | (external bundle) |

npm / bundler usage

npm install @hyperscript-tools/multilingual
import { hyperscriptI18n, preprocess } from '@hyperscript-tools/multilingual';

// Plugin registration (default language: 'es')
_hyperscript.use(hyperscriptI18n({ defaultLanguage: 'es' }));

// Standalone preprocessing
const english = preprocess('alternar .active', 'es'); // → 'toggle .active'
_hyperscript(english);

Subpath imports for browser bundles work too:

import '@hyperscript-tools/multilingual/browser/es';

Per-element language

Each _= attribute can declare its own language:

<body data-hyperscript-lang="ja">
  <!-- Inherits ja from <body> -->
  <button _="on click 切り替え .active on me">JA default</button>

  <!-- Override per element -->
  <button _="on click alternar .active on me" data-hyperscript-lang="es">ES override</button>
</body>

Resolution order: element → ancestor data-hyperscript-lang<html lang> → plugin's defaultLanguage.

How it works

  1. The plugin overrides _hyperscript's runtime.getScript() (the function that reads _= attributes and returns raw strings).
  2. The override calls a semantic parser to analyze the input. If parse confidence clears the per-language threshold, the parser produces a language-neutral semantic node.
  3. A deterministic English renderer turns the semantic node back into English _hyperscript text.
  4. _hyperscript's standard lexer + parser see English and execute normally.

If parse confidence is below the threshold, the original text falls through unchanged — the plugin never substitutes a low-confidence guess.

Known limitations

  • Expressions (standalone boolean expressions outside a command body) don't translate; only command bodies do.
  • Feature keywords def and worker must stay English. behavior is supported.
  • SOV/VSO accuracy: Japanese, Korean, Turkish, Arabic produce lower confidence than SVO languages because their word order requires more reordering. Per-language thresholds are tuned to compensate.
  • Programmatic _hyperscript(string) calls bypass getScript() — call preprocess(text, lang) first if you need translation in that path.

License

MIT.