https://github.com/lamansky/sorp
[Node.js] Returns a singular or plural form depending on a given number.
https://github.com/lamansky/sorp
Last synced: 3 months ago
JSON representation
[Node.js] Returns a singular or plural form depending on a given number.
- Host: GitHub
- URL: https://github.com/lamansky/sorp
- Owner: lamansky
- License: mit
- Created: 2018-01-31T11:02:30.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2018-01-31T11:03:32.000Z (over 8 years ago)
- Last Synced: 2025-03-23T10:19:53.658Z (over 1 year ago)
- Language: JavaScript
- Size: 1000 Bytes
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: license.txt
Awesome Lists containing this project
README
# sorp
Returns a singular or plural form depending on a given number.
Does not generate plural forms for you. There are plenty of other modules that do that. This module omits that overhead deliberately.
## Installation
Requires [Node.js](https://nodejs.org/) 4.0.0 or above.
```bash
npm i sorp
```
The module exports a single function.
## Usage Example
```javascript
const sorp = require('sorp')
sorp(0, 'thing', 'things') // 'things'
sorp(1, 'thing', 'things') // 'thing'
sorp(2, 'thing', 'things') // 'things'
```