Printer
EasyPrint prints Babel AST to readable JavaScript.
- ☝️ Similar to Recast, but simpler and easier in maintenance, since it supports only Babel.
- ☝️ As opinionated as Prettier, but has more user-friendly output and works directly with AST.
- ☝️ Like ESLint but without any configuration and plugins 🤷, also works directly with Babel AST only.
Install
npm i @putout/printer
API
const {print} = require('@putout/printer');
const {parse} = require('@babel/parser');
const ast = parse('const a = (b, c) => {const d = 5; return a;}');
print(ast);
`
const a = (b, c) => {
const d = 5;
return a;
};
`;
License
MIT