Skip to content

Instantly share code, notes, and snippets.

View yanjb's full-sized avatar

游虾壳 yanjb

  • JD
  • Paris, France
View GitHub Profile
@yanjb
yanjb / extract-sourcemap.mjs
Created March 31, 2026 13:48 — forked from sorrycc/extract-sourcemap.mjs
Extract original source code from JavaScript .map (source map) files. Reads sourcesContent, skips node_modules, reconstructs the original file tree.
#!/usr/bin/env node
/**
* Extract original source code from a JavaScript source map file.
*
* Usage:
* node extract-sourcemap.mjs <path-to-.map-file> [output-dir]
*
* Example:
* node extract-sourcemap.mjs cli.js.map ./src-extracted