https://github.com/mauroerta/pluralize-me
plurilizeME module helps you to singularize or pluralize a given word.
https://github.com/mauroerta/pluralize-me
plural pluralization pluralize singular singularize singularizer
Last synced: 4 months ago
JSON representation
plurilizeME module helps you to singularize or pluralize a given word.
- Host: GitHub
- URL: https://github.com/mauroerta/pluralize-me
- Owner: mauroerta
- License: mit
- Created: 2019-09-09T15:47:34.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2020-08-29T06:19:11.000Z (almost 6 years ago)
- Last Synced: 2025-10-17T11:51:42.106Z (8 months ago)
- Topics: plural, pluralization, pluralize, singular, singularize, singularizer
- Language: TypeScript
- Homepage:
- Size: 14.6 KB
- Stars: 2
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 🍞 🍷 pluralizeME
pluralizeME module helps you to singularize or pluralize a given word.
# ⚙ How to use
First of all, install pluralize-me
```bash
npm i pluralize-me
```
or
```bash
yarn add pluralize-me
```
Then, you just need to import the singular and plural functions:
```javascript
import { singular, plural } from 'pluralize-me';
```
And use it!
```javascript
const pluralWord = plural(`foot`); // Will return the string `feet`
const singularWord = singular(`feet`); // Will return the string `foot`
```
# 🎓 Example
```javascript
import { singular, plural } from 'pluralize-me';
const singulars = [
'foot',
'computer'
];
let plurals = [];
console.log('Testing singular --> plural');
singulars.forEach(word => {
const pluralWord = plural(word);
plurals.push(pluralWord)
console.log(`The plural of ${word} is ${pluralWord}`);
});
console.log('---------------------------');
console.log('Testing plural --> singular');
plurals.forEach(word => {
console.log(`The singular of ${word} is ${singular(word)}`);
});
```
The output of this simple code will be:
```
Testing singular --> plural
The plural of foot is feet
The plural of computer is computers
---------------------------
Testing plural --> singular
The singular of feet is foot
The singular of computers is computer
```