Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

errorception/source-mapping-url

Open more actions menu

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
7 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

source-mapping-url

Extracts the sourceMappingUrl from a node.js read stream.

Pass it any utf8 stream, and it gives you the source-map url in that stream. If no source-map is found, it returns false.

Works for both the @ and # formats. Only tested against JS files, but no reason it can't work for CSS files too.

Example

var smu = require("source-mapping-url"),
	zlib = require("zlib"),
    http = require("http");

var stream = http.get("http://code.jquery.com/jquery.min.js")
                 .pipe(zlib.createGunzip());

smu(stream, function(err, sourceMapUrl) {
	// sourceMapUrl is either false (if there's no source map declaration)
	// or is the value extracted from the file.
	// eg. `jquery.min.map`
});

Installation

npm install source-mapping-url

To run tests, cd to the source-mapping-url directory, and type in npm test.

License

MIT

About

Extracts the sourceMappingUrl from a node.js read stream

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Morty Proxy This is a proxified and sanitized view of the page, visit original site.