Skip to main content

Unpack JavaScript source maps into source files

Project description

py_unpack_sourcemap

Unpack JavaScript source maps into source files

PyPI - Version PyPI - Downloads PyPI - Status License

Description

This Python tool allows you to unpack JavaScript source maps into their corresponding source files. It can be particularly useful for debugging and analyzing minified JavaScript code in production environments.

Modern browsers like Chrome and Firefox provide this functionality in DevTools. However, they only let you view the source code in the browser itself, which can be limiting. This tool allows you to extract the whole source tree for viewing it in your favourite IDE.

Installation

Ensure you have Python 3.10 or later installed. The package is not tested on older versions, but they will probably work.

You can install the tool from PyPI using pip:

pip install py_unpack_sourcemap

Or Poetry:

poetry add py_unpack_sourcemap

Usage

As a command-line tool

python -m py_unpack_sourcemap [-h] -o OUTPUT_DIR sourcemap

positional arguments:
  sourcemap             path to the source map (a .js.map file)

options:
  -h, --help            show this help message and exit
  -o OUTPUT_DIR, --output-dir OUTPUT_DIR
                        a directory to extract source files into

As a Python module

No information here yet :( Use autocompletion or view the source code.

Contributing

Any contributions are appreciated. Regular stuff. Don't be afraid to create issues for any features you need.

Contributors

License

This project is licensed under the MIT License.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

py_unpack_sourcemap-1.0.0.tar.gz (3.7 kB view hashes)

Uploaded Source

Built Distribution

py_unpack_sourcemap-1.0.0-py3-none-any.whl (4.8 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page