pretty-format-ast
pretty-format2 plugin to print ASTs prettier
Last updated 9 years ago by thejameskyle .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install pretty-format-ast 
SYNC missed versions from official npm registry.

pretty-format-ast

pretty-format2 plugin to print ASTs prettier

Installation

yarn add pretty-format pretty-format-ast

Usage

const prettyFormat2 = require('pretty-format2');
const prettyFormatAST = require('pretty-format-ast');

prettyFormat2(val, {
  plugins: [prettyFormatAST],
})
Node "FunctionDeclaration"
  __clone: [Function __clone]
  async: false
  body: Node "BlockStatement" (1:29, 1:31)
    body: Array []
    directives: Array []
  expression: false
  generator: false
  id: Node "Identifier" (1:9, 1:10)
    name: "a"
  params: Array [
    Node "Identifier" (1:11, 1:18)
      name: "b"
      typeAnnotation: Node "TypeAnnotation" (1:12, 1:18)
        typeAnnotation: Node "StringLiteralTypeAnnotation" (1:14, 1:18)
          extra: Object {
            "raw": "\"hi\"",
            "rawValue": "hi",
          }
          value: "hi",
    Node "Identifier" (1:20, 1:21)
      name: "c",
    Node "RestElement" (1:23, 1:27)
      argument: Node "Identifier" (1:26, 1:27)
        name: "d",
  ]

Current Tags

  • 1.0.1                                ...           latest (9 years ago)

2 Versions

  • 1.0.1                                ...           9 years ago
  • 1.0.0                                ...           9 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (1)
Dev Dependencies (2)
Dependents (1)

Copyright 2013 - present © cnpmjs.org | Home |