Get unlimited public & private packages + package-based permissions with npm Pro.Get started »

js-inflector

0.0.1 • Public • Published

js-inflector

Word magic.

Quick Start

var inflector = require('js-inflector');
var inflect = inflector.start();

Examples

var someValue = 'tree';

Modify word state:

var plural = inflect(someValue, 'plural');  
//--> trees
var capital = inflect(someValue, 'capital');  
//--> Tree

Modify multiple word states at once:

var pluralAndCapital = inflect(someValue, ['capital', 'plural']);  
//--> Trees

Set a group state:

inflector.group({
  'properPlural': ['capital', 'plural']
});

With a group state:

var pluralAndCapital = inflect(someValue, 'properPlural');  
//--> Trees

Word States

  • camelcase (camelcase | camel)
  • capitalize (cap | caps)
  • decapitalize (decapitalize | decap)
  • lowercase (lowercase | lower)
  • pluralize (plural | many)
  • singularize (singular | single)
  • uppercase (uppercase | upper)

Install

npm i js-inflector

DownloadsWeekly Downloads

1

Version

0.0.1

License

MIT

Last publish

Collaborators

  • avatar