Introducing The Sweep: OX’s New Live Security Research Series
Register Now
Breaking: The 2026 Vulnpocalypse Hits PHP: Four Critical RCEs, but How Dangerous Are They?
Read the Report
Are you exposed? Connect your apps in minutes.
Scan your apps free

rubyfield

Latest version: v0.1.3

Overview

Last scanned
26 Nov 2026
Published
26 Nov 2026
npm package Publisher: graphemecluster
5 Versions

Scan summary

rubyfield was last scanned on 26 Nov 2026 at version 0.1.3. Risk score 0 of 100. No malicious behavior was detected.

  • Releases: 5 versions, all published on 26 Nov 2026.
  • Findings: No rules fired in version 0.1.3.

Versions

5 versions published
Versions and the rules that fired in each
VersionPublishedStatus
0.1.3 LATEST 26 Nov 2026 No rules fired
0.1.2 26 Nov 2026 No rules fired
0.1.1 26 Nov 2026 No rules fired
0.1.0 26 Nov 2026 Not shown
0.0.0-stage 26 Nov 2026 Not shown

No rules fired in 0.1.3

Findings

Findings for v0.1.3. The score is a capped sum of the weights of the rules that fired — not CVSS, not exploitability, and not a probability. It is not comparable across packages with different scan coverage.

The score describes 0.1.3; other versions have their own rules, not their own score.

README

The publisher’s own README, as collected from the registry.

Rubyfield

npm JSR Types License

Rubyfield turns readings, glosses, and other text annotations into an input field you can see and try immediately. Type and edit the base text while the annotations update live above it.

Use it as a Pinyin, Jyutping, or Furigana input field with the recipes below—or plug in your own annotation function. NLP library authors can use the same component as a playground: change the function, type a sentence, and see its output live.

  • Mandarin Pinyin with pinyin-pro.
  • Cantonese Jyutping with to-jyutping.
  • Japanese Furigana with kuromoji and wanakana.
  • Custom readings, glosses, and other annotations through one annotate function.

Try the live demo.

For Use Package
Framework-agnostic JavaScript rubyfield [current]
React 18+ (npm); React 19 (JSR) @rubyfield/react
Vue 3+ @rubyfield/vue

Quick start

Install rubyfield.

<div id="field" class="your-wrapper-class"></div>
import { createRubyfield } from "rubyfield";

const content = { current: "你好" };

const field = createRubyfield(document.querySelector("#field")!, {
  content: content.current,
  onUpdate: value => { content.current = value; },
  placeholder: "Start typing…",
  annotate: text => text === "你好" ? [[0, 1, "nei5"], [1, 2, "hou2"]] : [],
  attributes: { class: "your-input-field-class" },
});

Recipes

Each example mounts into an existing <div id="field"></div>. Call field.destroy() when removing the field.

Mandarin Pinyin

Install pinyin-pro.

import { pinyin } from "pinyin-pro";
import { createRubyfield, segmentsToRanges } from "rubyfield";

const annotate = text => segmentsToRanges(pinyin(text, { type: "all" }).map(({ origin, pinyin, isZh }) => [origin, isZh ? pinyin : null]));

const field = createRubyfield(document.getElementById("field"), {
  annotate,
  attributes: { lang: "zh" },
  ruby: { rt: { attributes: { lang: "zh-Latn-pinyin" } } },
});
Cantonese Jyutping

Install to-jyutping.

import { getJyutpingList } from "to-jyutping";
import { createRubyfield, segmentsToRanges } from "rubyfield";

const annotate = text => segmentsToRanges(getJyutpingList(text));

const field = createRubyfield(document.getElementById("field"), {
  annotate,
  attributes: { lang: "yue" },
  ruby: { rt: { attributes: { lang: "yue-Latn-jyutping" } } },
});
Japanese Furigana

Install kuromoji and wanakana.

Serve Kuromoji's dict directory at /dict/ as binary files without a Content-Encoding header. Load the tokenizer once before mounting the field; this example uses its browser bundle.

import kuromoji from "kuromoji/build/kuromoji.js";
import { toHiragana } from "wanakana";
import { createRubyfield, segmentsToRanges } from "rubyfield";

const tokenizer = await new Promise((resolve, reject) => kuromoji.builder({ dicPath: "/dict/" }).build((error, tokenizer) => error ? reject(error) : resolve(tokenizer)));
const annotate = text => segmentsToRanges(tokenizer.tokenize(text).map(({ surface_form, reading }) => [surface_form, /\p{Script=Han}/u.test(surface_form) && reading ? toHiragana(reading) : null]));

const field = createRubyfield(document.getElementById("field"), {
  annotate,
  attributes: { lang: "ja" },
  ruby: { rt: { attributes: { lang: "ja-Hira" } } },
});
An unreliable narrator

This example demonstrates custom annotation with context-sensitive handling. 有趣 reads yǒu qù (“interesting”), but adding 真 (“really”) before it changes the reading to wú liáo (“boring”). 生命 gets the Japanese reading いのち: a narrator who finds life less interesting the more you insist otherwise.

import { createRubyfield } from "rubyfield";

