Skip to content

Commit

Permalink
Add license, update readme and rename index file.
Browse files Browse the repository at this point in the history
  • Loading branch information
blakeembrey committed Dec 30, 2013
1 parent fe40912 commit 6cc3cdf
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 17 deletions.
21 changes: 21 additions & 0 deletions LICENSE
@@ -0,0 +1,21 @@
The MIT License (MIT)

Copyright (c) 2013 Blake Embrey (hello@blakeembrey.com)

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
34 changes: 18 additions & 16 deletions Readme.md
Expand Up @@ -6,7 +6,7 @@ Return a pluralized or singularized word based on the input string.

```javascript
npm install pluralize --save
bower install pluralize
bower install pluralize --save
```

## API
Expand All @@ -24,27 +24,29 @@ var pluralize = require('pluralize');
* `pluralize.addIrregularRule(singular, plural)`

```javascript
pluralize('test') // tests
pluralize('test', 1) // test
pluralize('test', 5) // tests
pluralize('test', 1, true) // 1 test
pluralize('test', 5, true) // 5 tests
pluralize('test') // "tests"
pluralize('test', 1) // "test"
pluralize('test', 5) // "tests"
pluralize('test', 1, true) // "1 test"
pluralize('test', 5, true) // "5 tests"

// pluralize.plural() and pluralize.singular() are pretty self explanatory

plural('regex') // regexes
plural('regex') // "regexes"
pluralize.addPluralRule(/gex$/i, 'gexii')
plural('regex') // regexii
plural('regex') // "regexii"

plural('singles', 1) // single
plural('singles', 1) // "single"
pluralize.addSingularRule(/singles$/i, 'singular')
plural('singles', 1) // singular
plural('singles', 1) // "singular"

plural('irregular') // irregulars
plural('irregular') // "irregulars"
plural.addIrregularRule('irregular', 'regular')
plural('irregular') // regular
plural('irregular') // "regular"

plural('paper') // papers
plural('paper') // "papers"
plural.addUncountableRule('paper');
plural('paper') // paper
plural('paper') // "paper"
```

## License

MIT
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -2,7 +2,7 @@
"name": "pluralize",
"version": "0.0.6",
"description": "Pluralize and singularize words with ease",
"main": "index.js",
"main": "pluralize.js",
"scripts": {
"test": "istanbul cover _mocha -- -R spec"
},
Expand Down
File renamed without changes.

0 comments on commit 6cc3cdf

Please sign in to comment.