sfcode
An Online Competing and Development Environment
|
Tools for working with sourceMappingURL comments.
npm install source-map-url
bower install source-map-url
component install lydell/source-map-url
Works with CommonJS, AMD and browser globals, through UMD.
Returns the url of the sourceMappingURL comment in code
. Returns null
if there is no such comment.
Returns true
if there is a sourceMappingURL comment in code
, or false
otherwise.
Removes the sourceMappingURL comment in code
. Does nothing if there is no such comment. Returns the updated code
.
Inserts string
before the sourceMappingURL comment in code
. Appends string
to code
if there is no such comment.
Lets you append something to a file without worrying about burying the sourceMappingURL comment (by keeping it at the end of the file).
The regex that is used to match sourceMappingURL comments. It matches both //
and /**/
comments, thus supporting both JavaScript and CSS.
Start by running npm test
, which lints the code and runs the test suite in Node.js.
To run the tests in a browser, run testling
(npm install -g testling
) or testling -u
.
[The X11 (“MIT”) License](LICENSE).