{"library":"pretty-format-ast","title":"pretty-format-ast","description":"A plugin for pretty-format2 that prints Abstract Syntax Trees (ASTs) in a human-readable, indented format. Version 1.0.1 is the current stable release. It provides a structured view of AST nodes with their properties, types, and positions. Compared to alternatives like util.inspect, it produces a much more concise and visually organized output, specifically designed for AST inspection. The package works with any AST that follows a similar node structure and requires pretty-format2 as a peer dependency.","language":"javascript","status":"active","last_verified":"Sat Apr 25","install":{"commands":["npm install pretty-format-ast"],"cli":null},"imports":["import prettyFormatAST from 'pretty-format-ast'","import prettyFormat2 from 'pretty-format2'","prettyFormat2(val, { plugins: [prettyFormatAST] })"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"const prettyFormat2 = require('pretty-format2');\nconst prettyFormatAST = require('pretty-format-ast');\n\nconst ast = {\n  type: 'Program',\n  body: [\n    {\n      type: 'ExpressionStatement',\n      expression: { type: 'Literal', value: 42 },\n    },\n  ],\n};\n\nconsole.log(prettyFormat2(ast, { plugins: [prettyFormatAST] }));\n// Output:\n// Node \"Program\"\n//   body: Array [\n//     Node \"ExpressionStatement\"\n//       expression: Node \"Literal\"\n//         value: 42,\n//   ]","lang":"javascript","description":"Demonstrates basic usage: import pretty-format2 and pretty-format-ast, then format a simple AST object with the plugin.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}