Package Exports
- libwords
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (libwords) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
libwords
libwords is a tiny library for word utils.
DEVELOPMENT version
Usage
const ln = require("libnouns");
console.log(ln.plural(2, "apple")) // => 2 apples
console.log(ln.wordPlural("match")) // => matches
console.log(ln.wordSingular("queries")) // => query
console.log(ln.wordSingular("freebies", true)) // => freebieThe second parameter in ln.wordSingular is whether the word, if it ends in "ies", should end in 'y' or 'ie'.
Documentation
plural(num, item)
Returns a string whiich contains teh number of items num, followed by item if num is 1, or its plural otherwise.