Nondeterministic Palindrome Machine
Learn about our RFC process, Open RFC meetings & more.Join in the discussion! »

@nathanfaucett/tableize

0.0.1 • Public • Published

tableize

tableize strings

var tableize = require("@nathanfaucett/tableize"),
    inflections = require("@nathanfaucett/inflections");
 
 
var en = inflections("en");
 
en.plural(/$/, "s");
en.plural(/(ch|sh|ss|[sxz])$/i, "$1es");
en.plural(/([^aeiouy])y$/i, "$1ies");
 
tableize("Box") === "boxes";
tableize("Sky") === "skies";
tableize("BikeRider", false) === "bike_riders";
tableize("MegaBigSale") === "megaBigSales";

Install

npm i @nathanfaucett/tableize

DownloadsWeekly Downloads

2

Version

0.0.1

License

MIT

Last publish

Collaborators

  • avatar