@snickbit/plural
v1.0.20
Published
Pluralize and singularize any English word.
Downloads
1,956
Readme
@snickbit/plural
- Pluralizes strings
- Singularizes strings
- Written in TypeScript
- Zero dependencies
Installation
pnpm add @snickbit/plural
yarn add @snickbit/plural
npm i @snickbit/plural
Usage
import {plural, singular} from '@snickbit/plural'
// or in Node.js
// const {plural, singular} = require('@snickbit/plural')
console.log(plural('test')) //=> "tests"
console.log(plural('test', 0)) //=> "tests"
console.log(plural('test', 1)) //=> "test"
console.log(plural('test', 2)) //=> "tests"
// Singularize
console.log(singular('tests')) //=> "test"
console.log(singular('test')) //=> "test"
console.log(singular('test', 0)) //=> "tests"
console.log(singular('test', 2)) //=> "tests"
Documentation
API Docs
CHANGELOG
Acknowledgements
Based on pluralize
License
Copyright (c) 2022 - Nicholas Lowe aka Snickbit