Repolode
jkrup

jkrup/jeveryword

A zero-dependency JavaScript library that uses TypeSafe's multiple-choice Jev model to extract exact text spans, field values and PII labels from short messages.

Stars
42
Forks
3
Open issues
0
Last commit
2 months ago

What is it?

jeveryword makes TypeSafe's Jev model usable for text extraction. Jev only answers multiple-choice questions and cannot generate text, so the library numbers the words of your input, offers those numbers as answer options, and maps the chosen numbers back to the original substring with character offsets. Every returned value is therefore a verbatim slice of the input, and each result carries a probability that can guide which values to confirm with a user.

The main helpers are extractSpans for named fields defined by plain-English descriptions, and classifyChunks with mergeChunks for labelling every word, such as PII categories. A lower-level tokenize API lets you build custom questions. The package has no dependencies, runs on Node 20+, Cloudflare Workers, Deno and Bun, and includes a stand-in model client for tests. A hosted HTTP API paid per call in USDC via x402 is also described.

The project is marked experimental, and its authors report checks on only a small set of synthetic messages. It fits short texts handled live, and is a poor fit for long documents or values that must be computed or reformatted.

Key features

  • 01Extracts named fields from text, returning exact substrings with start and end offsets.
  • 02Reports missing and ambiguous states alongside a probability for each result.
  • 03Labels every word with a PII or custom category and merges adjacent labelled words into spans.
  • 04Exposes a low-level tokenize API for building custom multiple-choice questions.
  • 05Has no runtime dependencies and runs on Node, Deno, Bun and Cloudflare Workers.

Use cases

  • Pulling names, emails or order numbers out of support messages or intake forms.
  • Highlighting personal data in short chat messages before storage or display.
  • Building a review step where low-probability extractions are confirmed by a user.
  • Running extraction from a coding agent or serverless function on short text.

Quick start

  1. 1

    Install the package from npm

    npm install jeveryword
  2. 2

    Set your TypeSafe API key as an environment variable

    export TYPESAFE_API_KEY=…
  3. 3

    Import extractSpans and createJevClient and run extraction on your text (see the README example)

Things to know

  • The README calls it experimental and says it has been checked only on a small set of synthetic messages, with no benchmarks.
  • Running it requires a TypeSafe API key, and each call is billed at Jev's list price.
  • It requires Node 20 or newer.

In collections

Topics

FAQ

What is jeveryword?
A zero-dependency JavaScript library that uses TypeSafe's multiple-choice Jev model to extract exact text spans, field values and PII labels from short messages. jeveryword makes TypeSafe's Jev model usable for text extraction. Jev only answers multiple-choice questions and cannot generate text, so the library numbers the words of your input, offers those numbers as answer options, and maps the chosen numbers back to the original substring with character offsets. Every returned value is therefore a verbatim slice of the input, and each result carries a probability that can guide which values to confirm with a user.
Is jeveryword free to use? What license does it have?
jeveryword is open source under the MIT license. Check the license terms before using it in commercial products.
Is jeveryword still maintained?
Updated within 6 months. The last commit to jeveryword was on Sep 20, 2026.
What can I use jeveryword for?
Pulling names, emails or order numbers out of support messages or intake forms. Highlighting personal data in short chat messages before storage or display. Building a review step where low-probability extractions are confirmed by a user. Running extraction from a coding agent or serverless function on short text.
How do I install jeveryword?
Install the package from npm: npm install jeveryword Set your TypeSafe API key as an environment variable: export TYPESAFE_API_KEY=… Import extractSpans and createJevClient and run extraction on your text (see the README example)
Where can I get jeveryword?
The source code and installation instructions are on GitHub: https://github.com/jkrup/jeveryword

Summary generated by AI from the project's README. GitHub stats refresh daily.

Related projects