Active Inflector is a JavaScript/TypeScript library for pluralizing and singularizing words, aiming for full compatibility with Ruby on Rails' ActiveSupport::Inflector. Version 0.1.0 is the latest stable release, with infrequent updates. It provides both default export of an Inflector class with static methods and convenient standalone singularize/pluralize functions. Key differentiators: Rails-compatible custom rules (irregular, uncountable, uncountable), supports numeric pluralization (e.g., pluralize(2, 'taco') → '2 tacos'), and ships TypeScript types. Requires ESM and environment support for JS private fields.
npm install active-inflectorNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Demonstrates basic singularize/pluralize, numeric pluralization, and custom irregular/uncountable rules.
Use dynamic import() or switch to ESM in your project.
Use Inflector.inflector.singularize() when you need custom rules to apply, otherwise standalone singularize() is fine.
Ensure the first argument is a number, not a string. E.g., pluralize(2, 'taco') not pluralize('2', 'taco').Transpile with Babel/TypeScript targeting older environments, or use a polyfill for private fields.
Pin to exact version and monitor releases.
Use import { Inflector } from 'active-inflector' or dynamic import().Ensure import is correct: import { Inflector } from 'active-inflector'. The Inflector class is exported as a named export, not default.Use a transpiler like Babel with @babel/plugin-proposal-private-methods or target a newer runtime (Node >=12, modern browsers).
No dependency data recorded yet.