{"name":"inflection","version":"1.8.0","description":"A port of inflection-js to node.js module","keywords":["inflection","inflections","inflection-js","pluralize","singularize","camelize","underscore","humanize","capitalize","dasherize","titleize","demodulize","tableize","classify","foreign_key","ordinalize"],"author":{"name":"dreamerslab","email":"ben@dreamerslab.com"},"contributors":[{"name":"Ryan Schuft","email":"ryan.schuft@gmail.com"},{"name":"Ben Lin","email":"ben@dreamerslab.com"},{"name":"Lance Pollard","email":"lancejpollard@gmail.com"},{"name":"Dane O'Connor","email":"dane.oconnor@gmail.com"},{"name":"David Miró","email":"lite.3engine@gmail.com"},{"name":"brandondewitt"},{"name":"luk3thomas"},{"name":"Marcel Klehr"},{"name":"Raymond Feng"},{"name":"Kane Cohen","email":"kanecohen@gmail.com"},{"name":"Gianni Chiappetta","email":"gianni@runlevel6.org"},{"name":"Eric Brody"},{"name":"overlookmotel"},{"name":"Patrick Mowrer"},{"name":"Greger Olsson"},{"name":"Jason Crawford","email":"jason@jasoncrawford.org"}],"dependencies":{},"devDependencies":{"mocha":"2.3.4","should":"7.1.1"},"main":"./lib/inflection.js","repository":{"type":"git","url":"https://github.com/dreamerslab/node.inflection.git"},"engines":["node >= 0.4.0"],"license":"MIT","scripts":{"test":"mocha -R spec"},"gitHead":"c8fbeeaf7291f5b84f53519cc85e3e92e682af3e","bugs":{"url":"https://github.com/dreamerslab/node.inflection/issues"},"homepage":"https://github.com/dreamerslab/node.inflection","_id":"inflection@1.8.0","_shasum":"0b8ccf7620c944dd17e44c9d38830a01385b07e2","_from":".","_npmVersion":"1.4.28","_npmUser":{"name":"dreamerslab","email":"ben@dreamerslab.com"},"maintainers":[{"name":"dreamerslab","email":"ben@dreamerslab.com"}],"dist":{"shasum":"0b8ccf7620c944dd17e44c9d38830a01385b07e2","tarball":"http://registry-npm.ywwl.com/inflection/download/inflection-1.8.0.tgz","integrity":"sha512-r4oJL+Vs5l/0vhO/71fch07Iq+lg1RFwoXzAGF3WUgb/qV9i5V9nBl/jWIHzttJN+tmWJ+XZa9TsvDfYXvcsxg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAQ+wfYCi2jh+YOyD0WB3OZXIYmCe5rVdf7p5+osSsx6AiEA2tvt+4XsRG6XaqREg7BJHMFP3jlfuofbhNKNwkvaDsI="}],"size":13798,"noattachment":false,"key":"/inflection/-/inflection-1.8.0.tgz"},"directories":{},"readme":"# inflection\n\nA package to transform english strings into other forms like the plural form, singular form, camelCase form, etc.\n\n<a href=\"https://www.npmjs.com/package/inflection\"><img src=\"https://img.shields.io/npm/v/inflection\" alt=\"NPM Version\" /></a>\n\n## Description\n\nThis package was originally a port of [inflection-js](http://code.google.com/p/inflection-js/), which is a port of the functionality from Ruby on Rails' Active Support Inflection classes into Javascript.\n\nNote: This library uses [Wiktionary](http://en.wiktionary.org) as its reference.\n\n## Requires\n\nCheckout `package.json` for dependencies.\n\n## Angular Support\n\nCheckout [ngInflection](https://github.com/konsumer/ngInflection) from [konsumer](https://github.com/konsumer)\n\n## Meteor Support\n\nCheckout [Meteor Inflector](https://github.com/katrotz/meteor-inflector) from [Veaceslav Cotruta](https://github.com/katrotz)\n\n## Installation\n\nInstall inflection through npm\n\n    npm install inflection\n\n## API\n\n- inflection.pluralize( str, plural );\n- inflection.singularize( str, singular );\n- inflection.inflect( str, count, singular, plural );\n- inflection.camelize( str, low_first_letter );\n- inflection.underscore( str, all_upper_case );\n- inflection.humanize( str, low_first_letter );\n- inflection.capitalize( str );\n- inflection.dasherize( str );\n- inflection.titleize( str );\n- inflection.demodulize( str );\n- inflection.tableize( str );\n- inflection.classify( str );\n- inflection.foreign_key( str, drop_id_ubar );\n- inflection.ordinalize( str );\n- inflection.transform( str, arr );\n\n## Usage\n\n> Require the module before using\n\n    const inflection = require( 'inflection' );\n\n### inflection.pluralize( str, plural );\n\nThis function adds pluralization support to every String object.\n\n#### Arguments\n\n> str\n\n    type: String\n    desc: The subject string.\n\n> plural\n\n    type: String\n    desc: Overrides normal output with said String.(optional)\n\n#### Example code\n\n    var inflection = require( 'inflection' );\n\n    inflection.pluralize( 'person' ); // === 'people'\n    inflection.pluralize( 'octopus' ); // === \"octopi\"\n    inflection.pluralize( 'Hat' ); // === 'Hats'\n    inflection.pluralize( 'person', 'guys' ); // === 'guys'\n\n### inflection.singularize( str, singular );\n\nThis function adds singularization support to every String object.\n\n#### Arguments\n\n> str\n\n    type: String\n    desc: The subject string.\n\n> singular\n\n    type: String\n    desc: Overrides normal output with said String.(optional)\n\n#### Example code\n\n    var inflection = require( 'inflection' );\n\n    inflection.singularize( 'people' ); // === 'person'\n    inflection.singularize( 'octopi' ); // === \"octopus\"\n    inflection.singularize( 'Hats' ); // === 'Hat'\n    inflection.singularize( 'guys', 'person' ); // === 'person'\n\n### inflection.inflect( str, count, singular, plural );\n\nThis function will pluralize or singularlize a String appropriately based on an integer value.\n\n#### Arguments\n\n> str\n\n    type: String\n    desc: The subject string.\n\n> count\n\n    type: Number\n    desc: The number to base pluralization off of.\n\n> singular\n\n    type: String\n    desc: Overrides normal output with said String.(optional)\n\n> plural\n\n    type: String\n    desc: Overrides normal output with said String.(optional)\n\n#### Example code\n\n    \tvar inflection = require( 'inflection' );\n\n    \tinflection.inflect( 'people', 1 ); // === 'person'\n    \tinflection.inflect( 'octopi', 1 ); // === 'octopus'\n    \tinflection.inflect( 'Hats', 1 ); // === 'Hat'\n    \tinflection.inflect( 'guys', 1 , 'person' ); // === 'person'\n    \tinflection.inflect( 'person', 2 ); // === 'people'\n    \tinflection.inflect( 'octopus', 2 ); // === 'octopi'\n    \tinflection.inflect( 'Hat', 2 ); // === 'Hats'\n    \tinflection.inflect( 'person', 2, null, 'guys' ); // === 'guys'\n\n### inflection.camelize( str, low_first_letter );\n\nThis function transforms String object from underscore to camelcase.\n\n#### Arguments\n\n> str\n\n    type: String\n    desc: The subject string.\n\n> low_first_letter\n\n    type: Boolean\n    desc: Default is to capitalize the first letter of the results. Passing true will lowercase it. (optional)\n\n#### Example code\n\n    var inflection = require( 'inflection' );\n\n    inflection.camelize( 'message_properties' ); // === 'MessageProperties'\n    inflection.camelize( 'message_properties', true ); // === 'messageProperties'\n\n### inflection.underscore( str, all_upper_case );\n\nThis function transforms String object from camelcase to underscore.\n\n#### Arguments\n\n> str\n\n    type: String\n    desc: The subject string.\n\n> all_upper_case\n\n    type: Boolean\n    desc: Default is to lowercase and add underscore prefix\n\n#### Example code\n\n    var inflection = require( 'inflection' );\n\n    inflection.underscore( 'MessageProperties' ); // === 'message_properties'\n    inflection.underscore( 'messageProperties' ); // === 'message_properties'\n    inflection.underscore( 'MP' ); // === 'm_p'\n    inflection.underscore( 'MP', true ); // === 'MP'\n\n### inflection.humanize( str, low_first_letter );\n\nThis function adds humanize support to every String object.\n\n#### Arguments\n\n> str\n\n    type: String\n    desc: The subject string.\n\n> low_first_letter\n\n    type: Boolean\n    desc: Default is to capitalize the first letter of the results. Passing true will lowercase it. (optional)\n\n#### Example code\n\n    var inflection = require( 'inflection' );\n\n    inflection.humanize( 'message_properties' ); // === 'Message properties'\n    inflection.humanize( 'message_properties', true ); // === 'message properties'\n\n### inflection.capitalize( str );\n\nThis function adds capitalization support to every String object.\n\n#### Arguments\n\n> str\n\n    type: String\n    desc: The subject string.\n\n#### Example code\n\n    var inflection = require( 'inflection' );\n\n    inflection.capitalize( 'message_properties' ); // === 'Message_properties'\n    inflection.capitalize( 'message properties', true ); // === 'Message properties'\n\n### inflection.dasherize( str );\n\nThis function replaces underscores with dashes in the string.\n\n#### Arguments\n\n> str\n\n    type: String\n    desc: The subject string.\n\n#### Example code\n\n    var inflection = require( 'inflection' );\n\n    inflection.dasherize( 'message_properties' ); // === 'message-properties'\n    inflection.dasherize( 'Message Properties' ); // === 'Message-Properties'\n\n### inflection.titleize( str );\n\nThis function adds titleize support to every String object.\n\n#### Arguments\n\n> str\n\n    type: String\n    desc: The subject string.\n\n#### Example code\n\n    var inflection = require( 'inflection' );\n\n    inflection.titleize( 'message_properties' ); // === 'Message Properties'\n    inflection.titleize( 'message properties to keep' ); // === 'Message Properties to Keep'\n\n### inflection.demodulize( str );\n\nThis function adds demodulize support to every String object.\n\n#### Arguments\n\n> str\n\n    type: String\n    desc: The subject string.\n\n#### Example code\n\n    var inflection = require( 'inflection' );\n\n    inflection.demodulize( 'Message::Bus::Properties' ); // === 'Properties'\n\n### inflection.tableize( str );\n\nThis function adds tableize support to every String object.\n\n#### Arguments\n\n> str\n\n    type: String\n    desc: The subject string.\n\n#### Example code\n\n    var inflection = require( 'inflection' );\n\n    inflection.tableize( 'MessageBusProperty' ); // === 'message_bus_properties'\n\n### inflection.classify( str );\n\nThis function adds classification support to every String object.\n\n#### Arguments\n\n> str\n\n    type: String\n    desc: The subject string.\n\n#### Example code\n\n    var inflection = require( 'inflection' );\n\n    inflection.classify( 'message_bus_properties' ); // === 'MessageBusProperty'\n\n### inflection.foreign_key( str, drop_id_ubar );\n\nThis function adds foreign key support to every String object.\n\n#### Arguments\n\n> str\n\n    type: String\n    desc: The subject string.\n\n> low_first_letter\n\n    type: Boolean\n    desc: Default is to seperate id with an underbar at the end of the class name, you can pass true to skip it.(optional)\n\n#### Example code\n\n    var inflection = require( 'inflection' );\n\n    inflection.foreign_key( 'MessageBusProperty' ); // === 'message_bus_property_id'\n    inflection.foreign_key( 'MessageBusProperty', true ); // === 'message_bus_propertyid'\n\n### inflection.ordinalize( str );\n\nThis function adds ordinalize support to every String object.\n\n#### Arguments\n\n> str\n\n    type: String\n    desc: The subject string.\n\n#### Example code\n\n    var inflection = require( 'inflection' );\n\n    inflection.ordinalize( 'the 1 pitch' ); // === 'the 1st pitch'\n\n### inflection.transform( str, arr );\n\nThis function performs multiple inflection methods on a string.\n\n#### Arguments\n\n> str\n\n    type: String\n    desc: The subject string.\n\n> arr\n\n    type: Array\n    desc: An array of inflection methods.\n\n#### Example code\n\n    var inflection = require( 'inflection' );\n\n    inflection.transform( 'all job', [ 'pluralize', 'capitalize', 'dasherize' ]); // === 'All-jobs'\n\n## Credit\n\n- Ryan Schuft <ryan.schuft@gmail.com>\n- Lance Pollard <lancejpollard@gmail.com> (Browser support)\n- Dane O'Connor <dane.oconnor@gmail.com>\n- brandondewitt\n- luk3thomas\n- Marcel Klehr\n- Raymond Feng\n- Kane Cohen <kanecohen@gmail.com>\n- Gianni Chiappetta <gianni@runlevel6.org>\n- Eric Brody\n- overlookmotel\n- Patrick Mowrer\n- Greger Olsson\n- Jason Crawford <jason@jasoncrawford.org>\n- Ray Myers <ray.myers@gmail.com>\n\n## License\n\n(The MIT License)\n\nCopyright (c) 2011 dreamerslab &lt;ben@dreamerslab.com&gt;\n\nPermission is hereby granted, free of charge, to any person obtaining\na copy of this software and associated documentation files (the\n'Software'), to deal in the Software without restriction, including\nwithout limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of the Software, and to\npermit persons to whom the Software is furnished to do so, subject to\nthe following conditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\nIN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\nCLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\nTORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\nSOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","publish_time":1448184497215,"_cnpm_publish_time":1448184497215,"dist-tags":{"latest":"3.0.2"}}