babel/packages/babel-generator
kpdecker 94e7e4da8e Update source map handling to be reentrant
Rather than repeating the original location when we exit a node, we need to restore the previous parent’s original line location, since the source map format denotes the start location.
2015-12-18 01:11:32 -06:00
..
2015-12-16 12:24:45 -08:00
2015-10-29 19:28:05 -07:00

babel-generator

Turns an AST into code.

Install

$ npm install babel-generator

Usage

import {parse} from 'babylon';
import generate from 'babel-generator';

const code = 'class Example {}';
const ast = parse(ast);

const output = generate(ast, { /* options */ }, code);