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

inflectkit

v0.1.0

Published

English word inflection: pluralize, singularize, ordinalize, camelize, underscore, humanize. Zero dependencies, TypeScript. Modern replacement for inflected (abandoned 2021).

Downloads

120

Readme

inflectkit

All Contributors

English word inflection: pluralize, singularize, ordinalize, camelize, underscore, humanize, titleize, classify. Zero dependencies, TypeScript.

npm npm downloads License: MIT

Why inflectkit?

| Package | Weekly downloads | Problem | |---------|-----------------|---------| | inflection | 5.3M/week | Old API, cumbersome types | | inflected | 1.7M/week | Abandoned since 2021, requires @types/inflected | | inflectkit | — | Modern TypeScript-first, zero deps, extensible |

Port of Ruby's ActiveSupport::Inflector + Python's inflect.

Install

npm install inflectkit

Quick start

import { pluralize, singularize, ordinalize, camelize, underscore } from "inflectkit";

pluralize("post")        // "posts"
pluralize("cat", 1)      // "cat"   (singular when count === 1)
pluralize("cat", 3)      // "cats"
singularize("people")    // "person"
singularize("matrices")  // "matrix"
ordinalize(1)            // "1st"
ordinalize(11)           // "11th"
ordinalize(21)           // "21st"
camelize("foo_bar")      // "FooBar"
camelize("foo_bar", false) // "fooBar"
underscore("FooBar")     // "foo_bar"

All functions

import {
  pluralize, singularize, ordinalize,
  camelize, underscore, dasherize,
  humanize, titleize, tableize, classify,
  numberWithDelimiter,
  defaultInflector, Inflector,
} from "inflectkit";

// pluralize
pluralize("post")                // "posts"
pluralize("octopus")             // "octopi"
pluralize("sheep")               // "sheep"  (uncountable)
pluralize("child")               // "children"
pluralize("bus")                 // "buses"
pluralize("matrix")              // "matrices"
pluralize("quiz")                // "quizzes"
pluralize("person")              // "people"
pluralize("foot")                // "feet"
pluralize("cat", 1)              // "cat"    (count overload)
pluralize("cat", 2)              // "cats"

// singularize
singularize("posts")             // "post"
singularize("people")            // "person"
singularize("children")          // "child"
singularize("octopi")            // "octopus"
singularize("matrices")          // "matrix"
singularize("fish")              // "fish"   (uncountable)

// ordinalize
ordinalize(1)   // "1st"
ordinalize(2)   // "2nd"
ordinalize(3)   // "3rd"
ordinalize(4)   // "4th"
ordinalize(11)  // "11th"
ordinalize(21)  // "21st"
ordinalize(101) // "101st"

// camelize
camelize("foo_bar")         // "FooBar"
camelize("foo_bar", false)  // "fooBar"
camelize("foo/bar")         // "Foo::Bar"

// underscore
underscore("FooBar")        // "foo_bar"
underscore("Foo::Bar")      // "foo/bar"

// dasherize
dasherize("foo_bar")        // "foo-bar"

// humanize
humanize("foo_bar")         // "Foo bar"
humanize("author_id")       // "Author"   (strips _id)

// titleize
titleize("foo_bar_baz")     // "Foo Bar Baz"
titleize("FooBar")          // "Foo Bar"

// tableize — model name → table name
tableize("RawScaledScorer") // "raw_scaled_scorers"
tableize("Person")          // "people"

// classify — table name → model name
classify("raw_scaled_scorers") // "RawScaledScorer"
classify("people")             // "Person"

// numberWithDelimiter
numberWithDelimiter(1234567)       // "1,234,567"
numberWithDelimiter(1234567, ".")  // "1.234.567"

Custom rules and irregulars

import { Inflector } from "inflectkit";

// Create an independent inflector with custom rules
const inf = new Inflector();

// Custom irregular pair
inf.addIrregular("cactus", "cactuses");
inf.pluralize("cactus");  // "cactuses"
inf.singularize("cactuses");  // "cactus"

// Uncountable words
inf.addUncountable("broccoli");
inf.addUncountable(["kale", "quinoa"]);
inf.pluralize("broccoli");  // "broccoli"

// Custom regex rules
inf.addPluralRule(/(ox)$/i, "$1en");
inf.addSingularRule(/(ox)en$/i, "$1");

Or extend the shared default inflector:

import { defaultInflector } from "inflectkit";
defaultInflector.addIrregular("goose", "geese");

Rails-compatible

tableize, classify, camelize, underscore, humanize, and titleize are fully compatible with Ruby's ActiveSupport::Inflector.

// Rails conventions
tableize("LineItem")    // "line_items"
classify("line_items")  // "LineItem"
tableize("Mouse")       // "mice"
classify("mice")        // "Mouse"

Built-in irregulars

Includes all common English irregulars:

person → people, man → men, child → children, foot → feet, tooth → teeth, goose → geese, mouse → mice, leaf → leaves, knife → knives, wife → wives, life → lives, half → halves, cactus → cacti, focus → foci, fungus → fungi, analysis → analyses, thesis → theses, crisis → crises

Built-in uncountables

equipment, information, rice, money, species, series, fish, sheep, deer, aircraft, news, politics, physics, mathematics

Contributors ✨

This project follows the all-contributors specification. Contributions of any kind are welcome — code, docs, bug reports, ideas, reviews! See the emoji key for how each contribution is recognized, and open a PR or issue to get involved.

Thanks goes to these wonderful people:

License

MIT