Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Visualize program state during execution.
JavaScript CSS
branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
bin Turn it into an npm package.
bookmarklet
chrome-extension
demos Restore old test.'s code.
lib
result-server
scraper
.editorconfig
.gitignore
Gruntfile.js
LICENSE
README.md
bookmarklet.js
jashkenas-underscore-2014-06-02T21-21:51.093Z
jashkenas-underscore-2014-06-02T21-22:08.154Z
logo-128x128.png
logo.png
package.json

README.md

vAnnotate

Annotates variables in Javascript code with the values they take during execution.

You'll need a static html page that links Javascript files

Installation

sudo npm install -g vannotate

(Or download the Github repo and run node lib/vAnnotate.)

Usage

vAnnotate

This will make the current working directory accessible at http://localhost:7000.

In there you can open the static html file. vAnnotate will collect the annotation data and the annotated code is made available at http://localhost:7000/vAnnotate/results.

Additional command-line options

vAnnotate --port 1234

Change port where static files are served.

How it works

vAnnotate creates a static files server to serve the Html and Javascript code. When a .js file is requested it injects logging instructions into the file, for example for function calls and variable assignments.

Known issues

  • Logging assignments to member expressions can currently have side effects. For example if you run a[fn()] = b fn will be called twice - once for the assignment and once for the logging call. To fix this we need to move the object properties to separate variables before doing the assignment and the logging.
Something went wrong with that request. Please try again.