Skip to content

decaffeinate/decaffeinate-traverse

Repository files navigation

decaffeinate-traverse

DEPRECATED

This project is no longer in use and should be considered deprecated.


Traverse programs parsed using decaffeinate-parser.

Install

$ npm install [--save-dev] decaffeinate-traverse

Usage

/**
 * This example prints all identifiers in a program. In this case, it prints:
 *
 *     a
 *     b
 *
 */

import { Visitor } from 'decaffeinate-traverse';
import { parse } from 'decaffeinate-parser';

class IdentifierPrinter extends Visitor {
  visitIdentifier(node) {
    console.log(node.data);
  }
}

new IdentifierPrinter().visit(parse('a + b'));

License

MIT