{"id":14976286,"url":"https://github.com/webpack/source-list-map","last_synced_at":"2025-04-05T23:06:16.372Z","repository":{"id":29961722,"uuid":"33508518","full_name":"webpack/source-list-map","owner":"webpack","description":"Fast line to line SourceMap generator.","archived":false,"fork":false,"pushed_at":"2019-01-05T18:40:21.000Z","size":60,"stargazers_count":40,"open_issues_count":6,"forks_count":18,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-03-27T13:38:51.576Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/webpack.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-04-06T22:10:57.000Z","updated_at":"2025-03-23T06:52:23.000Z","dependencies_parsed_at":"2022-09-07T12:20:49.931Z","dependency_job_id":null,"html_url":"https://github.com/webpack/source-list-map","commit_stats":null,"previous_names":[],"tags_count":15,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/webpack%2Fsource-list-map","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/webpack%2Fsource-list-map/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/webpack%2Fsource-list-map/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/webpack%2Fsource-list-map/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/webpack","download_url":"https://codeload.github.com/webpack/source-list-map/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246037428,"owners_count":20713418,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-09-24T13:53:37.875Z","updated_at":"2025-03-29T22:04:56.525Z","avatar_url":"https://github.com/webpack.png","language":"JavaScript","readme":"# source-list-map\n\n## API\n\n### Example\n\n``` js\nvar SourceListMap = require(\"source-list-map\").SourceListMap;\n\n// Create a new map\nvar map = new SourceListMap();\n\n// Add generated code that is map line to line to some soure\nmap.add(\"Generated\\ncode1\\n\", \"source-code.js\", \"Orginal\\nsource\");\n\n// Add generated code that isn't mapped\nmap.add(\"Generated\\ncode2\\n\");\n\n// Get SourceMap and generated source\nmap.toStringWithSourceMap({ file: \"generated-code.js\" });\n// {\n//   source: 'Generated\\ncode1\\nGenerated\\ncode2\\n',\n//   map: {\n//      version: 3,\n//      file: 'generated-code.js',\n//      sources: [ 'source-code.js' ],\n//      sourcesContent: [ 'Orginal\\nsource' ],\n//      mappings: 'AAAA;AACA;;;'\n//    }\n// }\n\n// Convert existing SourceMap into SourceListMap\n// (Only the first mapping per line is preserved)\nvar fromStringWithSourceMap = require(\"source-list-map\").fromStringWithSourceMap;\nvar map = fromStringWithSourceMap(\"Generated\\ncode\", { version: 3, ... });\n\n```\n\n### `new SourceListMap()`\n\n### `SourceListMap.prototype.add`\n\n``` js\nSourceListMap.prototype.add(generatedCode: string)\nSourceListMap.prototype.add(generatedCode: string, source: string, originalSource: string)\nSourceListMap.prototype.add(sourceListMap: SourceListMap)\n```\n\nAppend some stuff.\n\n### `SourceListMap.prototype.prepend`\n\n``` js\nSourceListMap.prototype.prepend(generatedCode: string)\nSourceListMap.prototype.prepend(generatedCode: string, source: string, originalSource: string)\nSourceListMap.prototype.prepend(sourceListMap: SourceListMap)\n```\n\nPrepend some stuff.\n\n### `SourceListMap.prototype.toString()`\n\nGet generated code.\n\n### `SourceListMap.prototype.toStringWithSourceMap`\n\n``` js\nSourceListMap.prototype.toStringWithSourceMap(options: object)\n```\n\nGet generated code and SourceMap. `options` can contains `file` property which defines the `file` property of the SourceMap.\n\n### `SourceListMap.prototype.mapGeneratedCode`\n\n``` js\nSourceListMap.prototype.mapGeneratedCode(fn: function) : SourceListMap\n```\n\nApplies `fn` to each generated code block (per line). The returned value is set as new generated code. Returns a new SourceListMap.\n\nRemoving and adding lines is supported. The SourceMap complexity will increase when doing this.\n\n## Test\n\n[![Build Status](https://travis-ci.org/webpack/source-list-map.svg)](https://travis-ci.org/webpack/source-list-map)\n\n## License\n\nCopyright (c) 2017 JS Foundation\n\nMIT (http://www.opensource.org/licenses/mit-license.php)","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwebpack%2Fsource-list-map","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwebpack%2Fsource-list-map","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwebpack%2Fsource-list-map/lists"}