As a follow up from #3145 we agreed to add a new format that is a superset of the compact format option. Do things that are considered dangerous. e.g. not printing semicolons, or print literal values as opposed to raw values.
babel-core
Babel compiler core.
Install
$ npm install babel-core
Usage
import babel from 'babel-core';
const code = `class Example {}`;
const result = babel.transform(code, { /* options */ });
result.code; // Generated code
result.map; // Sourcemap
result.ast; // AST
For more in depth documentation see: http://babeljs.io/docs/usage/api/