Socket
Socket
Sign inDemoInstall

astw

Package Overview
Dependencies
1
Maintainers
2
Versions
9
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    astw

walk the ast with references to parent nodes


Version published
Weekly downloads
53K
decreased by-1.42%
Maintainers
2
Install size
575 kB
Created
Weekly downloads
 

Readme

Source

astw

walk the ast

browser support

build status

This module is a faster version of falafel that only does ast walking and .parent tracking, not source transforms.

example

var astw = require('astw');
var deparse = require('escodegen').generate;
var walk = astw('4 + beep(5 * 2)');

walk(function (node) {
    var src = deparse(node);
    console.log(node.type + ' :: ' + JSON.stringify(src));
});

methods

var astw = require('astw')

var walk = astw(src, opts={})

Return a walk() function from the source string or ast object src.

Optionally:

  • opts.ecmaVersion - default: 8

walk(cb)

Walk the nodes in the ast with cb(node) where node is each element in the ast from esprima but with an additional .parent reference to the parent node.

install

With npm do:

npm install astw

license

MIT

Keywords

FAQs

Last updated on 01 Mar 2017

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc