Installations
npm install source-list-map
Developer Guide
Typescript
No
Module System
CommonJS
Node Version
8.11.4
NPM Version
5.6.0
Score
99.9
Supply Chain
97.1
Quality
75.8
Maintenance
100
Vulnerability
100
License
Contributors
Unable to fetch Contributors
Languages
JavaScript (100%)
Love this project? Help keep it running — sponsor us today! 🚀
Developer
webpack
Download Statistics
Total Downloads
3,609,665,916
Last Day
1,728,434
Last Week
10,840,119
Last Month
42,960,440
Last Year
490,920,936
GitHub Statistics
MIT License
39 Stars
50 Commits
18 Forks
5 Watchers
2 Branches
81 Contributors
Updated on Oct 30, 2023
Bundle Size
8.98 kB
Minified
2.54 kB
Minified + Gzipped
Package Meta Information
Latest Version
2.0.1
Package Id
source-list-map@2.0.1
Size
6.98 kB
NPM Version
5.6.0
Node Version
8.11.4
Published on
Oct 10, 2018
Total Downloads
Cumulative downloads
Total Downloads
3,609,665,916
Last Day
-20%
1,728,434
Compared to previous day
Last Week
-0.1%
10,840,119
Compared to previous week
Last Month
46.6%
42,960,440
Compared to previous month
Last Year
-16.6%
490,920,936
Compared to previous year
Daily Downloads
Weekly Downloads
Monthly Downloads
Yearly Downloads
source-list-map
API
Example
1var SourceListMap = require("source-list-map").SourceListMap; 2 3// Create a new map 4var map = new SourceListMap(); 5 6// Add generated code that is map line to line to some soure 7map.add("Generated\ncode1\n", "source-code.js", "Orginal\nsource"); 8 9// Add generated code that isn't mapped 10map.add("Generated\ncode2\n"); 11 12// Get SourceMap and generated source 13map.toStringWithSourceMap({ file: "generated-code.js" }); 14// { 15// source: 'Generated\ncode1\nGenerated\ncode2\n', 16// map: { 17// version: 3, 18// file: 'generated-code.js', 19// sources: [ 'source-code.js' ], 20// sourcesContent: [ 'Orginal\nsource' ], 21// mappings: 'AAAA;AACA;;;' 22// } 23// } 24 25// Convert existing SourceMap into SourceListMap 26// (Only the first mapping per line is preserved) 27var fromStringWithSourceMap = require("source-list-map").fromStringWithSourceMap; 28var map = fromStringWithSourceMap("Generated\ncode", { version: 3, ... }); 29
new SourceListMap()
SourceListMap.prototype.add
1SourceListMap.prototype.add(generatedCode: string) 2SourceListMap.prototype.add(generatedCode: string, source: string, originalSource: string) 3SourceListMap.prototype.add(sourceListMap: SourceListMap)
Append some stuff.
SourceListMap.prototype.prepend
1SourceListMap.prototype.prepend(generatedCode: string) 2SourceListMap.prototype.prepend(generatedCode: string, source: string, originalSource: string) 3SourceListMap.prototype.prepend(sourceListMap: SourceListMap)
Prepend some stuff.
SourceListMap.prototype.toString()
Get generated code.
SourceListMap.prototype.toStringWithSourceMap
1SourceListMap.prototype.toStringWithSourceMap(options: object)
Get generated code and SourceMap. options
can contains file
property which defines the file
property of the SourceMap.
SourceListMap.prototype.mapGeneratedCode
1SourceListMap.prototype.mapGeneratedCode(fn: function) : SourceListMap
Applies fn
to each generated code block (per line). The returned value is set as new generated code. Returns a new SourceListMap.
Removing and adding lines is supported. The SourceMap complexity will increase when doing this.
Test
License
Copyright (c) 2017 JS Foundation

No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
- Info: project has a license file: LICENSE:0
- Info: FSF or OSI recognized license: MIT License: LICENSE:0
Reason
Found 4/20 approved changesets -- score normalized to 2
Reason
9 existing vulnerabilities detected
Details
- Warn: Project is vulnerable to: GHSA-9vvw-cc9w-f27h
- Warn: Project is vulnerable to: GHSA-gxpj-cx7g-858c
- Warn: Project is vulnerable to: GHSA-h6ch-v84p-w6p9
- Warn: Project is vulnerable to: GHSA-qh2h-chj9-jffq
- Warn: Project is vulnerable to: GHSA-hxm2-r34f-qmc5
- Warn: Project is vulnerable to: GHSA-f8q6-p94x-37v3
- Warn: Project is vulnerable to: GHSA-vh95-rmgr-6w4m
- Warn: Project is vulnerable to: GHSA-xvch-5gv4-984h
- Warn: Project is vulnerable to: GHSA-w9mr-4mfr-499f
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
- Warn: no fuzzer integrations found
Reason
security policy file not detected
Details
- Warn: no security policy file detected
- Warn: no security file to analyze
- Warn: no security file to analyze
- Warn: no security file to analyze
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
- Warn: 0 commits out of 15 are checked with a SAST tool
Score
2.5
/10
Last Scanned on 2025-02-03
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