ndparser

Non-destructive JS parser.

Usage no npm install needed!

<script type="module">
  import ndparser from 'https://cdn.skypack.dev/ndparser';
</script>

README

Ndparser

This package is the CoffeeScript implementation of rocambole, though not 100% compatible, and contains much less feature.

API

ndparser = require 'ndparser'
print = console.log

string =
  '''
    function hello() {
      console.log(3);
    }
  '''

ast = ndparser.parse string
ndparser.walk ast, (node) ->
  print node.depth, node.type

License

MIT