const annotate = text => [...text.matchAll(/(?<とき>時間|瞬間)|(?<いのち>生命)|(?<yǒu>有)(?<qù>趣)|真(?<wú>有)(?<liáo>趣)/gd)].flatMap(match => Object.entries(match.indices.groups).flatMap(([groupName, indices]) => indices ? [[...indices, groupName]] : []));

const field = createRubyfield(document.getElementById("field"), {
  defaultContent: "生命真有趣",
  annotate,
});
Plain-text annotation separators

<rp> supplies separators for plain-text representations, such as search-engine rendering and programmatically copying content with annotations. Without it, textContent sticks base text and annotation together. Browsers with ruby support normally hide these separators.

import { createRubyfield } from "rubyfield";

const annotate = () => [[0, 1, "nei5"]];

const field = createRubyfield(document.getElementById("field"), {
  annotate,
  ruby: { rp: { before: { text: "(" }, after: { text: ")" } } },
});

For base text 你 and reading nei5, the editable element (available through the handle's element property) has a textContent of 你(nei5). The same annotated text is available through new DOMParser().parseFromString(html, "text/html").body.textContent, where html is the string returned by the handle's getHTML() method. Normal copying from the field copies base text only.

API

Options
Usage

Rubyfield installs no CSS apart from the minimal styles needed for placeholders and single-line fields. Supply your own styles.

Input is plain text: pasted formatting and images are not retained, and line endings become \n. Base text is editable; annotations are read-only.

Each Rubyfield package exports the optional utility segmentsToRanges(pairs), which converts [baseText, rubyText] pairs into UTF-16 annotation ranges. The baseText strings, joined in order, must reproduce the original text, including spaces and punctuation. A pair such as ["你好", "nei5 hou2"] adds an annotation; ["!", null] leaves that segment unannotated while counting its length for subsequent ranges.

Raw Attributes objects use HTML names (class, not className):

  • Null/undefined omit an attribute.
  • Other values are stringified. Use CSS strings for style; functions are not event listeners.

For example, use hidden: "" to enable hidden and omit it to disable it; hidden: false becomes hidden="false", which still hides the element.

The field's handle provides access to its properties and methods through React's ref.current, Vue's template-ref .value, or the object returned by createRubyfield(...). Its TypeScript type is RubyfieldHandle. The handle exposes:

  • Properties:
    • element: the editable HTMLElement, or null.
    • value: the current base text, read-only.
  • Methods:
    • focus() / blur(): focus or blur the field.
    • select(): select all base text.
    • setSelectionRange(start, end): select a range using zero-based UTF-16 offsets.
    • getHTML(): return an annotated HTML string. Normal copying copies base text only.

Create the field after its DOM container exists. Use element.addEventListener() for native DOM events. The returned Rubyfield also exposes setOptions(options) and destroy(); destroy it when removing the field.

Launching the Demo

Try the hosted demo, or run it locally from the repository root:

bun install
bun run dev

Open the URL printed by Vite. The demo includes Pinyin, Jyutping, and Furigana; the Japanese dictionary loads when Furigana is selected.

Development

From the repository root:

  • Build: bun run build.
  • Check types: bun run typecheck.
  • Format: bun run format.
  • Check formatting: bun run format:check.
  • Run tests:
    • Install managed Chromium once: bunx --no-install playwright-core install chromium.
    • All tests: bun test.
    • Browser tests only: bun run test:browser.
    • Unit tests only: bun test tests/text.test.ts.

Tests start and stop their own servers.

JSR uses the deno.json workspace configuration and publishes TypeScript source as @rubyfield/core, @rubyfield/react, and @rubyfield/vue. The JSR CLI downloads Deno internally; development uses Bun.

To release, set the same version in all three packages' package.json and deno.json files, update the core import versions in the root deno.json to match, then push a matching vX.Y.Z tag. The publish.yml workflow checks, builds, tests, and publishes to npm and JSR before creating a GitHub release. Prereleases use npm's next tag. Both registries require repository linking; npm also requires trusted publisher configuration for publish.yml. Failed runs can be retried; already published versions are skipped.

License

MIT.

OX Radar and Response Center

Find threats in your stack.

OX Radar can check high-priority threats, like critical package CVEs, against your context.

Each incident is marked Detected or Not Detected with a remediation plan and proof all tracked in the Response Center.

Where it’s listed

The probe returned only these fields for this server — auth requirement, protocol and tool list weren’t observed, so they’re not shown (never guessed).

  • npm rubyfield

References

The publisher’s own links, as the registry reports them. These are not sources for the assessment on this page.

Powered by Read the latest findings

Scan your whole stack

Group 1261154050 1
Group 1261154050
 

From OX Research Newsroom

Critical Apache HTTP Server Flaw Exposes Web Servers to RCE (1)
CVE

CVE-2026-119618: Critical Apache HTTP Server Flaw Exposes Web Servers to Remote Code Execution

Ethersphere Hijacked With Crypto Stealing Malware (1)
npm

Ethersphere Hijacked With Crypto Stealing Malware Via Github & npm

The 2026 Vulnpocalypse Hits PHP: Four Critical RCEs, but How Dangerous Are They?
Vulnerability Insights

The 2026 Vulnpocalypse Hits PHP: Four Critical RCEs, but How Dangerous Are They?

Frame 2085668439 (1)
Group 1261154229