esmap

1.2.0 • Public • Published

esmap

Map over esprima nodes conveniently.

Installation

npm install esmap

API

esmap(node, fn(node, key, parent)) -> Node

Maps over the given node's children with the given function. Returns a fresh node.

If a node has a property with an array of children, fn(child, key, node) is called for every child as if they were direct descendants, but the truthy return values are Array#concat'd together. A falsy value is ignored (the node is removed from the array), an array value is concatenated, a non-array value is placed into the array.

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.2.0
    2
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 1.2.0
    2
  • 1.1.0
    1
  • 1.0.1
    1
  • 1.0.0
    1

Package Sidebar

Install

npm i esmap

Weekly Downloads

5

Version

1.2.0

License

MIT

Last publish

Collaborators

  • edef