{"id":13433569,"url":"https://github.com/1egoman/debundle","last_synced_at":"2025-04-04T18:07:06.181Z","repository":{"id":45695884,"uuid":"82681667","full_name":"1egoman/debundle","owner":"1egoman","description":":card_file_box: A javascript debundler. Takes a Browserify or Webpack bundle and recreates the initial, pre-bundled source.","archived":false,"fork":false,"pushed_at":"2021-09-19T12:35:26.000Z","size":571,"stargazers_count":691,"open_issues_count":10,"forks_count":145,"subscribers_count":14,"default_branch":"master","last_synced_at":"2024-04-11T13:59:56.122Z","etag":null,"topics":["ast","browserify","bundle","debundle","reverse-engineering","webpack-bundle"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/debundle","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/1egoman.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-02-21T13:15:17.000Z","updated_at":"2024-04-09T01:05:38.000Z","dependencies_parsed_at":"2022-07-18T06:47:03.511Z","dependency_job_id":null,"html_url":"https://github.com/1egoman/debundle","commit_stats":null,"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/1egoman%2Fdebundle","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/1egoman%2Fdebundle/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/1egoman%2Fdebundle/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/1egoman%2Fdebundle/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/1egoman","download_url":"https://codeload.github.com/1egoman/debundle/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247226213,"owners_count":20904465,"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":["ast","browserify","bundle","debundle","reverse-engineering","webpack-bundle"],"created_at":"2024-07-31T02:01:29.548Z","updated_at":"2025-04-04T18:07:06.160Z","avatar_url":"https://github.com/1egoman.png","language":"JavaScript","readme":"![Debundle](debundle_logo.png)\n\n# debundle\n\nThis is a tool built to unpack javascript bundles prudiced by webpack and browserify.\n\n[![Build Status](https://travis-ci.org/1egoman/debundle.svg?branch=master)](https://travis-ci.org/1egoman/debundler)\n\n---\n\n## :dragon: HERE BE DRAGONS! :dragon:\nThis was a research project that is **no longer maintained**. I built to help me understand how javascript bundles are strutured. It works in a labratory environment most of the time, but often fails on real-world javascript bundles. It's been a while since I worked on this project so if you run into issues, I might not really be able to help you out all that much.\n\n---\n\n## Why would I want to debundle my code?\nReasons vary, but this tool was originally developed to help me with a reverse engineering project.\nNeedless to say, sifting through minified bundles to try and figure out how a service works isn't\nfun and is a lot easier when that bundle is broken into files and those files have semantic names. \n\n## Installation\n```\nnpm i -g debundle\n```\n\n## Running\n```bash\n$ debundle\nUsage: debundle [input file] {OPTIONS}\n\nOptions:\n   --input,  -i  Bundle to debundle\n   --output, -o  Directory to debundle code into.\n   --config, -c  Configuration file\n\n$ curl https://raw.githubusercontent.com/1egoman/debundle/master/test_bundles/browserify/bundle.js \u003e bundle.js\n$ curl https://raw.githubusercontent.com/1egoman/debundle/master/test_bundles/browserify/debundle.config.json \u003e debundle.config.json\n$ cat debundle.config.json\n{\n  \"type\": \"browserify\",\n  \"knownPaths\": {}\n}\n$ debundle -i bundle.js -o dist/ -c debundle.config.json\n$ tree dist/\ndist/\n├── index.js\n└── node_modules\n    ├── number\n    │   └── index.js\n    └── uuid\n        ├── index.js\n        ├── lib\n        │   ├── bytesToUuid.js\n        │   └── rng.js\n        ├── v1.js\n        └── v4.js\n4 directories, 7 files\n```\n\n# Configuration\n\n## Simple configuration\n```\n{\n  \"type\": \"browserify\",\n  \"entryPoint\": 1,\n  \"knownPaths\": {}\n}\n```\n\n(To debundle a simple Webpack bundle, replace `browserify` the above configuration with `webpack`)\n\nA configuration can have a number of flags - they are documented in [DOCS.md](DOCS.md).\n\n# FAQ\n\n### Is debundling lossless? Ie, if I bundle my code then debundle, will I get the same source that was originally bundled? \n\nNo. There a bunch of metadata that's lost when bundling:\n- Any custom `package.json` settings for each `node_module` and the root package.\n- In a webpack bundle, the names of modules aren't in the bundle. By default, debundling will produce\nfiles named after the module id (ie, `1.js`) unless [manually overridden](https://github.com/1egoman/debundle/blob/master/DOCS.md#knownpaths-required).\n- If your code was minified, the output files from the debundling process will also be minified (ie,\nno whitespace, single letter variables, etc). It's up to you to run source through other tools to\nmake it look nicer.\n\n### My debundled code can't be run!\n\n- Make sure that either when rebundling or running with node that you're using the correct file as\nyour entrypoint. \n- Read through [all the configuration options](https://github.com/1egoman/debundle/blob/master/DOCS.md). Some of them have caveats.\n- You could have run into an edge case that I haven't seen yet. Feel free to open an issue if you believe that to be the case.\n\n### Does this tool support bundles made by tools other than Browserify and Webpack?\n\nNot officially. However, if a bundle shares the same type module layout as Browserify or Webpack it\nmay be possible to set the [moduleAst](https://github.com/1egoman/debundle/blob/master/DOCS.md#moduleast)\nconfiguration option to point to the location of the modules.\n\n# Contributing\n- After cloning down the project, run `npm install` - that should be it.\n- Debundler entry point is `./src/index.js` (that's how you run it!)\n- A bunch of sample bundles are in `test_bundles/`. A script, `test_bundles/run_test.sh` can run the\n  debundler against a given bundle and try to debundle it into `dist/`. (CI will, as part of running\n  tests, debundle all the bundles in that folder.)\n- Make sure any contribution pass the tests: `npm test`\n\n# Legal note\nSome companies specify in their terms of service that their code cannot be \"reverse engineered\".\nDebundling can definitely (depending on how you're using the code) fall under that umbrella.\nUnderstand what you are doing so you don't break any agreements :smile:\n","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F1egoman%2Fdebundle","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F1egoman%2Fdebundle","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F1egoman%2Fdebundle/lists"}