Gathering detailed insights and metrics for combine-source-map
Gathering detailed insights and metrics for combine-source-map
Gathering detailed insights and metrics for combine-source-map
Gathering detailed insights and metrics for combine-source-map
Add source maps of multiple files, offset them and then combine them into one source map.
npm install combine-source-map
Module System
Min. Node Version
Typescript Support
Node Version
NPM Version
79 Stars
53 Commits
19 Forks
7 Watching
1 Branches
10 Contributors
Updated on 12 Nov 2024
JavaScript (100%)
Cumulative downloads
Total Downloads
Last day
-9.3%
238,891
Compared to previous day
Last week
10.5%
1,648,236
Compared to previous week
Last month
28.1%
5,823,686
Compared to previous month
Last year
-19.5%
55,940,677
Compared to previous year
1
Add source maps of multiple files, offset them and then combine them into one source map.
1var convert = require('convert-source-map'); 2var combine = require('combine-source-map'); 3 4var fooComment = '//# sourceMappingURL=data:application/json;base64,eyJ2Z [..] pzJylcbiJdfQ=='; 5var barComment = '//# sourceMappingURL=data:application/json;base64,eyJ2Z [..] VjaycpXG4iXX0='; 6 7var fooFile = { 8 source: '(function() {\n\n console.log(require(\'./bar.js\'));\n\n}).call(this);\n' + '\n' + fooComment 9 , sourceFile: 'foo.js' 10}; 11var barFile = { 12 source: '(function() {\n\n console.log(alert(\'alerts suck\'));\n\n}).call(this);\n' + '\n' + barComment 13 , sourceFile: 'bar.js' 14}; 15 16var offset = { line: 2 }; 17var base64 = combine 18 .create('bundle.js') 19 .addFile(fooFile, offset) 20 .addFile(barFile, { line: offset.line + 8 }) 21 .base64(); 22 23var sm = convert.fromBase64(base64).toObject(); 24console.log(sm);
{ version: 3,
file: 'bundle.js',
sources: [ 'foo.coffee', 'bar.coffee' ],
names: [],
mappings: ';;;AAAA;CAAA;CAAA,CAAA,CAAA,IAAO,GAAK;CAAZ;;;;;ACAA;CAAA;CAAA,CAAA,CAAA,IAAO,GAAK;CAAZ',
sourcesContent:
[ 'console.log(require \'./bar.js\')\n',
'console.log(alert \'alerts suck\')\n' ] }
npm install combine-source-map
/**
* @name create
* @function
* @param file {String} optional name of the generated file
* @param sourceRoot { String} optional sourceRoot of the map to be generated
* @return {Object} Combiner instance to which source maps can be added and later combined
*/
/**
* Adds map to underlying source map.
* If source contains a source map comment that has the source of the original file inlined it will offset these
* mappings and include them.
* If no source map comment is found or it has no source inlined, mappings for the file will be generated and included
*
* @name addMap
* @function
* @param opts {Object} { sourceFile: {String}, source: {String} }
* @param offset {Object} { line: {Number}, column: {Number} }
*/
/**
* @name base64
* @function
* @return {String} base64 encoded combined source map
*/
/**
* @name comment
* @function
* @return {String} base64 encoded sourceMappingUrl comment of the combined source map
*/
/**
* @name removeComments
* @function
* @param src
* @return {String} src with all sourceMappingUrl comments removed
*/
Read and run the more elaborate example in order to get a better idea how things work.
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
0 existing vulnerabilities detected
Reason
license file detected
Details
Reason
Found 2/25 approved changesets -- score normalized to 0
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Reason
security policy file not detected
Details
Score
Last Scanned on 2024-11-18
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More