asttv - abstract syntax tree to value
What does it do?
It converts abstract syntax tree nodes to values, e.g.
type: 'ArrayExpression' elements: type: 'Literal' value: 1 type: 'Literal' value: 2 type: 'Literal' value: 3 type: 'Literal' value: 4 type: 'Literal' value: 5
would be converted to:
1 2 3 4 5
Installation
npm install asttv
Usage
const value = console // 42
What works?
Array, Boolean, Error, Infinity, Map, NaN, Number, Object, RegExp, Set, String, Symbol, WeakMap, WeakSet, undefined, null
Contributions are welcome.