mirror of https://gitee.com/bigwinds/arangodb
80 lines
5.2 KiB
JSON
80 lines
5.2 KiB
JSON
{
|
|
"name": "i",
|
|
"version": "0.3.2",
|
|
"author": {
|
|
"name": "Pavan Kumar Sunkara",
|
|
"email": "pavan.sss1991@gmail.com",
|
|
"url": "pksunkara.github.com"
|
|
},
|
|
"description": "custom inflections for nodejs",
|
|
"main": "./lib/inflect",
|
|
"repository": {
|
|
"type": "git",
|
|
"url": "git://github.com/pksunkara/inflect.git"
|
|
},
|
|
"keywords": [
|
|
"singular",
|
|
"plural",
|
|
"camelize",
|
|
"underscore",
|
|
"dasherize",
|
|
"demodulize",
|
|
"ordinalize",
|
|
"uncountable",
|
|
"pluralize",
|
|
"singularize",
|
|
"titleize",
|
|
"tableize",
|
|
"classify",
|
|
"foreign_key"
|
|
],
|
|
"homepage": "http://pksunkara.github.com/inflect",
|
|
"scripts": {
|
|
"test": "vows --spec $(find test -name '*-test.js')"
|
|
},
|
|
"contributors": [
|
|
{
|
|
"name": "Pavan Kumar Sunkara",
|
|
"email": "pavan.sss1991@gmail.com"
|
|
}
|
|
],
|
|
"dependencies": {},
|
|
"devDependencies": {
|
|
"vows": "~0.6.1"
|
|
},
|
|
"engines": {
|
|
"node": ">=0.4"
|
|
},
|
|
"bugs": {
|
|
"url": "https://github.com/pksunkara/inflect/issues"
|
|
},
|
|
"licenses": [
|
|
{
|
|
"type": "MIT",
|
|
"url": "https://github.com/pksunkara/inflect/raw/master/LICENSE"
|
|
}
|
|
],
|
|
"readme": "# inflect\n\ncustomizable inflections for nodejs\n\n## Installation\n\n```bash\nnpm install i\n```\n\n## Usage\n\nRequire the module before using\n\n```js\nvar inflect = require('i')();\n```\n\nAll the below api functions can be called directly on a string\n\n```js\ninflect.titleize('messages to store') // === 'Messages To Store'\n'messages to store'.titleize // === 'Messages To Store'\n```\n\nonly if `true` is passed while initiating\n\n```js\nvar inflect = require('i')(true);\n```\n\n### Pluralize\n\n```js\ninflect.pluralize('person'); // === 'people'\ninflect.pluralize('octopus'); // === 'octopi'\ninflect.pluralize('Hat'); // === 'Hats'\n```\n\n### Singularize\n\n```js\ninflect.singularize('people'); // === 'person'\ninflect.singularize('octopi'); // === 'octopus'\ninflect.singularize('Hats'); // === 'Hat'\n```\n\n### Camelize\n\n```js\ninflect.camelize('message_properties'); // === 'MessageProperties'\ninflect.camelize('message_properties', false); // === 'messageProperties'\n```\n\n### Underscore\n\n```js\ninflect.underscore('MessageProperties'); // === 'message_properties'\ninflect.underscore('messageProperties'); // === 'message_properties'\n```\n\n### Humanize\n\n```js\ninflect.humanize('message_id'); // === 'Message'\n```\n\n### Dasherize\n\n```js\ninflect.dasherize('message_properties'); // === 'message-properties'\ninflect.dasherize('Message Properties'); // === 'Message Properties'\n```\n\n### Titleize\n\n```js\ninflect.titleize('message_properties'); // === 'Message Properties'\ninflect.titleize('message properties to keep'); // === 'Message Properties to Keep'\n```\n\n### Demodulize\n\n```js\ninflect.demodulize('Message.Bus.Properties'); // === 'Properties'\n```\n\n### Tableize\n\n```js\ninflect.tableize('MessageBusProperty'); // === 'message_bus_properties'\n```\n\n### Classify\n\n```js\ninflect.classify('message_bus_properties'); // === 'MessageBusProperty'\n```\n\n### Foreign key\n\n```js\ninflect.foreign_key('MessageBusProperty'); // === 'message_bus_property_id'\ninflect.foreign_key('MessageBusProperty', false); // === 'message_bus_propertyid'\n```\n\n### Ordinalize\n\n```js\ninflect.ordinalize( '1' ); // === '1st'\n```\n\n## Custom rules for inflection\n\n### Custom plural\n\nWe can use regexp in any of these custom rules\n\n```js\ninflect.inflections.plural('person', 'guys');\ninflect.pluralize('person'); // === 'guys'\ninflect.singularize('guys'); // === 'guy'\n```\n\n### Custom singular\n\n```js\ninflect.inflections.singular('guys', 'person')\ninflect.singularize('guys'); // === 'person'\ninflect.pluralize('person'); // === 'people'\n```\n\n### Custom irregular\n\n```js\ninflect.inflections.irregular('person', 'guys')\ninflect.pluralize('person'); // === 'guys'\ninflect.singularize('guys'); // === 'person'\n```\n\n### Custom human\n\n```js\ninflect.inflections.human(/^(.*)_cnt$/i, '$1_count');\ninflect.inflections.humanize('jargon_cnt'); // === 'Jargon count'\n```\n\n### Custom uncountable\n\n```js\ninflect.inflections.uncountable('oil')\ninflect.pluralize('oil'); // === 'oil'\ninflect.singularize('oil'); // === 'oil'\n```\n\n## Contributors\nHere is a list of [Contributors](http://github.com/pksunkara/inflect/contributors)\n\n### TODO\n\n- More obscure test cases\n\n__I accept pull requests and guarantee a reply back within a day__\n\n## License\nMIT/X11\n\n## Bug Reports\nReport [here](http://github.com/pksunkara/inflect/issues). __Guaranteed reply within a day__.\n\n## Contact\nPavan Kumar Sunkara (pavan.sss1991@gmail.com)\n\nFollow me on [github](https://github.com/users/follow?target=pksunkara), [twitter](http://twitter.com/pksunkara)\n",
|
|
"readmeFilename": "README.md",
|
|
"_id": "i@0.3.2",
|
|
"dist": {
|
|
"shasum": "b2e2d6ef47900bd924e281231ff4c5cc798d9ea8",
|
|
"tarball": "http://registry.npmjs.org/i/-/i-0.3.2.tgz"
|
|
},
|
|
"_from": "i@*",
|
|
"_npmVersion": "1.3.5",
|
|
"_npmUser": {
|
|
"name": "pksunkara",
|
|
"email": "pavan.sss1991@gmail.com"
|
|
},
|
|
"maintainers": [
|
|
{
|
|
"name": "pksunkara",
|
|
"email": "pavan.sss1991@gmail.com"
|
|
}
|
|
],
|
|
"directories": {},
|
|
"_shasum": "b2e2d6ef47900bd924e281231ff4c5cc798d9ea8",
|
|
"_resolved": "https://registry.npmjs.org/i/-/i-0.3.2.tgz"
|
|
}
|