From a browser, finds the sourcemap url or the sourcemap file itself, given the URL (or source) of the original source file.
From a browser, finds the sourcemap url or the sourcemap file itself, given the URL (or source) of the original source file. Uses async-futures.
findSourcemapfromUrl'originalSourceFile.js'then// do something with the sourcemapUrldone
npm install sourcemap-locator
var findSourcemap = require'sourcemap-locator' // use webpack (recommended) or browserify
These return a future of the sourcemap URL, or future undefined if it isn't found:
findSourcemapfromUrloriginalSourceUrlfindSourcemapfromSourceoriginalSourceText // works in node.js (the other ones don't)
These return a future of the text of the sourcemap file, or future undefined if it isn't found:
findSourcemapfromUrloriginalSourceUrl truefindSourcemapfromSourceoriginalSourceUrl true
These override cache maintainance functions if you have a separate cache of file sources
findSourcemapcacheGet// get the url from your own cachefindSourcemapcacheSet// set the content downloaded from a url for your own cache using futureResponse
Tested in the following browsers:
How to submit pull requests:
npm installat its root
Released under the MIT license: http://opensource.org/licenses/MIT