diff options
author | Jez Ng <me@jezng.com> | 2013-06-19 05:08:43 -0700 |
---|---|---|
committer | Jez Ng <me@jezng.com> | 2013-06-19 14:15:18 -0700 |
commit | 54a59bee849be1da0c6d1de0dc4a6a73744c6d04 (patch) | |
tree | 67405818086e42333a459adfe5ebca140cd33efe /tools/source-maps/sourcemap2json.js | |
parent | 0f73e28bab1c1b8caa8f7b77692bebd705bebe6a (diff) |
Move source mapping files into their own folder.
Diffstat (limited to 'tools/source-maps/sourcemap2json.js')
-rw-r--r-- | tools/source-maps/sourcemap2json.js | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/tools/source-maps/sourcemap2json.js b/tools/source-maps/sourcemap2json.js new file mode 100644 index 00000000..5dd162b2 --- /dev/null +++ b/tools/source-maps/sourcemap2json.js @@ -0,0 +1,15 @@ +/* + * Quick utility script for the Python test script to call. Could be replaced if + * a good Python source map library is found. + */ +var SourceMapConsumer = require('source-map').SourceMapConsumer; +var fs = require('fs'); + +var consumer = new SourceMapConsumer(fs.readFileSync(process.argv[2], 'utf-8')); +var mappings = []; + +consumer.eachMapping(function(mapping) { + mappings.push(mapping); +}); + +console.log(JSON.stringify(mappings)); |