github.com/intruxpert/mapjs

MapJS is a Go-based tool that parses JavaScript source map files and extracts the original, non-minified JavaScript code. Perfect for developers looking to recover readable code from map files.


License
GPL-3.0
Install
go get github.com/intruxpert/mapjs

Documentation

JavaScript Extractor from Source Maps

This Go tool parses JavaScript source map (.map) files, extracts the original JavaScript code from the sourcesContent field, and saves it as a .js file. The tool is designed for scenarios where you need to recover the original, non-minified JavaScript code from a source map.

Features:

  • Parse source map files and extract embedded JavaScript.
  • Save the extracted JavaScript to a file or print it to the console.
  • Supports handling large source map files efficiently.

Usage:

  1. Build the tool using Go:

    go build -o MapJs MapJs.go
  2. Run the tool:

    • To extract and print the JavaScript code to the console:

      ./MapJs input.map
    • To extract and save the JavaScript code to a new file:

      ./MapJs input.map output.js

Example:

If you have a source map file like main.js.map, you can extract the original JavaScript and save it to main.js by running:

./MapJs main.js.map main.js

Requirements:

  • Go 1.15 or higher.

License:

This project is licensed under the GNU General Public License v3.0 (GPLv3). You are free to use, modify, and distribute the software, provided that any modifications you make are also licensed under GPLv3.

For more details, please refer to the full GPLv3 License.