https://github.com/dirk/rdce
Runtime dead code elimination for JavaScript
https://github.com/dirk/rdce
Last synced: about 1 year ago
JSON representation
Runtime dead code elimination for JavaScript
- Host: GitHub
- URL: https://github.com/dirk/rdce
- Owner: dirk
- License: mit
- Created: 2014-07-19T15:21:37.000Z (almost 12 years ago)
- Default Branch: master
- Last Pushed: 2014-11-06T18:09:42.000Z (over 11 years ago)
- Last Synced: 2025-03-21T13:45:50.824Z (about 1 year ago)
- Language: JavaScript
- Size: 199 KB
- Stars: 3
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Rdce
A tool for analyzing JavaScript code to identify live and dead code paths at runtime. Rdce should run in any modern JavaScript environment. It works by post-processing JavaScript files to inject small hooks at the beginning of function bodies. These hooks, in combination with a small runtime library, allow it to track execution of functions to easily identify live and dead ones.
### Example
The example below was generated via the following steps:
```bash
rdce dep/diff_match_patch.js > dep/diff_match_patch.rdce.js
```
Then the testing HTML document was updated like:
```html
```
The testing application was then run through its regular usage paces. Finally, `_rdce.report()` was called in the console:

### License
Released under the MIT license, see `LICENSE` for details.