{"_id":"humps","_rev":"322562","name":"humps","description":"Underscore-to-camelCase converter (and vice versa) for strings and object keys in JavaScript.","dist-tags":{"latest":"2.0.1"},"maintainers":[{"name":"domchristie","email":"christiedom@gmail.com"}],"time":{"modified":"2021-06-04T01:29:03.000Z","created":"2014-03-29T18:49:35.903Z","2.0.1":"2017-06-18T13:20:01.764Z","2.0.0":"2016-10-19T20:10:20.165Z","1.1.0":"2016-04-22T16:26:19.407Z","1.0.0":"2015-10-10T09:40:17.809Z","0.7.0":"2015-09-18T09:07:42.008Z","0.6.0":"2015-06-14T18:04:17.680Z","0.5.2":"2015-04-27T19:59:07.986Z","0.5.1":"2015-03-26T07:24:47.925Z","0.4.2":"2014-12-09T12:50:44.831Z","0.0.1":"2014-03-29T18:49:35.903Z"},"users":{"aubinlrx":true,"randallagordon":true,"byoigres":true,"hasssan":true,"ffxsam":true,"r3nya":true,"underoot":true,"joshuabriter":true,"codedsignal":true,"zhenwenc":true,"tedyhy":true,"monolithed":true,"zhiquan_yu":true,"universal-render":true,"dpjayasekara":true,"rafaesc92":true,"serge-nikitin":true,"colkito":true,"usex":true,"guchong":true,"crissdev":true},"author":{"name":"Dom Christie"},"repository":{"type":"git","url":"git://github.com/domchristie/humps.git"},"versions":{"2.0.1":{"name":"humps","version":"2.0.1","description":"Underscore-to-camelCase converter (and vice versa) for strings and object keys in JavaScript.","main":"humps.js","scripts":{"test":"mocha"},"repository":{"type":"git","url":"git://github.com/domchristie/humps.git"},"keywords":["utils","camel","case","underscore","converter","strings","objects"],"author":{"name":"Dom Christie"},"license":"MIT","devDependencies":{"mocha":"^2.2.5"},"bugs":{"url":"https://github.com/domchristie/humps/issues"},"homepage":"https://github.com/domchristie/humps","gitHead":"d612998749922a76c68d4d9c8b5ae93f02595019","_id":"humps@2.0.1","_shasum":"dd02ea6081bd0568dc5d073184463957ba9ef9aa","_from":".","_npmVersion":"3.10.10","_nodeVersion":"6.9.3","_npmUser":{"name":"domchristie","email":"christiedom@gmail.com"},"dist":{"shasum":"dd02ea6081bd0568dc5d073184463957ba9ef9aa","size":4806,"noattachment":false,"key":"/humps/-/humps-2.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/humps/download/humps-2.0.1.tgz"},"maintainers":[{"name":"domchristie","email":"christiedom@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/humps-2.0.1.tgz_1497792000819_0.8678196808323264"},"directories":{},"publish_time":1497792001764,"_hasShrinkwrap":false,"_cnpm_publish_time":1497792001764},"2.0.0":{"name":"humps","version":"2.0.0","description":"Underscore-to-camelCase converter (and vice versa) for strings and object keys in JavaScript.","main":"humps.js","scripts":{"test":"mocha"},"repository":{"type":"git","url":"git://github.com/domchristie/humps.git"},"keywords":["utils","camel","case","underscore","converter","strings","objects"],"author":{"name":"Dom Christie"},"license":"MIT","devDependencies":{"mocha":"^2.2.5"},"bugs":{"url":"https://github.com/domchristie/humps/issues"},"homepage":"https://github.com/domchristie/humps","gitHead":"050b1fd852cf0847bed9513655b2afbb20d89859","_id":"humps@2.0.0","_shasum":"dd4a423e9784626fe7b9f19fde0baff659b40173","_from":".","_npmVersion":"2.12.1","_nodeVersion":"0.12.7","_npmUser":{"name":"domchristie","email":"christiedom@gmail.com"},"dist":{"shasum":"dd4a423e9784626fe7b9f19fde0baff659b40173","size":4795,"noattachment":false,"key":"/humps/-/humps-2.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/humps/download/humps-2.0.0.tgz"},"maintainers":[{"name":"domchristie","email":"christiedom@gmail.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/humps-2.0.0.tgz_1476907818545_0.712945424253121"},"directories":{},"publish_time":1476907820165,"_cnpm_publish_time":1476907820165,"_hasShrinkwrap":false},"1.1.0":{"name":"humps","version":"1.1.0","description":"Underscore-to-camelCase converter (and vice versa) for strings and object keys in JavaScript.","main":"humps.js","scripts":{"test":"mocha"},"repository":{"type":"git","url":"git://github.com/domchristie/humps.git"},"keywords":["utils","camel","case","underscore","converter","strings","objects"],"author":{"name":"Dom Christie"},"license":"MIT","devDependencies":{"mocha":"^2.2.5"},"bugs":{"url":"https://github.com/domchristie/humps/issues"},"homepage":"https://github.com/domchristie/humps","gitHead":"e2ac23a9bcbd6b7a083c6b15e416ebd46016e2ff","_id":"humps@1.1.0","_shasum":"99a05cc80b13ae754a3d1e1a92182f271ef1d98f","_from":".","_npmVersion":"3.3.12","_nodeVersion":"5.5.0","_npmUser":{"name":"domchristie","email":"christiedom@gmail.com"},"dist":{"shasum":"99a05cc80b13ae754a3d1e1a92182f271ef1d98f","size":4632,"noattachment":false,"key":"/humps/-/humps-1.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/humps/download/humps-1.1.0.tgz"},"maintainers":[{"name":"domchristie","email":"christiedom@gmail.com"}],"_npmOperationalInternal":{"host":"packages-16-east.internal.npmjs.com","tmp":"tmp/humps-1.1.0.tgz_1461342377598_0.5633180388249457"},"directories":{},"publish_time":1461342379407,"_cnpm_publish_time":1461342379407,"_hasShrinkwrap":false},"1.0.0":{"name":"humps","version":"1.0.0","description":"Underscore-to-camelCase converter (and vice versa) for strings and object keys in JavaScript.","main":"humps.js","scripts":{"test":"mocha"},"repository":{"type":"git","url":"git://github.com/domchristie/humps.git"},"keywords":["utils","camel","case","underscore","converter","strings","objects"],"author":{"name":"Dom Christie"},"license":"MIT","devDependencies":{"mocha":"^2.2.5"},"bugs":{"url":"https://github.com/domchristie/humps/issues"},"homepage":"https://github.com/domchristie/humps","gitHead":"292bbb82ecc18e304effd7eb7bd7f1705d1d9bfd","_id":"humps@1.0.0","_shasum":"0ae948fdca8021e62a7ba7cf20bfa089b850f874","_from":".","_npmVersion":"2.12.1","_nodeVersion":"0.12.7","_npmUser":{"name":"domchristie","email":"christiedom@gmail.com"},"dist":{"shasum":"0ae948fdca8021e62a7ba7cf20bfa089b850f874","size":4160,"noattachment":false,"key":"/humps/-/humps-1.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/humps/download/humps-1.0.0.tgz"},"maintainers":[{"name":"domchristie","email":"christiedom@gmail.com"}],"directories":{},"publish_time":1444470017809,"_cnpm_publish_time":1444470017809,"_hasShrinkwrap":false},"0.7.0":{"name":"humps","version":"0.7.0","description":"Underscore-to-camelCase converter (and vice versa) for strings and object keys in JavaScript.","main":"humps.js","scripts":{"test":"rake"},"repository":{"type":"git","url":"git://github.com/domchristie/humps.git"},"keywords":["utils","camel","case","underscore","converter","strings","objects"],"author":{"name":"Dom Christie"},"license":"MIT","bugs":{"url":"https://github.com/domchristie/humps/issues"},"homepage":"https://github.com/domchristie/humps","gitHead":"691450a2016ed3ab8ed808c9c8417e7da6c36cb5","_id":"humps@0.7.0","_shasum":"49977a5e2b36625246cf38ffde23a90e453d5117","_from":".","_npmVersion":"2.12.1","_nodeVersion":"0.12.7","_npmUser":{"name":"domchristie","email":"christiedom@gmail.com"},"dist":{"shasum":"49977a5e2b36625246cf38ffde23a90e453d5117","size":4804,"noattachment":false,"key":"/humps/-/humps-0.7.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/humps/download/humps-0.7.0.tgz"},"maintainers":[{"name":"domchristie","email":"christiedom@gmail.com"}],"directories":{},"publish_time":1442567262008,"_cnpm_publish_time":1442567262008,"_hasShrinkwrap":false},"0.6.0":{"name":"humps","version":"0.6.0","description":"Underscore-to-camelCase converter (and vice versa) for strings and object keys in JavaScript.","main":"humps.js","scripts":{"test":"rake"},"repository":{"type":"git","url":"git://github.com/domchristie/humps.git"},"keywords":["utils","camel","case","underscore","converter","strings","objects"],"author":{"name":"Dom Christie"},"license":"MIT","bugs":{"url":"https://github.com/domchristie/humps/issues"},"homepage":"https://github.com/domchristie/humps","gitHead":"295fbf584a30de9decbc08ceeb75b78eaa08b7d1","_id":"humps@0.6.0","_shasum":"a617210386f0445d122ceb4d9414a1a39b1a1e94","_from":".","_npmVersion":"2.5.1","_nodeVersion":"0.12.0","_npmUser":{"name":"domchristie","email":"christiedom@gmail.com"},"maintainers":[{"name":"domchristie","email":"christiedom@gmail.com"}],"dist":{"shasum":"a617210386f0445d122ceb4d9414a1a39b1a1e94","size":4626,"noattachment":false,"key":"/humps/-/humps-0.6.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/humps/download/humps-0.6.0.tgz"},"directories":{},"publish_time":1434305057680,"_cnpm_publish_time":1434305057680,"_hasShrinkwrap":false},"0.5.2":{"name":"humps","version":"0.5.2","description":"Underscore-to-camelCase converter (and vice versa) for strings and object keys in JavaScript.","main":"humps.js","scripts":{"test":"rake"},"repository":{"type":"git","url":"git://github.com/domchristie/humps.git"},"keywords":["utils","camel","case","underscore","converter","strings","objects"],"author":{"name":"Dom Christie"},"license":"MIT","bugs":{"url":"https://github.com/domchristie/humps/issues"},"homepage":"https://github.com/domchristie/humps","gitHead":"2826ef1f8e9adb9e37d016048a70cd9dc5bae4cb","_id":"humps@0.5.2","_shasum":"c036f54e9c9361270bfb1368fd9845efb564d667","_from":".","_npmVersion":"2.5.1","_nodeVersion":"0.12.0","_npmUser":{"name":"domchristie","email":"christiedom@gmail.com"},"maintainers":[{"name":"domchristie","email":"christiedom@gmail.com"}],"dist":{"shasum":"c036f54e9c9361270bfb1368fd9845efb564d667","size":4453,"noattachment":false,"key":"/humps/-/humps-0.5.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/humps/download/humps-0.5.2.tgz"},"directories":{},"publish_time":1430164747986,"_cnpm_publish_time":1430164747986,"_hasShrinkwrap":false},"0.5.1":{"name":"humps","version":"0.5.1","description":"Underscore-to-camelCase converter (and vice versa) for strings and object keys in JavaScript.","main":"humps.js","scripts":{"test":"rake"},"repository":{"type":"git","url":"git://github.com/domchristie/humps.git"},"keywords":["utils","camel","case","underscore","converter","strings","objects"],"author":{"name":"Dom Christie"},"license":"MIT","bugs":{"url":"https://github.com/domchristie/humps/issues"},"homepage":"https://github.com/domchristie/humps","gitHead":"5fbf7de02ee52aa4e7edce24d9e979520b06c679","_id":"humps@0.5.1","_shasum":"483de2e18fe3a121a60dbe6bed6b7fb0b241eb93","_from":".","_npmVersion":"2.5.1","_nodeVersion":"0.12.0","_npmUser":{"name":"domchristie","email":"christiedom@gmail.com"},"maintainers":[{"name":"domchristie","email":"christiedom@gmail.com"}],"dist":{"shasum":"483de2e18fe3a121a60dbe6bed6b7fb0b241eb93","size":4452,"noattachment":false,"key":"/humps/-/humps-0.5.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/humps/download/humps-0.5.1.tgz"},"directories":{},"publish_time":1427354687925,"_cnpm_publish_time":1427354687925,"_hasShrinkwrap":false},"0.4.2":{"name":"humps","version":"0.4.2","description":"Underscore-to-camelCase converter (and vice versa) for strings and object keys in JavaScript.","main":"humps.js","scripts":{"test":"rake"},"repository":{"type":"git","url":"git://github.com/domchristie/humps.git"},"keywords":["utils","camel","case","underscore","converter","strings","objects"],"author":{"name":"Dom Christie"},"license":"MIT","bugs":{"url":"https://github.com/domchristie/humps/issues"},"homepage":"https://github.com/domchristie/humps","_id":"humps@0.4.2","_shasum":"74265d0398a29fb8e1027f8652b26b2cedb0a038","_from":".","_npmVersion":"1.4.10","_npmUser":{"name":"domchristie","email":"christiedom@gmail.com"},"maintainers":[{"name":"domchristie","email":"christiedom@gmail.com"}],"dist":{"shasum":"74265d0398a29fb8e1027f8652b26b2cedb0a038","size":4463,"noattachment":false,"key":"/humps/-/humps-0.4.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/humps/download/humps-0.4.2.tgz"},"directories":{},"publish_time":1418129444831,"_cnpm_publish_time":1418129444831,"_hasShrinkwrap":false},"0.0.1":{"name":"humps","version":"0.0.1","description":"Underscore-to-camelCase converter (and vice versa) for strings and object keys in JavaScript.","main":"humps.js","scripts":{"test":"rake"},"repository":{"type":"git","url":"git://github.com/domchristie/humps.git"},"keywords":["utils","camel","case","underscore","converter","strings","objects"],"author":{"name":"Dom Christie"},"license":"MIT","bugs":{"url":"https://github.com/domchristie/humps/issues"},"homepage":"https://github.com/domchristie/humps","_id":"humps@0.0.1","dist":{"shasum":"875a5b28a56d712715fc9d46c1bd0b9a00a4f141","size":4394,"noattachment":false,"key":"/humps/-/humps-0.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/humps/download/humps-0.0.1.tgz"},"_from":".","_npmVersion":"1.4.3","_npmUser":{"name":"domchristie","email":"christiedom@gmail.com"},"maintainers":[{"name":"domchristie","email":"christiedom@gmail.com"}],"directories":{},"publish_time":1396118975903,"_cnpm_publish_time":1396118975903,"_hasShrinkwrap":false}},"readme":"humps [![Build status](https://secure.travis-ci.org/domchristie/humps.png)](http://travis-ci.org/#!/domchristie/humps)\n=====\n\nUnderscore-to-camelCase converter (and vice versa) for strings and object keys in JavaScript.\n\nWhen converting object keys, it will walk the structure, converting any nested objects (or arrays of nested objects) along the way. Handy for converting JSON between JavaScript and Ruby/Rails APIs.\n\nTakes inspiration from [Ember Data](https://github.com/emberjs/data) and copies some utility functions from [Underscore.js](http://underscorejs.org/).\n\nUsage\n-----\n\n### Converting strings\n\n    humps.camelize('hello_world') // 'helloWorld'\n    humps.decamelize('fooBar') // 'foo_bar'\n    humps.decamelize('fooBarBaz', { separator: '-' }) // 'foo-bar-baz'\n\n### Converting object keys\n\n    var object = { attr_one: 'foo', attr_two: 'bar' }\n    humps.camelizeKeys(object); // { attrOne: 'foo', attrTwo: 'bar' }\n\nArrays of objects are also converted\n\n    var array = [{ attr_one: 'foo' }, { attr_one: 'bar' }]\n    humps.camelizeKeys(array); // [{ attrOne: 'foo' }, { attrOne: 'bar' }]\n\nIt also accepts a callback which can modify the conversion behavior. For example to prevent conversion of keys containing only uppercase letters or numbers:\n\n    humps.camelizeKeys(obj, function (key, convert) {\n      return /^[A-Z0-9_]+$/.test(key) ? key : convert(key);\n    });\n    humps.decamelizeKeys(obj, function (key, convert, options) {\n      return /^[A-Z0-9_]+$/.test(key) ? key : convert(key, options);\n    });\n\nIn order to use the callback with options use the `process` option:\n\n    humps.decamelizeKeys(obj, {\n        separator: '-',\n        process: function (key, convert, options) {\n          return /^[A-Z0-9_]+$/.test(key) ? key : convert(key, options);\n        }\n    });\n\nAPI\n---\n\n### `humps.camelize(string)`\n\nRemoves any hypens, underscores, and whitespace characters, and uppercases the first character that follows.\n\n```javascript\nhumps.camelize('hello_world-foo bar') // 'helloWorldFooBar'\n```\n\n### `humps.pascalize(string)`\n\nSimilar to `humps.camelize(string)`, but also ensures that the first character is uppercase.\n\n```javascript\nhumps.pascalize('hello_world-foo bar') // 'HelloWorldFooBar'\n```\n\n### `humps.decamelize(string, options)`\n\nConverts camelCased string to an underscore-separated string.\n\n```javascript\nhumps.decamelize('helloWorldFooBar') // 'hello_world_foo_bar'\n```\n\nThe separator can be customized with the `separator` option.\n\n```javascript\nhumps.decamelize('helloWorldFooBar', { separator: '-' }) // 'hello-world-foo-bar'\n```\n\nBy default, `decamelize` will only split words on capital letters (not numbers as in humps pre v1.0). To customize this behaviour, use the `split` option. This should be a regular expression which, when passed into `String.prototype.split`, produces an array of words (by default the regular expression is: `/(?=[A-Z])/`). For example, to treat numbers as uppercase:\n\n```javascript\nhumps.decamelize('helloWorld1', { split: /(?=[A-Z0-9])/ }) // 'hello_world_1'\n```\n\n### `humps.depascalize(string, options)`\n\nSame as `humps.decamelize` above.\n\n### `humps.camelizeKeys(object, options)`\n\nConverts object keys to camelCase. It also converts arrays of objects.\n\n### `humps.pascalizeKeys(object, options)`\n\nConverts object keys to PascalCase. It also converts arrays of objects.\n\n### `humps.decamelizeKeys(object, options)`\n\nSeparates camelCased object keys with an underscore. It also converts arrays of objects. See `humps.decamelize` for details of options.\n\n### `humps.depascalizeKeys(object, options)`\n\nSee `humps.decamelizeKeys`.\n\nLicence\n-------\nhumps is copyright &copy; 2012+ [Dom Christie](http://domchristie.co.uk) and released under the MIT license.","_attachments":{},"homepage":"https://github.com/domchristie/humps","bugs":{"url":"https://github.com/domchristie/humps/issues"},"license":"MIT"}