| 1 |
{ |
| 2 |
"_id": "resolve-url", |
| 3 |
"_rev": "8-49847d7493cb8922de6b716042c527ae", |
| 4 |
"name": "resolve-url", |
| 5 |
"description": "Like Node.js’ `path.resolve`/`url.resolve` for the browser.", |
| 6 |
"dist-tags": { |
| 7 |
"latest": "0.2.1" |
| 8 |
}, |
| 9 |
"versions": { |
| 10 |
"0.1.0": { |
| 11 |
"name": "resolve-url", |
| 12 |
"version": "0.1.0", |
| 13 |
"description": "Like Node.js’ `path.resolve`/`url.resolve` for the browser.", |
| 14 |
"author": { |
| 15 |
"name": "Simon Lydell" |
| 16 |
}, |
| 17 |
"license": "MIT", |
| 18 |
"main": "resolve-url.js", |
| 19 |
"repository": { |
| 20 |
"type": "git", |
| 21 |
"url": "git://github.com/lydell/resolve-url" |
| 22 |
}, |
| 23 |
"keywords": [ |
| 24 |
"resolve", |
| 25 |
"url" |
| 26 |
], |
| 27 |
"scripts": { |
| 28 |
"test": "jshint resolve-url.js test/ && testling -u" |
| 29 |
}, |
| 30 |
"devDependencies": { |
| 31 |
"testling": "~1.6.0", |
| 32 |
"mocha": "~1.17.1", |
| 33 |
"chai": "~1.9.0", |
| 34 |
"jshint": "~2.4.3" |
| 35 |
}, |
| 36 |
"testling": { |
| 37 |
"harness": "mocha", |
| 38 |
"files": "test/*.js", |
| 39 |
"browsers": [ |
| 40 |
"ie/8..latest", |
| 41 |
"chrome/latest", |
| 42 |
"firefox/latest", |
| 43 |
"opera/12", |
| 44 |
"opera/latest", |
| 45 |
"safari/5", |
| 46 |
"iphone/6", |
| 47 |
"android-browser/4" |
| 48 |
] |
| 49 |
}, |
| 50 |
"bugs": { |
| 51 |
"url": "https://github.com/lydell/resolve-url/issues" |
| 52 |
}, |
| 53 |
"homepage": "https://github.com/lydell/resolve-url", |
| 54 |
"_id": "[email protected]", |
| 55 |
"dist": { |
| 56 |
"shasum": "f7d376cb5784b0b0fbf54d822b3d516666358fca", |
| 57 |
"tarball": "https://registry.npmjs.org/resolve-url/-/resolve-url-0.1.0.tgz" |
| 58 |
}, |
| 59 |
"_from": ".", |
| 60 |
"_npmVersion": "1.4.3", |
| 61 |
"_npmUser": { |
| 62 |
"name": "lydell", |
| 63 |
"email": "[email protected]" |
| 64 |
}, |
| 65 |
"maintainers": [ |
| 66 |
{ |
| 67 |
"name": "lydell", |
| 68 |
"email": "[email protected]" |
| 69 |
} |
| 70 |
], |
| 71 |
"directories": {}, |
| 72 |
"deprecated": "https://github.com/lydell/resolve-url#deprecated" |
| 73 |
}, |
| 74 |
"0.2.0": { |
| 75 |
"name": "resolve-url", |
| 76 |
"version": "0.2.0", |
| 77 |
"description": "Like Node.js’ `path.resolve`/`url.resolve` for the browser.", |
| 78 |
"author": { |
| 79 |
"name": "Simon Lydell" |
| 80 |
}, |
| 81 |
"license": "MIT", |
| 82 |
"main": "resolve-url.js", |
| 83 |
"repository": { |
| 84 |
"type": "git", |
| 85 |
"url": "git://github.com/lydell/resolve-url" |
| 86 |
}, |
| 87 |
"keywords": [ |
| 88 |
"resolve", |
| 89 |
"url" |
| 90 |
], |
| 91 |
"scripts": { |
| 92 |
"test": "jshint resolve-url.js test/ && testling -u" |
| 93 |
}, |
| 94 |
"devDependencies": { |
| 95 |
"testling": "~1.6.0", |
| 96 |
"jshint": "~2.4.3", |
| 97 |
"tape": "~2.5.0" |
| 98 |
}, |
| 99 |
"testling": { |
| 100 |
"files": "test/*.js", |
| 101 |
"browsers": [ |
| 102 |
"ie/8..latest", |
| 103 |
"chrome/latest", |
| 104 |
"firefox/latest", |
| 105 |
"opera/12", |
| 106 |
"opera/latest", |
| 107 |
"safari/5", |
| 108 |
"iphone/6", |
| 109 |
"android-browser/4" |
| 110 |
] |
| 111 |
}, |
| 112 |
"bugs": { |
| 113 |
"url": "https://github.com/lydell/resolve-url/issues" |
| 114 |
}, |
| 115 |
"homepage": "https://github.com/lydell/resolve-url", |
| 116 |
"_id": "[email protected]", |
| 117 |
"dist": { |
| 118 |
"shasum": "9479e58d94ea036d13f550d6ca14c3938cebbf67", |
| 119 |
"tarball": "https://registry.npmjs.org/resolve-url/-/resolve-url-0.2.0.tgz" |
| 120 |
}, |
| 121 |
"_from": ".", |
| 122 |
"_npmVersion": "1.4.4", |
| 123 |
"_npmUser": { |
| 124 |
"name": "lydell", |
| 125 |
"email": "[email protected]" |
| 126 |
}, |
| 127 |
"maintainers": [ |
| 128 |
{ |
| 129 |
"name": "lydell", |
| 130 |
"email": "[email protected]" |
| 131 |
} |
| 132 |
], |
| 133 |
"directories": {}, |
| 134 |
"deprecated": "https://github.com/lydell/resolve-url#deprecated" |
| 135 |
}, |
| 136 |
"0.2.1": { |
| 137 |
"name": "resolve-url", |
| 138 |
"version": "0.2.1", |
| 139 |
"description": "Like Node.js’ `path.resolve`/`url.resolve` for the browser.", |
| 140 |
"author": { |
| 141 |
"name": "Simon Lydell" |
| 142 |
}, |
| 143 |
"license": "MIT", |
| 144 |
"main": "resolve-url.js", |
| 145 |
"repository": { |
| 146 |
"type": "git", |
| 147 |
"url": "git://github.com/lydell/resolve-url" |
| 148 |
}, |
| 149 |
"keywords": [ |
| 150 |
"resolve", |
| 151 |
"url" |
| 152 |
], |
| 153 |
"scripts": { |
| 154 |
"test": "jshint resolve-url.js test/ && testling -u" |
| 155 |
}, |
| 156 |
"devDependencies": { |
| 157 |
"testling": "~1.6.0", |
| 158 |
"jshint": "~2.4.3", |
| 159 |
"tape": "~2.5.0" |
| 160 |
}, |
| 161 |
"testling": { |
| 162 |
"files": "test/*.js", |
| 163 |
"browsers": [ |
| 164 |
"ie/8..latest", |
| 165 |
"chrome/latest", |
| 166 |
"firefox/latest", |
| 167 |
"opera/12", |
| 168 |
"opera/latest", |
| 169 |
"safari/5", |
| 170 |
"iphone/6", |
| 171 |
"android-browser/4" |
| 172 |
] |
| 173 |
}, |
| 174 |
"bugs": { |
| 175 |
"url": "https://github.com/lydell/resolve-url/issues" |
| 176 |
}, |
| 177 |
"homepage": "https://github.com/lydell/resolve-url", |
| 178 |
"_id": "[email protected]", |
| 179 |
"dist": { |
| 180 |
"shasum": "2c637fe77c893afd2a663fe21aa9080068e2052a", |
| 181 |
"tarball": "https://registry.npmjs.org/resolve-url/-/resolve-url-0.2.1.tgz" |
| 182 |
}, |
| 183 |
"_from": ".", |
| 184 |
"_npmVersion": "1.4.4", |
| 185 |
"_npmUser": { |
| 186 |
"name": "lydell", |
| 187 |
"email": "[email protected]" |
| 188 |
}, |
| 189 |
"maintainers": [ |
| 190 |
{ |
| 191 |
"name": "lydell", |
| 192 |
"email": "[email protected]" |
| 193 |
} |
| 194 |
], |
| 195 |
"directories": {}, |
| 196 |
"deprecated": "https://github.com/lydell/resolve-url#deprecated" |
| 197 |
} |
| 198 |
}, |
| 199 |
"readme": "Overview\r\n========\r\n\r\n[](https://ci.testling.com/lydell/resolve-url)\r\n\r\nLike Node.js’ [`path.resolve`]/[`url.resolve`] for the browser.\r\n\r\n```js\r\nvar resolveUrl = require(\"resolve-url\")\r\n\r\nwindow.location\r\n// https://example.com/articles/resolving-urls/edit\r\n\r\nresolveUrl(\"remove\")\r\n// https://example.com/articles/resolving-urls/remove\r\n\r\nresolveUrl(\"/static/scripts/app.js\")\r\n// https://example.com/static/scripts/app.js\r\n\r\n// Imagine /static/scripts/app.js contains `//# sourceMappingURL=../source-maps/app.js.map`\r\nresolveUrl(\"/static/scripts/app.js\", \"../source-maps/app.js.map\")\r\n// https://example.com/static/source-maps/app.js.map\r\n\r\nresolveUrl(\"/static/scripts/app.js\", \"../source-maps/app.js.map\", \"../coffee/app.coffee\")\r\n// https://example.com/static/coffee/app.coffee\r\n\r\nresolveUrl(\"//cdn.example.com/jquery.js\")\r\n// https://cdn.example.com/jquery.js\r\n\r\nresolveUrl(\"http://foo.org/\")\r\n// http://foo.org/\r\n```\r\n\r\n\r\nInstallation\r\n============\r\n\r\n- `npm install resolve-url`\r\n- `bower install resolve-url`\r\n- `component install lydell/resolve-url`\r\n\r\nWorks with CommonJS, AMD and browser globals, through UMD.\r\n\r\n\r\nUsage\r\n=====\r\n\r\n### `resolveUrl(...urls)` ###\r\n\r\nPass one or more urls. Resolves the last one to an absolute url, using the\r\nprevious ones and `window.location`.\r\n\r\nIt’s like starting out on `window.location`, and then clicking links with the\r\nurls as `href` attributes in order, from left to right.\r\n\r\nUnlike Node.js’ [`path.resolve`], this function always goes through all of the\r\narguments, from left to right. `path.resolve` goes from right to left and only\r\nin the worst case goes through them all. Should that matter.\r\n\r\nActually, the function is _really_ like clicking a lot of links in series: An\r\nactual `<a>` gets its `href` attribute set for each url! This means that the\r\nurl resolution of the browser is used, which makes this module really\r\nlight-weight.\r\n\r\nAlso note that this functions deals with urls, not paths, so in that respect it\r\nhas more in common with Node.js’ [`url.resolve`]. But the arguments are more\r\nlike [`path.resolve`].\r\n\r\n[`path.resolve`]: http://nodejs.org/api/path.html#path_path_resolve_from_to\r\n[`url.resolve`]: http://nodejs.org/api/url.html#url_url_resolve_from_to\r\n\r\n\r\nTests\r\n=====\r\n\r\nRun `npm test`, which lints the code and then gives you a link to open in a\r\nbrowser of choice (using `testling`).\r\n\r\n\r\nLicense\r\n=======\r\n\r\n[The X11 (“MIT”) License](LICENSE).\r\n", |
| 200 |
"maintainers": [ |
| 201 |
{ |
| 202 |
"name": "lydell", |
| 203 |
"email": "[email protected]" |
| 204 |
} |
| 205 |
], |
| 206 |
"time": { |
| 207 |
"modified": "2020-03-28T23:10:48.836Z", |
| 208 |
"created": "2014-02-23T20:21:23.451Z", |
| 209 |
"0.1.0": "2014-02-23T20:21:23.452Z", |
| 210 |
"0.2.0": "2014-02-24T20:38:15.897Z", |
| 211 |
"0.2.1": "2014-02-25T18:48:50.732Z" |
| 212 |
}, |
| 213 |
"readmeFilename": "readme.md", |
| 214 |
"homepage": "https://github.com/lydell/resolve-url", |
| 215 |
"keywords": [ |
| 216 |
"resolve", |
| 217 |
"url" |
| 218 |
], |
| 219 |
"repository": { |
| 220 |
"type": "git", |
| 221 |
"url": "git://github.com/lydell/resolve-url" |
| 222 |
}, |
| 223 |
"author": { |
| 224 |
"name": "Simon Lydell" |
| 225 |
}, |
| 226 |
"bugs": { |
| 227 |
"url": "https://github.com/lydell/resolve-url/issues" |
| 228 |
}, |
| 229 |
"license": "MIT", |
| 230 |
"users": { |
| 231 |
"brandonpapworth": true |
| 232 |
} |
| 233 |
} |