Giter Club home page Giter Club logo

sourcemapper's Introduction

Sourcemapper

Reconstruct javascript from a sourcemap in bash

Sourcemaps are used to help developers debug minified javascript. If a sourcemap is provided, the minified js will be served to visitors, but the browsers debugger will be able to access the original unminified code. Sourcemapper enables you to download the original, unminified javascript source tree from the commandline so that you don't have to analyze it with the in-browser debugger.

Finding sourcemap files

To find a sourcemap, look at the very end of a minified javascript file. If a sourcemap exists it should be linked there.

Occasionally the .map file will exist even though the reference isn't in the minified source. You might be able to find it by adding .map to the end of the javascripts filename as in: script.js.map

Finally, if there are no sourcemaps available on production servers, check development and staging servers.

Note:

If you find that files contain just the phrase: "Not Found" or other errors that means that the files were listed in the sourcemap, but not actually accessible. I decided to have the empty files created anyway in case the directory structure itself is valuable information.

$ ./sourcemaps.sh https://github.githubassets.com/assets/github-bootstrap-ce762218.js.map
https://github.githubassets.com/assets
Map loaded: read 539892 bytes from github-bootstrap-ce762218.js.map.
337 files to be written.
Writing: ./sourcemaps/node_modules/request-idle-polyfill/dist/index.js
Writing: ./sourcemaps/node_modules/smoothscroll-polyfill/dist/smoothscroll.js
Writing: ./sourcemaps/node_modules/user-select-contain-polyfill/user-select-contain.mjs
Writing: ./sourcemaps/node_modules/mdn-polyfills/Element.prototype.toggleAttribute.js
Writing: ./sourcemaps/app/assets/modules/environment-bootstrap.js
Writing: ./sourcemaps/app/assets/modules/github/failbot.js
Writing: ./sourcemaps/node_modules/@github/auto-check-element/dist/index.esm.js
Writing: ./sourcemaps/app/assets/modules/github/failbot-error.js
Writing: ./sourcemaps/node_modules/@github/clipboard-copy-element/dist/index.esm.js
Writing: ./sourcemaps/node_modules/@github/details-menu-element/dist/index.esm.js
Writing: ./sourcemaps/node_modules/@github/file-attachment-element/dist/index.js
Writing: ./sourcemaps/node_modules/@github/g-emoji-element/dist/index.esm.js
Writing: ./sourcemaps/node_modules/@github/image-crop-element/dist/index.esm.js
Writing: ./sourcemaps/node_modules/@github/markdown-toolbar-element/dist/index.esm.js
Writing: ./sourcemaps/node_modules/@github/tab-container-element/dist/index.esm.js
Writing: ./sourcemaps/node_modules/@github/text-expander-element/dist/index.esm.js
Writing: ./sourcemaps/node_modules/@github/time-elements/dist/time-elements.js
Writing: ./sourcemaps/app/assets/modules/github/confirm.js
Writing: ./sourcemaps/app/assets/modules/github/hotkey-map.js
Writing: ./sourcemaps/app/assets/modules/github/include-fragment-element-hacks.js
Writing: ./sourcemaps/app/assets/modules/github/poll-include-fragment-element.js

sourcemapper's People

Contributors

andrix44 avatar tehryanx avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.