{"_id":"bower-endpoint-parser","_rev":"142957","name":"bower-endpoint-parser","description":"Little module that helps with endpoints parsing.","dist-tags":{"latest":"0.2.2"},"maintainers":[{"name":"paulirish","email":""},{"name":"sheerun","email":"sheerun@sher.pl"},{"name":"wibblymat","email":"mat@wibbly.org.uk"}],"time":{"modified":"2021-06-03T11:28:07.000Z","created":"2013-07-16T07:44:08.409Z","0.2.2":"2014-06-24T09:13:15.327Z","0.2.1":"2013-08-20T20:49:18.786Z","0.2.0":"2013-07-29T22:14:44.422Z","0.1.0":"2013-07-23T20:02:21.674Z","0.1.0-rc.1":"2013-07-16T07:44:08.409Z"},"users":{},"author":{"name":"Twitter"},"repository":{"type":"git","url":"git://github.com/bower/endpoint-parser.git"},"versions":{"0.2.2":{"name":"bower-endpoint-parser","version":"0.2.2","description":"Little module that helps with endpoints parsing.","author":{"name":"Twitter"},"licenses":[{"type":"MIT","url":"https://github.com/bower/endpoint-parser/blob/master/LICENSE"}],"repository":{"type":"git","url":"git://github.com/bower/endpoint-parser.git"},"main":"index.js","engines":{"node":">=0.8.0"},"devDependencies":{"expect.js":"~0.2.0","mocha":"~1.12.0","mout":"~0.9.0"},"scripts":{"test":"mocha -R spec"},"bugs":{"url":"https://github.com/bower/endpoint-parser/issues"},"homepage":"https://github.com/bower/endpoint-parser","_id":"bower-endpoint-parser@0.2.2","dist":{"shasum":"00b565adbfab6f2d35addde977e97962acbcb3f6","size":4889,"noattachment":false,"key":"/bower-endpoint-parser/-/bower-endpoint-parser-0.2.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/bower-endpoint-parser/download/bower-endpoint-parser-0.2.2.tgz"},"_from":".","_npmVersion":"1.3.24","_npmUser":{"name":"sheerun","email":"sheerun@sher.pl"},"maintainers":[{"name":"paulirish","email":""},{"name":"sheerun","email":"sheerun@sher.pl"},{"name":"wibblymat","email":"mat@wibbly.org.uk"}],"directories":{},"publish_time":1403601195327,"_cnpm_publish_time":1403601195327,"_hasShrinkwrap":false},"0.2.1":{"name":"bower-endpoint-parser","version":"0.2.1","description":"Little module that helps with endpoints parsing.","author":{"name":"Twitter"},"licenses":[{"type":"MIT","url":"https://github.com/bower/endpoint-parser/blob/master/LICENSE"}],"repository":{"type":"git","url":"git://github.com/bower/endpoint-parser.git"},"main":"index.js","engines":{"node":">=0.8.0"},"devDependencies":{"expect.js":"~0.2.0","mocha":"~1.12.0","mout":"~0.6.0"},"scripts":{"test":"mocha -R spec"},"readmeFilename":"README.md","bugs":{"url":"https://github.com/bower/endpoint-parser/issues"},"_id":"bower-endpoint-parser@0.2.1","dist":{"shasum":"8c4010a2900cdab07ea5d38f0bd03e9bbccef90f","size":4854,"noattachment":false,"key":"/bower-endpoint-parser/-/bower-endpoint-parser-0.2.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/bower-endpoint-parser/download/bower-endpoint-parser-0.2.1.tgz"},"_from":".","_npmVersion":"1.3.2","_npmUser":{"name":"satazor","email":"andremiguelcruz@msn.com"},"maintainers":[{"name":"paulirish","email":""},{"name":"sheerun","email":"sheerun@sher.pl"},{"name":"wibblymat","email":"mat@wibbly.org.uk"}],"directories":{},"publish_time":1377031758786,"_cnpm_publish_time":1377031758786,"_hasShrinkwrap":false},"0.2.0":{"name":"bower-endpoint-parser","version":"0.2.0","description":"Little module that helps with endpoints parsing.","author":{"name":"Twitter"},"licenses":[{"type":"MIT","url":"https://github.com/bower/endpoint-parser/blob/master/LICENSE"}],"repository":{"type":"git","url":"git://github.com/bower/endpoint-parser.git"},"main":"index.js","engines":{"node":">=0.8.0"},"devDependencies":{"expect.js":"~0.2.0","mocha":"~1.12.0","mout":"~0.6.0"},"scripts":{"test":"mocha -R spec"},"readmeFilename":"README.md","bugs":{"url":"https://github.com/bower/endpoint-parser/issues"},"_id":"bower-endpoint-parser@0.2.0","dist":{"shasum":"531f4e64d71b3cb8210532a15f4b58aaf7d46182","size":4780,"noattachment":false,"key":"/bower-endpoint-parser/-/bower-endpoint-parser-0.2.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/bower-endpoint-parser/download/bower-endpoint-parser-0.2.0.tgz"},"_from":".","_npmVersion":"1.3.2","_npmUser":{"name":"satazor","email":"andremiguelcruz@msn.com"},"maintainers":[{"name":"paulirish","email":""},{"name":"sheerun","email":"sheerun@sher.pl"},{"name":"wibblymat","email":"mat@wibbly.org.uk"}],"directories":{},"publish_time":1375136084422,"_cnpm_publish_time":1375136084422,"_hasShrinkwrap":false},"0.1.0":{"name":"bower-endpoint-parser","version":"0.1.0","description":"Little module that helps with endpoints parsing.","author":{"name":"Twitter"},"licenses":[{"type":"MIT","url":"https://github.com/bower/endpoint-parser/blob/master/LICENSE"}],"repository":{"type":"git","url":"git://github.com/bower/endpoint-parser.git"},"main":"index.js","engines":{"node":">=0.8.0"},"devDependencies":{"expect.js":"~0.2.0","mocha":"~1.12.0","mout":"~0.6.0"},"scripts":{"test":"mocha -R spec"},"readmeFilename":"README.md","bugs":{"url":"https://github.com/bower/endpoint-parser/issues"},"_id":"bower-endpoint-parser@0.1.0","dist":{"shasum":"635b2d351fee516b6f2abdc19b17c19c92eaaf7b","size":4226,"noattachment":false,"key":"/bower-endpoint-parser/-/bower-endpoint-parser-0.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/bower-endpoint-parser/download/bower-endpoint-parser-0.1.0.tgz"},"_from":".","_npmVersion":"1.3.2","_npmUser":{"name":"satazor","email":"andremiguelcruz@msn.com"},"maintainers":[{"name":"paulirish","email":""},{"name":"sheerun","email":"sheerun@sher.pl"},{"name":"wibblymat","email":"mat@wibbly.org.uk"}],"directories":{},"publish_time":1374609741674,"_cnpm_publish_time":1374609741674,"_hasShrinkwrap":false},"0.1.0-rc.1":{"name":"bower-endpoint-parser","version":"0.1.0-rc.1","description":"Little module that helps with endpoints parsing.","author":{"name":"Twitter"},"licenses":[{"type":"MIT","url":"https://github.com/bower/endpoint-parser/blob/master/LICENSE"}],"repository":{"type":"git","url":"git://github.com/bower/endpoint-parser.git"},"main":"index.js","engines":{"node":">=0.8.0"},"devDependencies":{"expect.js":"~0.2.0","mocha":"~1.12.0","mout":"~0.6.0"},"scripts":{"test":"mocha -R spec"},"readmeFilename":"README.md","bugs":{"url":"https://github.com/bower/endpoint-parser/issues"},"_id":"bower-endpoint-parser@0.1.0-rc.1","dist":{"shasum":"aa71223f316b12f3b602a5deba2c282b296191cb","size":4163,"noattachment":false,"key":"/bower-endpoint-parser/-/bower-endpoint-parser-0.1.0-rc.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/bower-endpoint-parser/download/bower-endpoint-parser-0.1.0-rc.1.tgz"},"_from":".","_npmVersion":"1.3.2","_npmUser":{"name":"satazor","email":"andremiguelcruz@msn.com"},"maintainers":[{"name":"paulirish","email":""},{"name":"sheerun","email":"sheerun@sher.pl"},{"name":"wibblymat","email":"mat@wibbly.org.uk"}],"directories":{},"publish_time":1373960648409,"_cnpm_publish_time":1373960648409,"_hasShrinkwrap":false}},"readme":"# endpoint-parser [![Build Status](https://secure.travis-ci.org/bower/endpoint-parser.png?branch=master)](http://travis-ci.org/bower/endpoint-parser)\n\nLittle module that helps with endpoints parsing.\n\n\n## API\n\n### .decompose(endpoint)\n\nDecomposes a endpoint into `name`, `source` and `target`.\n\n```js\nvar endpointParser = require('bower-endpoint-parser');\n\nendpointParser.decompose('jquery#~2.0.0');\n// { name: '', source: 'jquery', target: '~2.0.0' }\n\nendpointParser.decompose('backbone=backbone-amd#~1.0.0');\n// { name: 'backbone', source: 'backbone-amd', target: '~1.0.0' }\n\nendpointParser.decompose('http://twitter.github.io/bootstrap/assets/bootstrap.zip');\n// { name: '', source: 'http://twitter.github.io/bootstrap/assets/bootstrap', target: '*' }\n\nendpointParser.decompose('bootstrap=http://twitter.github.io/bootstrap/assets/bootstrap.zip');\n// { name: 'bootstrap', source: 'http://twitter.github.io/bootstrap/assets/bootstrap', target: '*' }\n```\n\n### .compose(decEndpoint)\n\nInverse of `decompose()`.   \nTakes a decomposed endpoint and composes it back into a string.\n\n```js\nvar endpointParser = require('bower-endpoint-parser');\n\nendpointParser.compose({ name: '', source: 'jquery', target: '~2.0.0' });\n// jquery#~2.0.0\n\nendpointParser.compose({ name: 'backbone', source: 'backbone-amd', target: '~1.0.0' });\n// backbone=backbone-amd#~1.0.0\n\nendpointParser.compose({ name: '', source: 'http://twitter.github.io/bootstrap/assets/bootstrap', target: '*' });\n// http://twitter.github.io/bootstrap/assets/bootstrap.zip\n\nendpointParser.compose({ name: 'bootstrap', source: 'http://twitter.github.io/bootstrap/assets/bootstrap', target: '*' });\n// bootstrap=http://twitter.github.io/bootstrap/assets/bootstrap.zip\n```\n\n### .json2decomposed(key, value)\n\nSimilar to `decompose()` but specially designed to be used when parsing `bower.json` dependencies.\nFor instance, in a `bower.json` like this:\n\n```js\n{\n    \"name\": \"foo\",\n    \"version\": \"0.1.0\",\n    \"dependencies\": {\n        \"jquery\": \"~1.9.1\",\n        \"backbone\": \"backbone-amd#~1.0.0\",\n        \"bootstrap\": \"http://twitter.github.io/bootstrap/assets/bootstrap\"\n    }\n}\n```\n\nYou would call `json2decomposed` like so:\n\n```js\nendpointParser.json2decomposed('jquery', '~1.9.1');\n// { name: 'jquery', source: 'jquery', target: '~1.9.1' }\n\nendpointParser.json2decomposed('backbone', 'backbone-amd#~1.0.0');\n// { name: 'backbone', source: 'backbone-amd', target: '~1.0.0' }\n\nendpointParser.json2decomposed('bootstrap', 'http://twitter.github.io/bootstrap/assets/bootstrap');\n// { name: 'bootstrap', source: 'http://twitter.github.io/bootstrap/assets/bootstrap', target: '*' }\n```\n\n### .decomposed2json(decEndpoint)\n\nInverse of `json2decomposed()`.   \nTakes a decomposed endpoint and composes it to be saved to `bower.json`.\n\n```js\nvar endpointParser = require('bower-endpoint-parser');\n\nendpointParser.decomposed2json({ name: 'jquery', source: 'jquery', target: '~2.0.0' });\n// { jquery: '~2.0.0' }\n\nendpointParser.decomposed2json({ name: 'backbone', source: 'backbone-amd', target: '~1.0.0' });\n// { backbone: 'backbone-amd#~2.0.0' }\n\nendpointParser.decomposed2json({ name: 'bootstrap', source: 'http://twitter.github.io/bootstrap/assets/bootstrap', target: '*' });\n// { bootstrap: 'http://twitter.github.io/bootstrap/assets/bootstrap' }\n```\n\nThis function throws an exception if the `name` from the decomposed endpoint is empty.\n\n\n## License\n\nReleased under the [MIT License](http://www.opensource.org/licenses/mit-license.php).\n","_attachments":{},"homepage":"https://github.com/bower/endpoint-parser","bugs":{"url":"https://github.com/bower/endpoint-parser/issues"}}