How to use babel-traverse

Comprehensive babel-traverse code examples:

How to use babel-traverse.NodePath:

485
486
487
488
489
490
491
492
493
494
  this.log.debug("Parse stop");
  return ast;
};

File.prototype._addAst = function _addAst(ast) {
  this.path = _babelTraverse.NodePath.get({
    hub: this.hub,
    parentPath: null,
    parent: ast,
    container: ast,

How to use babel-traverse.Hub:

175
176
177
178
179
180
181
182
183
184
  _this.ast = {};

  _this.code = "";
  _this.shebang = "";

  _this.hub = new _babelTraverse.Hub(_this);
  return _this;
}

File.prototype.getMetadata = function getMetadata() {

How to use babel-traverse.visitors:

75
76
77
78
79
80
81
82
83
84
85
      }
    }
  }
}]);


var findThisesVisitor = _babelTraverse.visitors.merge([noMethodVisitor, {
  ThisExpression: function ThisExpression(path) {
    this.superThises.push(path);
  }
}]);