{"_id":"brototype","_rev":"11-4155104bc5e2d2b26e1efeda1155b136","name":"brototype","description":"Bro, do you even Javascript?","dist-tags":{"latest":"0.0.6"},"versions":{"0.0.1":{"name":"brototype","version":"0.0.1","description":"bro, do you even?","main":"brototype.js","scripts":{"test":"mocha tests.js"},"repository":{"type":"git","url":"https://github.com/letsgetrandy/brototype.git"},"author":{"name":"Randy Hunt"},"license":"MIT","bugs":{"url":"https://github.com/letsgetrandy/brototype/issues"},"homepage":"http://brototypejs.com","dependencies":{},"devDependencies":{"mocha":"~1.21.4"},"_id":"brototype@0.0.1","dist":{"shasum":"40de9babc2e2cf3e5840469b54b74fdc0fd1dca7","tarball":"https://registry.npmjs.org/brototype/-/brototype-0.0.1.tgz","integrity":"sha512-O2XK3yr3jTP9IaZk++mBiDPqPuIrgFKYtWK6Tnnv9d4/kIqlFj8Jgg1As66EDQ+aw22IN3GEx9dwNVea8Tms4w==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHjjg3OQknQ7y6cl7ZRjfYkYCo2AbIkfrVmyNrd3XDk7AiATyOcqI2PXT+VXn7UHh+qKJkf9ogaDAlvyOJM4Siu2qw=="}]},"_from":".","_npmVersion":"1.4.3","_npmUser":{"name":"letsgetrandy","email":"letsgetrandy@gmail.com"},"maintainers":[{"name":"letsgetrandy","email":"letsgetrandy@gmail.com"}]},"0.0.2":{"name":"brototype","version":"0.0.2","description":"Bro, do you even Javascript?","main":"brototype.js","scripts":{"test":"mocha tests.js"},"repository":{"type":"git","url":"https://github.com/letsgetrandy/brototype.git"},"author":{"name":"Randy Hunt"},"license":"MIT","bugs":{"url":"https://github.com/letsgetrandy/brototype/issues"},"homepage":"http://brototypejs.com","dependencies":{},"devDependencies":{"mocha":"~1.21.4"},"_id":"brototype@0.0.2","dist":{"shasum":"1fb04db08ce702a71d4003d1c20370fa40784011","tarball":"https://registry.npmjs.org/brototype/-/brototype-0.0.2.tgz","integrity":"sha512-Vn6exo8/SZNP/ooGLBDN8F877N2OVa7tpUL6Abx+6Fy6wJrTzwhtXOQjhfW47FUJletTmEjYJ0C4qUHkJUWOUA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCmi7Y9LvG05D44BI1TZx2DSmemSQLzcnDwDMFbFKxBLQIhAJGeQckc09yPRDNHMsrEHu5aUjmCt8JtTYo8NGGCRYJF"}]},"_from":".","_npmVersion":"1.4.3","_npmUser":{"name":"letsgetrandy","email":"letsgetrandy@gmail.com"},"maintainers":[{"name":"letsgetrandy","email":"letsgetrandy@gmail.com"}]},"0.0.3":{"name":"brototype","version":"0.0.3","description":"Bro, do you even Javascript?","main":"brototype.js","scripts":{"test":"mocha tests.js"},"repository":{"type":"git","url":"https://github.com/letsgetrandy/brototype.git"},"author":{"name":"Randy Hunt"},"license":"MIT","bugs":{"url":"https://github.com/letsgetrandy/brototype/issues"},"homepage":"http://brototypejs.com","dependencies":{},"devDependencies":{"mocha":"~2.2"},"gitHead":"4353e538ce23509f217060c28f7b6a9b693a4863","_id":"brototype@0.0.3","_shasum":"6bcf6d71b4aba8440ddb26a16605d8735aad4806","_from":".","_npmVersion":"2.5.1","_nodeVersion":"0.12.0","_npmUser":{"name":"letsgetrandy","email":"randy@artisanaljs.com"},"dist":{"shasum":"6bcf6d71b4aba8440ddb26a16605d8735aad4806","tarball":"https://registry.npmjs.org/brototype/-/brototype-0.0.3.tgz","integrity":"sha512-+lSzsp5wD69WdQSDiEWIcy0D54c2P/GNtMbcprR/NCqiUsbEdGWxOJHwleF12I9mlDQPt3n9Ky22wGTJGHK0QA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIE8VgzhXAMpULkS6dl0Fyyg2xA6zBqJbsIRrw2N6sY9eAiEAq019CzTi0AbeDdmnM/FfeSYhvj6on26c36yIHHgAzXw="}]},"maintainers":[{"name":"letsgetrandy","email":"letsgetrandy@gmail.com"}]},"0.0.4":{"name":"brototype","version":"0.0.4","description":"Bro, do you even Javascript?","main":"brototype.js","scripts":{"test":"mocha tests.js"},"repository":{"type":"git","url":"git+https://github.com/letsgetrandy/brototype.git"},"author":{"name":"Randy Hunt"},"license":"MIT","bugs":{"url":"https://github.com/letsgetrandy/brototype/issues"},"homepage":"http://brototypejs.com","dependencies":{},"devDependencies":{"mocha":"~2.2"},"gitHead":"051c7140200cbdc6be3888ee54c7d5a663fb8025","_id":"brototype@0.0.4","_shasum":"58bc68745c722e316a0219221126bda44d2649b2","_from":".","_npmVersion":"2.10.1","_nodeVersion":"0.12.4","_npmUser":{"name":"letsgetrandy","email":"randy@artisanaljs.com"},"dist":{"shasum":"58bc68745c722e316a0219221126bda44d2649b2","tarball":"https://registry.npmjs.org/brototype/-/brototype-0.0.4.tgz","integrity":"sha512-jVEtreYvwowuqREX8+0JTqbuA0pC9fPJLSCbblVBktsfLEtOkEHSuWiwoXKEwBAlowsyT8PE/+IxpXqllUz/Dw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCkmfOZ5u6iSV7LI69xIAZZU16Hctq9GW+T8guQfMJkigIhAN0arxX6m+M5/ecyD14t4xXrPJE/RA1gtQU8nLeVCIaD"}]},"maintainers":[{"name":"letsgetrandy","email":"letsgetrandy@gmail.com"}]},"0.0.5":{"name":"brototype","version":"0.0.5","description":"Bro, do you even Javascript?","main":"brototype.js","scripts":{"test":"mocha tests.js"},"repository":{"type":"git","url":"git+https://github.com/letsgetrandy/brototype.git"},"author":{"name":"Randy Hunt"},"license":"MIT","bugs":{"url":"https://github.com/letsgetrandy/brototype/issues"},"homepage":"http://brototypejs.com","dependencies":{},"devDependencies":{"mocha":"~2.2"},"gitHead":"970ffaaa0607349b299f6858ffd2b385cd0680e0","_id":"brototype@0.0.5","_shasum":"477598d2de1ffb116a11d5818b71509665e78646","_from":".","_npmVersion":"2.10.1","_nodeVersion":"0.12.4","_npmUser":{"name":"letsgetrandy","email":"randy@artisanaljs.com"},"dist":{"shasum":"477598d2de1ffb116a11d5818b71509665e78646","tarball":"https://registry.npmjs.org/brototype/-/brototype-0.0.5.tgz","integrity":"sha512-DhRLA8PAVIyuFeblp39Lij14/BMRskCGqCbZuvmdrxYyJWAMu0/iBbj4DKD5mkj2fRQfh9kd+R7/NaVckNqkhA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBIzdSi9mWd2aN3Ww2V6WT1xgWRwzQl9fRLZxSOIwqj4AiEA03LC6nPK5AngSdI/Nox0vuSpRqR15QCpbN1B+k2Vu0Y="}]},"maintainers":[{"name":"letsgetrandy","email":"letsgetrandy@gmail.com"}]},"0.0.6":{"name":"brototype","version":"0.0.6","description":"Bro, do you even Javascript?","main":"brototype.js","scripts":{"test":"mocha tests.js"},"repository":{"type":"git","url":"git+https://github.com/letsgetrandy/brototype.git"},"author":{"name":"Randy Hunt"},"license":"MIT","bugs":{"url":"https://github.com/letsgetrandy/brototype/issues"},"homepage":"http://brototypejs.com","dependencies":{},"devDependencies":{"mocha":"~2.2"},"gitHead":"ec350820903c6afe23722aeac487457fb64c5b68","_id":"brototype@0.0.6","_shasum":"9b3f07364783397b8f1c4bee7a141993566e4b44","_from":".","_npmVersion":"3.10.3","_nodeVersion":"6.3.1","_npmUser":{"name":"letsgetrandy","email":"randy@artisanaljs.com"},"dist":{"shasum":"9b3f07364783397b8f1c4bee7a141993566e4b44","tarball":"https://registry.npmjs.org/brototype/-/brototype-0.0.6.tgz","integrity":"sha512-UcQusNAX7nnuXf9tvvLRC6DtZ8/YkDJRtTIbiA5ayb8MehwtSwtkvd5ZTXNLUTTtU6J/yJsi+1LJXqgRz1obwg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICmyHUcsm2840IR7R+ZEQWnot/bCtKYFtH2+BWrhqc2NAiBgqoGNnQtxuE9zqe33MWG9a/PyPo4npyIFe+tJLumVfg=="}]},"maintainers":[{"name":"letsgetrandy","email":"letsgetrandy@gmail.com"}],"_npmOperationalInternal":{"host":"packages-18-east.internal.npmjs.com","tmp":"tmp/brototype-0.0.6.tgz_1478534156751_0.7556843517813832"}}},"readme":"[![build status][travis-image]][travis-url]\n[![Codacy Badge](https://www.codacy.com/project/badge/ec7e9f08d94447188b0b5072ba3eac31)](https://www.codacy.com/app/letsgetrandy/brototype)\n[![Code Climate](https://codeclimate.com/repos/555a0d98695680378e0034bd/badges/04a1db801508665091d9/gpa.svg)](https://codeclimate.com/repos/555a0d98695680378e0034bd/feed)\n[![bitHound Score](https://www.bithound.io/github/letsgetrandy/brototype/badges/score.svg)](https://www.bithound.io/github/letsgetrandy/brototype)\n\nbrototype\n=========\n\nBro, do you even javascript?\n\n## Features\n\nYou've got a deeply-nested set of objects that may or may not always be there.\nWe've all seen something like this:\n`var myURL = app.config.environment.buildURL('dev');`\nwhich leads to one of our favorite javascript errors...\n`error: undefined is not a function`\n\nAnd the solution only makes the code base ugly:\n```js\nvar myURL;\nif (app && app.config && app.config.environment && app.config.environment.buildURL) {\n    myURL = app.config.environment.buildURL('dev');\n}\n```\n\nWe all hate that, don't we?\n\nSo what if you could just type:\n```js\nvar myURL;\nif (Bro(app).doYouEven('config.environment.buildURL')) {\n    myURL = app.config.environment.buildURL('dev');\n}\n```\n\nOr better yet, how about:\n```js\nvar myURL;\nBro(app)\n    .iDontAlways('config.environment.buildURL')\n    .butWhenIdo(function(buildURL){\n        myURL = buildURL('dev');\n    });\n```\n\nWell, now you can!\n\nBut what if you have something like this:\n\n```js\napp['soap:Envelope']['soap:Body'][0].getResponse[0]['rval'][0].customerId[0]\n```\n\nWe got you covered.\n\n```js\nif (Bro(app).doYouEven(\"soap:Envelope.soap:Body.0.getResponse.0.rval.0.customerId.0\")) {\n    var thisVar = app['soap:Envelope']['soap:Body'][0].getResponse[0]['rval'][0].customerId[0];\n}\n```\n\n## Features\n\n### Testing nested members\n```js\nif(Bro(object).doYouEven('lift') === Bro.TOTALLY) {\n    console.log(object.lift);\n}\n```\n\nOr, ensure that multiple nested members exist by passing an array of paths\n```js\nif (Bro(object)\n    .doYouEven(['property.one', 'property.two']) {\n    // returns true if all referenced properties exist\n    console.log(object.property.one, object.property.two);\n})\n```\n\nOr, just use a callback...\n```js\nBro(object)\n    .doYouEven('property.subproperty', function(subproperty) {\n        console.log(subproperty);\n    });\n```\n\n### Fetching nested members\n```js\n// get a value if it exists\nvar value = Bro(object).iCanHaz('cheezeburger');\n\n// get an array of values for paths that exist\nvar values = Bro(object).iCanHaz(['cheezeburger', 'money', 'beer']);\n```\n\n### Creating nested members\n```js\n// add properties to an object\nBro(object).makeItHappen('cheezeburger.with.pickles');\n```\n\n```js\n// set a deeply nested property by the Bro string\nBro(object).makeItHappen('bro.props', 'high five');  // object.bro.props = 'high five'\n```\n\n### Calling nested functions\n```js\nBro(object)\n    .iDontAlways('method')\n    .butWhenIdo(function(returnVal) {\n        console.log('object.method() returned ', returnVal);\n    });\n```\n\n### Handling exceptions\n```js\nBro(object)\n    .braceYourself('method.name')\n    .hereComeTheErrors(function(e) {\n        console.log('error ' + e + ' happened.');\n    });\n```\n\n### Bro-oleans\n```js\nBro.TOTALLY // true;\nBro.NOWAY   // false;\n```\n\n### Check for undefined\n```js\nif (Bro(someVar).isThatEvenAThing() === Bro.TOTALLY) {\n    // do stuff\n}\n```\n\n### Get a list of object keys\n```js\nvar object = {foo: 1, bar: 2};\nBro(object).giveMeProps();\n// returns ['foo', 'bar'];\n```\n\n### Extending objects\n```js\nvar obj1 = {foo: 'boo', bar: 'bar'},\n    obj2 = {foo: 'bar', yes: 'no'};\nBro(obj1).comeAtMe(obj2);\n\n// now obj1.foo == 'bar' and obj1.yes == 'no'\n```\n\n### Extending Brototype!\nYes, extend me, Bro!\n\n```js\nvar plugin = { foo: function() { whatever; }};\nBro.prototype.comeAtMe(plugin);\n```\n\n\n## Installing\nbrototype is available via npm or bower\n```bash\n# via npm\n$ npm install brototype\n\n# via bower\n$ bower install brototype\n```\n\n## Contributing\nBrototype.js may be funny, but it is also quite useful, as demonstrated by the\nnumber of people who have already installed it via\n[npm](https://www.npmjs.org/package/brototype).\n\nTherefore, there is some responsibility to add/update the library responsibly.\nPlease have a look at the\n[guidelines for contributing to Brototype](https://github.com/letsgetrandy/brototype/wiki/Contributing)\nbefore submitting your pull request.\n\n\n## Bro-tie\nFor the brofessional. Want to use Brototype.js but it's too bro for your work\nenvironment? Just give it the [Bro-tie](http://pepperthecat.github.io/brotie/) treatment\nso you can bro down at the office!\nAlias some or all of the names to make your boss happy.\n\n## Do you even Brototype?\nAre you using Brototype in the wild?\nIf so, [tell the world](https://github.com/letsgetrandy/brototype/issues/10)!\n\nAlso, don't forget to follow [@BrototypeJS](https://twitter.com/Brototypejs) on Twitter!\n\n\n## Author\n\nRandy Hunt\n\n## License\n\nThe MIT License\n\nCopyright © 2014\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n\n[travis-image]: https://img.shields.io/travis/letsgetrandy/brototype/master.svg?style=flat-square\n[travis-url]: https://travis-ci.org/letsgetrandy/brototype\n","maintainers":[{"name":"letsgetrandy","email":"letsgetrandy@gmail.com"}],"time":{"modified":"2022-06-13T05:08:57.353Z","created":"2014-09-23T16:12:02.061Z","0.0.1":"2014-09-23T16:12:02.061Z","0.0.2":"2014-09-24T14:37:23.158Z","0.0.3":"2015-06-11T17:31:57.007Z","0.0.4":"2015-07-24T20:27:06.767Z","0.0.5":"2015-09-18T14:42:23.613Z","0.0.6":"2016-11-07T15:55:57.427Z"},"homepage":"http://brototypejs.com","repository":{"type":"git","url":"git+https://github.com/letsgetrandy/brototype.git"},"author":{"name":"Randy Hunt"},"bugs":{"url":"https://github.com/letsgetrandy/brototype/issues"},"license":"MIT","readmeFilename":"README.md","users":{"timdp":true}}