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

percent-nlu

v1.0.0

Published

Tiny on-device model that understands percentage questions in English, Portuguese and Spanish and returns the right calculator tool call. Runs in the browser in ~1 ms, no server.

Readme

percent-nlu

Tiny on-device model (1.2 MB) that understands percentage questions in English, Portuguese and Spanish and returns the right calculator tool call — in the browser or Node, in ~1 ms, no server, no API key. MIT.

npm install percent-nlu
import { NLU } from "percent-nlu";

const nlu = await NLU.load();                                   // bundled model
const r = nlu.predict("how much is an 18% tip on $64?", "en");  // "en" | "pt" | "es" (omit to auto-detect)
// r.status === "call" → r.tool === "percent_of", r.args → { rate: 18, base: 64 }, r.result → 11.52

Bundlers and frameworks (Vite, Next.js, webpack, Rollup)

NLU.load() with no argument references the model files with new URL(..., import.meta.url), so Vite and webpack 5 (Next.js) copy manifest.json and weights.bin into your build automatically (tested with Vite 6 and webpack 5). The model must load in the browser, not during server rendering — in Next.js:

"use client";
import { useEffect, useState } from "react";

export function usePercentNLU() {
  const [nlu, setNlu] = useState(null);
  useEffect(() => { import("percent-nlu").then(({ NLU }) => NLU.load()).then(setNlu); }, []);
  return nlu;   // nlu?.predict("how much is an 18% tip on $64?", "en")
}

Prefer to serve the files yourself? Copy node_modules/percent-nlu/model/ to your static folder (e.g. public/percent-nlu/) and call NLU.load("/percent-nlu/").

CDN (no bundler):

import { NLU } from "https://cdn.jsdelivr.net/npm/percent-nlu@1/percent-nlu.js";
const nlu = await NLU.load("https://cdn.jsdelivr.net/npm/percent-nlu@1/model/");

status: call (execute) · low_confidence (confirm with the user) · incomplete (missing says which number to ask for) · out_of_scope. Tools: percent_of, what_percent, percent_increase, percent_decrease, apply_increase, apply_decrease. Types in percent-nlu.d.ts.

Docs, accuracy and the live demo: github.com/EmanoelV/percent-nlu · model on Hugging Face · demo.