package.json
15.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
{
"_args": [
[
{
"raw": "inflection@1.10.0",
"scope": null,
"escapedName": "inflection",
"name": "inflection",
"rawSpec": "1.10.0",
"spec": "1.10.0",
"type": "version"
},
"/Users/fzy/project/3mang/node_modules/sequelize"
],
[
{
"raw": "inflection@1.10.0",
"scope": null,
"escapedName": "inflection",
"name": "inflection",
"rawSpec": "1.10.0",
"spec": "1.10.0",
"type": "version"
},
"/Users/fzy/project/3mang/node_modules/_sequelize@4.5.0@sequelize"
]
],
"_from": "inflection@1.10.0",
"_id": "inflection@1.10.0",
"_inCache": true,
"_location": "/sequelize/inflection",
"_nodeVersion": "0.10.38",
"_npmOperationalInternal": {
"host": "packages-12-west.internal.npmjs.com",
"tmp": "tmp/inflection-1.10.0.tgz_1461120082370_0.7527084928005934"
},
"_npmUser": {
"name": "dreamerslab",
"email": "ben@dreamerslab.com"
},
"_npmVersion": "3.8.6",
"_phantomChildren": {},
"_requested": {
"raw": "inflection@1.10.0",
"scope": null,
"escapedName": "inflection",
"name": "inflection",
"rawSpec": "1.10.0",
"spec": "1.10.0",
"type": "version"
},
"_requiredBy": [
"/sequelize"
],
"_resolved": "https://registry.npmjs.org/inflection/-/inflection-1.10.0.tgz",
"_shasum": "5bffcb1197ad3e81050f8e17e21668087ee9eb2f",
"_shrinkwrap": null,
"_spec": "inflection@1.10.0",
"_where": "/Users/fzy/project/3mang/node_modules/_sequelize@4.5.0@sequelize",
"author": {
"name": "dreamerslab",
"email": "ben@dreamerslab.com"
},
"bugs": {
"url": "https://github.com/dreamerslab/node.inflection/issues"
},
"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"
},
{
"name": "Ray Myers",
"email": "ray.myers@gmail.com"
}
],
"dependencies": {},
"description": "A port of inflection-js to node.js module",
"devDependencies": {
"mocha": "2.4.5",
"should": "8.3.1"
},
"directories": {},
"dist": {
"shasum": "5bffcb1197ad3e81050f8e17e21668087ee9eb2f",
"tarball": "https://registry.npmjs.org/inflection/-/inflection-1.10.0.tgz"
},
"engines": [
"node >= 0.4.0"
],
"gitHead": "45bb94c3d42c75ab8842493ab5533ba35c30275d",
"homepage": "https://github.com/dreamerslab/node.inflection#readme",
"keywords": [
"inflection",
"inflections",
"inflection-js",
"pluralize",
"singularize",
"camelize",
"underscore",
"humanize",
"capitalize",
"dasherize",
"titleize",
"demodulize",
"tableize",
"classify",
"foreign_key",
"ordinalize"
],
"license": "MIT",
"main": "./lib/inflection.js",
"maintainers": [
{
"name": "dreamerslab",
"email": "ben@dreamerslab.com"
}
],
"name": "inflection",
"optionalDependencies": {},
"readme": "# inflection\n\nA port of inflection-js to node.js module\n\n\n\n## Description\n[inflection-js](http://code.google.com/p/inflection-js/) is a port of the functionality from Ruby on Rails' Active Support Inflection classes into Javascript. `inflection` is a port of `inflection-js` to node.js npm package. Instead of [extending JavaScript native](http://wonko.com/post/extending-javascript-natives) String object like `inflection-js` does, `inflection` separate the methods to a independent package to avoid unexpected behaviors.\n\nNote: This library uses [Wiktionary](http://en.wiktionary.org) as its reference.\n\n\n\n## Requires\n\nCheckout `package.json` for dependencies.\n\n\n\n## Angular Support\n\nCheckout [ngInflection](https://github.com/konsumer/ngInflection) from [konsumer](https://github.com/konsumer)\n\n\n\n## Meteor Support\n\nCheckout [Meteor Inflector](https://github.com/katrotz/meteor-inflector) from [Veaceslav Cotruta](https://github.com/katrotz)\n\n\n\n## Installation\n\nInstall inflection through npm\n\n\tnpm install inflection\n\n\n\n## API\n\n- inflection.indexOf( arr, item, from_index, compare_func );\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\n\n## Usage\n\n> Require the module before using\n\n\tvar inflection = require( 'inflection' );\n\n\n\n### inflection.indexOf( arr, item, from_index, compare_func );\n\nThis lets us detect if an Array contains a given element.\n\n#### Arguments\n\n> arr\n\n\ttype: Array\n\tdesc: The subject array.\n\n> item\n\n\ttype: Object\n\tdesc: Object to locate in the Array.\n\n> from_index\n\n\ttype: Number\n\tdesc: Starts checking from this position in the Array.(optional)\n\n> compare_func\n\n\ttype: Function\n\tdesc: Function used to compare Array item vs passed item.(optional)\n\n#### Example code\n\n\tvar inflection = require( 'inflection' );\n\n\tinflection.indexOf([ 'hi','there' ], 'guys' ); // === -1\n\tinflection.indexOf([ 'hi','there' ], 'hi' ); // === 0\n\n\n\n### inflection.pluralize( str, plural );\n\nThis function adds pluralization support to every String object.\n\n#### Arguments\n\n> str\n\n\ttype: String\n\tdesc: The subject string.\n\n> plural\n\n\ttype: String\n\tdesc: Overrides normal output with said String.(optional)\n\n#### Example code\n\n\tvar inflection = require( 'inflection' );\n\n\tinflection.pluralize( 'person' ); // === 'people'\n\tinflection.pluralize( 'octopus' ); // === \"octopi\"\n\tinflection.pluralize( 'Hat' ); // === 'Hats'\n\tinflection.pluralize( 'person', 'guys' ); // === 'guys'\n\n\n\n### inflection.singularize( str, singular );\n\nThis function adds singularization support to every String object.\n\n#### Arguments\n\n> str\n\n\ttype: String\n\tdesc: The subject string.\n\n> singular\n\n\ttype: String\n\tdesc: Overrides normal output with said String.(optional)\n\n#### Example code\n\n\tvar inflection = require( 'inflection' );\n\n\tinflection.singularize( 'people' ); // === 'person'\n\tinflection.singularize( 'octopi' ); // === \"octopus\"\n\tinflection.singularize( 'Hats' ); // === 'Hat'\n\tinflection.singularize( 'guys', 'person' ); // === 'person'\n\n\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\ttype: String\n\tdesc: The subject string.\n\n> count\n\ttype: Number\n\tdesc: The number to base pluralization off of.\n\n> singular\n\n\ttype: String\n\tdesc: Overrides normal output with said String.(optional)\n\n> plural\n\n\ttype: String\n\tdesc: Overrides normal output with said String.(optional)\n\n#### Example code\n\n\t\tvar inflection = require( 'inflection' );\n\n\t\tinflection.inflect( 'people' 1 ); // === 'person'\n\t\tinflection.inflect( 'octopi' 1 ); // === 'octopus'\n\t\tinflection.inflect( 'Hats' 1 ); // === 'Hat'\n\t\tinflection.inflect( 'guys', 1 , 'person' ); // === 'person'\n\t\tinflection.inflect( 'person', 2 ); // === 'people'\n\t\tinflection.inflect( 'octopus', 2 ); // === 'octopi'\n\t\tinflection.inflect( 'Hat', 2 ); // === 'Hats'\n\t\tinflection.inflect( 'person', 2, null, 'guys' ); // === 'guys'\n\n\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\ttype: String\n\tdesc: The subject string.\n\n> low_first_letter\n\n\ttype: Boolean\n\tdesc: Default is to capitalize the first letter of the results. Passing true will lowercase it. (optional)\n\n#### Example code\n\n\tvar inflection = require( 'inflection' );\n\n\tinflection.camelize( 'message_properties' ); // === 'MessageProperties'\n\tinflection.camelize( 'message_properties', true ); // === 'messageProperties'\n\n\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\ttype: String\n\tdesc: The subject string.\n\n> all_upper_case\n\n\ttype: Boolean\n\tdesc: Default is to lowercase and add underscore prefix\n\n\n\n#### Example code\n\n\tvar inflection = require( 'inflection' );\n\n\tinflection.underscore( 'MessageProperties' ); // === 'message_properties'\n\tinflection.underscore( 'messageProperties' ); // === 'message_properties'\n\tinflection.underscore( 'MP' ); // === 'm_p'\n\tinflection.underscore( 'MP', true ); // === 'MP'\n\n\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\ttype: String\n\tdesc: The subject string.\n\n> low_first_letter\n\n\ttype: Boolean\n\tdesc: Default is to capitalize the first letter of the results. Passing true will lowercase it. (optional)\n\n#### Example code\n\n\tvar inflection = require( 'inflection' );\n\n\tinflection.humanize( 'message_properties' ); // === 'Message properties'\n\tinflection.humanize( 'message_properties', true ); // === 'message properties'\n\n\n\n### inflection.capitalize( str );\n\nThis function adds capitalization support to every String object.\n\n#### Arguments\n\n> str\n\n\ttype: String\n\tdesc: The subject string.\n\n#### Example code\n\n\tvar inflection = require( 'inflection' );\n\n\tinflection.capitalize( 'message_properties' ); // === 'Message_properties'\n\tinflection.capitalize( 'message properties', true ); // === 'Message properties'\n\n\n\n### inflection.dasherize( str );\n\nThis function replaces underscores with dashes in the string.\n\n#### Arguments\n\n> str\n\n\ttype: String\n\tdesc: The subject string.\n\n#### Example code\n\n\tvar inflection = require( 'inflection' );\n\n\tinflection.dasherize( 'message_properties' ); // === 'message-properties'\n\tinflection.dasherize( 'Message Properties' ); // === 'Message-Properties'\n\n\n\n### inflection.titleize( str );\n\nThis function adds titleize support to every String object.\n\n#### Arguments\n\n> str\n\n\ttype: String\n\tdesc: The subject string.\n\n#### Example code\n\n\tvar inflection = require( 'inflection' );\n\n\tinflection.titleize( 'message_properties' ); // === 'Message Properties'\n\tinflection.titleize( 'message properties to keep' ); // === 'Message Properties to Keep'\n\n\n\n### inflection.demodulize( str );\n\nThis function adds demodulize support to every String object.\n\n#### Arguments\n\n> str\n\n\ttype: String\n\tdesc: The subject string.\n\n#### Example code\n\n\tvar inflection = require( 'inflection' );\n\n\tinflection.demodulize( 'Message::Bus::Properties' ); // === 'Properties'\n\n\n\n### inflection.tableize( str );\n\nThis function adds tableize support to every String object.\n\n#### Arguments\n\n> str\n\n\ttype: String\n\tdesc: The subject string.\n\n#### Example code\n\n\tvar inflection = require( 'inflection' );\n\n\tinflection.tableize( 'MessageBusProperty' ); // === 'message_bus_properties'\n\n\n\n### inflection.classify( str );\n\nThis function adds classification support to every String object.\n\n#### Arguments\n\n> str\n\n\ttype: String\n\tdesc: The subject string.\n\n#### Example code\n\n\tvar inflection = require( 'inflection' );\n\n\tinflection.classify( 'message_bus_properties' ); // === 'MessageBusProperty'\n\n\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\ttype: String\n\tdesc: The subject string.\n\n> low_first_letter\n\n\ttype: Boolean\n\tdesc: 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\tvar inflection = require( 'inflection' );\n\n\tinflection.foreign_key( 'MessageBusProperty' ); // === 'message_bus_property_id'\n\tinflection.foreign_key( 'MessageBusProperty', true ); // === 'message_bus_propertyid'\n\n\n\n### inflection.ordinalize( str );\n\nThis function adds ordinalize support to every String object.\n\n#### Arguments\n\n> str\n\n\ttype: String\n\tdesc: The subject string.\n\n#### Example code\n\n\tvar inflection = require( 'inflection' );\n\n\tinflection.ordinalize( 'the 1 pitch' ); // === 'the 1st pitch'\n\n\n\n### inflection.transform( str, arr );\n\nThis function performs multiple inflection methods on a string.\n\n#### Arguments\n\n> str\n\n\ttype: String\n\tdesc: The subject string.\n\n> arr\n\n\ttype: Array\n\tdesc: An array of inflection methods.\n\n#### Example code\n\n\tvar inflection = require( 'inflection' );\n\n\tinflection.transform( 'all job', [ 'pluralize', 'capitalize', 'dasherize' ]); // === 'All-jobs'\n\n\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\n## License\n\n(The MIT License)\n\nCopyright (c) 2011 dreamerslab <ben@dreamerslab.com>\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",
"readmeFilename": "Readme.md",
"repository": {
"type": "git",
"url": "git+https://github.com/dreamerslab/node.inflection.git"
},
"scripts": {
"test": "mocha -R spec"
},
"version": "1.10.0"
}