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

kevinify

v0.2.0

Published

Reduce tokens by turning many word into few word.

Downloads

21

Readme

kevinify

Why use many word when few word do trick.

kevinify squeezes text for LLM prompts: abbreviates, drops filler, and shortens long words while preserving URLs/emails/@mentions/#hashtags and numbers.

Install

npm i kevinify
# or
npm i -D kevinify

Usage

As a library

import { kevinify, dekevinify } from "kevinify";

const input = "Please send me the documentation about the new API features.";
const compressed = kevinify(input);
// => "pls send me docs abt new api ftrs"

// Expand back to human-readable form
const expanded = dekevinify(compressed);
// => "please send me documentation about new api ftrs"

// With options
const output2 = kevinify(input, {
  removeStopwords: false,
  shortenLongWords: false,
  keepCase: true
});

As a CLI

# Direct input
kevinify "Please help me understand this example"
# => "pls hlp me undrstnd ex"

# From stdin
echo "Thank you for the information" | kevinify
# => "ty 4 info"

# Preserve stopwords
kevinify --keep-stopwords "This is really great"
# => "ths is rly gr8"

# Keep original case
kevinify --keep-case "Please Review The Documentation"
# => "Pls Rvw Docs"

# Disable word shortening
kevinify --no-shorten "Please send information"
# => "pls send info"

Features

  • Abbreviations: Common words → short forms (pleasepls, peopleppl, for4)
  • Stopword removal: Drops filler words like the, a, just, really
  • Vowel compression: Long words → consonant-heavy (informationinformatn)
  • Smart preservation: URLs, emails, @mentions, #hashtags, and numbers stay intact
  • Reversible: dekevinify() expands abbreviations back for human readability
  • Configurable: Control every aspect via options

Options

interface KevinifyOptions {
  abbreviations?: Record<string, string>;  // Custom abbreviation map
  removeStopwords?: boolean;               // Remove filler words (default: true)
  shortenLongWords?: boolean;              // Compress long words (default: true)
  minLengthToShorten?: number;             // Min word length to compress (default: 6)
  keepCase?: boolean;                      // Preserve original case (default: false)
  preserveEntities?: boolean;              // Protect URLs/emails/@/# (default: true)
  aggressiveAmpersand?: boolean;           // Convert "and" → "&" (default: true)
  protectWords?: Set<string>;              // Additional words to never compress
}

Examples

// Basic compression
kevinify("Why use many words when few words do the trick?")
// => "why use many words when few words do trick"

// Preserving entities
kevinify("Check out https://example.com and email [email protected]")
// => "check out https://example.com & email [email protected]"

// Custom abbreviations
kevinify("Hello world", {
  abbreviations: { hello: "hi", world: "wrld" }
})
// => "hi wrld"

// Expand kevinified text back
dekevinify("pls send me docs 4 api")
// => "please send me documentation for api"

dekevinify("ty 4 info abt app")
// => "thank you for information about application"

Dekevinify

The dekevinify() function reverses the compression to make text more human-readable:

import { dekevinify } from "kevinify";

// Expands abbreviations back
const text = "pls send me docs abt api w/ examples b4 prod";
console.log(dekevinify(text));
// => "please send me documentation about api with examples before production"

Note: Dekevinify is lossy - it can't restore:

  • Removed stopwords (a, the, just, etc.)
  • Stripped vowels from long words
  • But it WILL expand all common abbreviations!
interface DekevinifyOptions {
  abbreviations?: Record<string, string>;  // Custom reverse abbreviations
  preserveEntities?: boolean;              // Protect URLs/emails/@/# (default: true)
}

Why?

LLMs charge by token count. Shorter text = fewer tokens = lower costs. This library helps you:

  • Reduce prompt size for LLM APIs
  • Fit more context within token limits
  • Lower API costs for high-volume applications

Inspired by Kevin Malone's philosophy: "Why waste time say lot word when few word do trick?"

License

MIT