Skip to content

dirk/rdce

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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:

rdce dep/diff_match_patch.js > dep/diff_match_patch.rdce.js

Then the testing HTML document was updated like:

<!-- Plain version: <script type="text/javascript" src="dep/diff_match_patch.js"></script> -->
<!-- Rdce version: -->
<script type="text/javascript" src="dep/diff_match_patch.rdce.js"></script>

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.

About

Runtime dead code elimination for JavaScript

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published