Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

walkes

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

walkes

very simple walker for estree AST

  • 0.2.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
11K
decreased by-5.9%
Maintainers
1
Weekly downloads
 
Created
Source

walker, texas ranger

very simple walker for estree AST

Build Status Coverage Status Dependency Status

Installation

$ npm install walkes

Or as a component:

$ component install Swatinem/walkes

Compatibility warning

walkes ~ 0.1.0 used to pass in the node as this. This changed with version ~ 0.2.0 which passes it as the first parameter. Please keep that in mind, and sorry for the inconvenience.

Usage

walkes works with an estree spec compatible ast. You are free to choose whichever parser you would like, such as esprima, espree, babel, acorn or others.

walker(espree.parse("…"), {
	MemberExpression: function (node, recurse, stop) {
		// you are responsible to call `recurse()` on all the children yourself
		recurse(node.object);
		recurse(node.property);
		// or use `walker.checkProps` to walk all child properties (also takes care of arrays)
		walker.checkProps(node, recurse);
	},
	default: function (recurse, stop) {
		// call or throw `stop` to completely stop walking.
		stop();
		throw stop;
	}
}, offset);
// when offset is set, will only recurse to nodes that lie within the offset
// esprima option {range: true} needs to be set for this to work

License

LGPL-3.0

Keywords

FAQs

Package last updated on 16 Jun 2015

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc