Understand JavaScript apps. See where each character on the screen came from in code.
JavaScript TypeScript Other
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
.circleci
.vscode
docs
packages
.babelrc
.eslintrc.js
.gitignore
.npmignore
CONTRIBUTING.md
LICENSE.txt
README.md
jest.config.dev.js
jest.config.js
lerna.json
package.json
preprocessor.js
prettier.config.js
tsconfig.json
tslint.json
yarn.lock

README.md

FromJS Build Status

FromJS is dynamic dataflow analysis tool. You can use it to discover code and understand JavaScript apps.

FromJS is in currently. If you find any issues (you probably will) please report them on Github.

This is how you use it: open any web page, select an element with the DOM inspector, then view the source of the inspected data. The screenshot below shows the the todo item was loaded from localStorage:

Getting started

Install FromJS:

Yarn: sudo yarn global add @fromjs/cli
NPM: sudo npm install -g @fromjs/cli --unsafe-perm (Why unsafe-perm?)

Run FromJS: fromjs - this will open a Chrome browser window

By default this will launch a web server on localhost:7000, a proxy server on port 7001, and store the collected data in ./fromjs-session.

Loading pages will be slow! For large apps expect it to take several minutes. It will be faster once the page's JS files are cached. Maybe try something simple like Backbone TodoMVC to get started.

The page inspector UI

  • explain dataflow concept / what the steps mean
  • can select characters
  • view argument list

fromJSInspect

Instead of using the DOM Inspector you can also use the global fromJSInspect function in the inspected page.

If you control the code for the inspected page you can write something like this:

var greeting = "Hello world!"
fromJSInspect(greeting)

You can also inspect DOM elements:

fromJSInspect(document.querySelector("#app"))

Node

Node isn't currently supported, although if we can figure out how to intercept the JS before it's executed by Node it should be pretty straightforward to implement.

How it works

Read about it here.

Key libraries used:

Contribute

Check out the Contributing.md file.