Socket
Socket
Sign inDemoInstall

pretty-format-ast

Package Overview
Dependencies
4
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    pretty-format-ast

pretty-format2 plugin to print ASTs prettier


Version published
Weekly downloads
741
increased by9.94%
Maintainers
1
Install size
72.2 kB
Created
Weekly downloads
 

Readme

Source

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",
  ]

FAQs

Last updated on 08 Sep 2017

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc