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

@seanmozeik/yake-ts

v0.1.0

Published

Fast, dependency-free YAKE keyword extraction for TypeScript

Readme

@seanmozeik/yake-ts

Fast, dependency-free keyword extraction for TypeScript, based on YAKE's unsupervised single-document method. It uses only standard JavaScript in the emitted library and runs in Bun, Deno, browsers, Node, and edge runtimes.

Install

bun add @seanmozeik/yake-ts
import { extractKeywords } from '@seanmozeik/yake-ts';

const keywords = extractKeywords(document, { language: 'en', maxNgramSize: 3, top: 10 });

Each result has { keyword, score }. Lower scores are stronger. Results sort by score, then by first candidate appearance when scores tie, so repeated calls are deterministic.

Options

  • language selects a bundled stop-word pack and defaults to en.
  • maxNgramSize bounds generated phrases from 1 through 10 tokens and defaults to 3.
  • windowSize controls the previous-token context radius from 1 through 10 and defaults to 1.
  • top bounds results from 1 through 1,000 and defaults to 20.
  • deduplicationThreshold is from 0 through 1 and defaults to 0.9. A lower-ranked phrase is removed when its character-bigram similarity to an accepted phrase is greater than the threshold. 1 disables suppression.
  • stopWords accepts a readonly array or set. It replaces, rather than extends, the selected language pack for that call. Matching is case-insensitive.

Every option is validated before extraction. Empty or punctuation-only strings return an empty array.

Languages

The package adapts all useful stop-word packs shipped by the pinned upstream YAKE source:

ar, bg, br, cz, da, de, el, en, es, et, fa, fi, fr, hi, hr, hu, hy, id, it, ja, lt, lv, nl, no, pl, pt, ro, ru, sk, sl, sv, tr, uk, and zh.

Tokenization is Unicode-aware and treats punctuation as a phrase boundary. CJK characters are scanned as compact tokens so unspaced Chinese and Japanese text can form phrases without inserted spaces. The implementation intentionally follows the YAKE paper's statistical intent rather than Python tokenization or floating-point quirks.

Development

Use Bun 1.4 or newer:

bun install
bun run verify
bun run bench

verify never rewrites source files; it recreates only the ignored dist build output. Its Bun consumer resolves the package root through the export map and typechecks the emitted declarations; the Deno consumer checks and runs the same browser artifact. The benchmark uses diverse deterministic short, medium, and long corpora, rejects invalid or nondeterministic output, and reports raw samples, latency statistics, throughput, and machine metadata. See benchmarks/README.md.

Method and license

YAKE combines document-local frequency, casing, first position, sentence dispersion, and directed context statistics. Candidate n-grams combine their constituent term scores and use contextual weights for internal stop words. No model, dictionary, native binding, runtime dependency, or external corpus is used.

This package is licensed under AGPL-3.0-or-later. See THIRD_PARTY_NOTICES.md for the pinned YAKE source, modification notice, and citation.

Corresponding source

The complete source for every npm release is available from the matching public Git tag at github.com/seanmozeik/yake-ts. The source for npm version 0.1.0 is tag v0.1.0. It includes the TypeScript source, tests, build scripts, configuration, and lockfile needed to rebuild the package.

The npm package contains the compiled library and legal notices. GitHub is the designated no-charge source location for AGPL section 6(d).