source-map-url
var sourceMappingURL = require("source-map-url")
var code = [
"!function(){...}();",
"/*# sourceMappingURL=foo.js.map */"
].join("\n")
sourceMappingURL.existsIn(code)
// true
sourceMappingURL.getFrom(code)
// foo.js.map
code = sourceMappingURL.insertBefore(code, "// License: MIT\n")
// !function(){...}();
// // License: MIT
// /*# sourceMappingURL=foo.js.map */
code = sourceMappingURL.removeFrom(code)
// !function(){...}();
// // License: MIT
sourceMappingURL.existsIn(code)
// false
sourceMappingURL.getFrom(code)
// null
code += "//# sourceMappingURL=/other/file.js.map"
// !function(){...}();
// // License: MIT
// //# sourceMappingURL=/other/file.js.mapInstallation
Usage
sourceMappingURL.getFrom(code)
sourceMappingURL.getFrom(code)sourceMappingURL.existsIn(code)
sourceMappingURL.existsIn(code)sourceMappingURL.removeFrom(code)
sourceMappingURL.removeFrom(code)sourceMappingURL.insertBefore(code, string)
sourceMappingURL.insertBefore(code, string)sourceMappingURL.regex
sourceMappingURL.regexTests
License
Last updated

