pluralize-me

1.1.1 • Public • Published

🍞 🍷 pluralizeME

plurilizeME module helps you to singularize or pluralize a given word.

⚙ How to use

First of all, install plurilize-me

npm i plurilize-me

or

yarn add plurilize-me

Then, you just need to import the singular and plural functions:

import { singular, plural } from 'plurilize-me';

And use it!

const pluralWord = plural(`foot`); // Will return the string  `feet`
const singularWord = singular(`feet`); // Will return the string `foot`

🎓 Example

import { singular, plural } from 'plurilize-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

Package Sidebar

Install

npm i pluralize-me

Weekly Downloads

2

Version

1.1.1

License

MIT

Unpacked Size

21.3 kB

Total Files

9

Last publish

Collaborators

  • no-brainer