Skip to content
singularize for the browser and node.js
JavaScript
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
src
test
.editorconfig
.gitignore
.npmignore
.travis.yml
Gruntfile.js
LICENSE
README.md
package.json

README.md

singularize

singularize words, uses global inflector from inflections @nathanfaucett/inflections

var singularize = require("@nathanfaucett/singularize"),
    inflections = require("@nathanfaucett/inflections");


var en = inflections("en");

en.singular(/s$/i, "");
en.singular(/(ch|sh|ss|[sxz])es$/i, "$1");
en.singular(/([^aeiouy])ies$/i, "$1y");

singularize("words") === "word";
singularize("skies") === "sky";
singularize("boxes") === "box";
You can’t perform that action at this time.