Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/maierfelix/Iroh

Dynamic code analysis tool - Exploit, record and analyze running JavaScript
https://github.com/maierfelix/Iroh

Last synced: about 1 month ago
JSON representation

Dynamic code analysis tool - Exploit, record and analyze running JavaScript

Awesome Lists containing this project

README

        



Iroh


Website |
Examples |
API


NPM Version NPM Downloads


☕ Dynamic code analysis for JavaScript


#### Description

Iroh is a dynamic code analysis tool for JavaScript.
Iroh allows to record your code flow in realtime, intercept runtime informations and manipulate program behaviour on the fly.

#### What is Dynamic analysis?

Dynamic analysis is in contrast to static analysis (e.g. used in [Babel](//github.com/babel/babel) and [ESlint](//github.com/eslint/eslint)). It allows to collect data which is only available at runtime. Iroh makes it possible to collect type informations of your running program, analyze it's behaviour, capture and manipulate runtime values like parameters or variables - and all this while your code is actually running!

### Getting started

You can learn how to use Iroh [here](//github.com/maierfelix/Iroh/blob/master/GETTING_STARTED.md).

A summary of Iroh's API can be found [here](//github.com/maierfelix/Iroh/blob/master/API.md).

### Installation

````
npm install iroh
````
or alternatively the browser distribution from [here](//cdn.rawgit.com/maierfelix/Iroh/master/dist/iroh-browser.js).

### Examples

You can play with some live examples [here](//maierfelix.github.io/Iroh/examples/) and you can clone them from [here](//github.com/maierfelix/Iroh/tree/gh-pages/examples).

Below you can see an example of visualizing captured runtime data. While the code below is running, Iroh feeds us a stream of runtime informations, which we can then visualize within any kind of model. In this case we are using a simple textual model to visualize all ``Iroh.CALLS`` (*function calls*) and ``Iroh.IF`` (*if statements*) of the input code. The code indentation in the output is automatically generated by Iroh too.

#### Input
````js
function factorial(n) {
if (n === 0) return 1;
return n * factorial(n - 1);
};
factorial(3);
````
#### Output
````js
call factorial ( [3] )
call factorial ( [2] )
call factorial ( [1] )
call factorial ( [0] )
if
if end
call factorial end -> [1]
call factorial end -> [1]
call factorial end -> [2]
call factorial end -> [6]
````