Socket
Socket
Sign inDemoInstall

babel-plugin-pretty-console

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

babel-plugin-pretty-console

Use hooks for fast log


Version published
Weekly downloads
14
increased by27.27%
Maintainers
1
Weekly downloads
 
Created
Source

pretty console logo.

babel-plugin-pretty-console

Use hooks for fast console.log

Install

npm install babel-plugin-pretty-console -D

Usage

Configure PrettyConsole to your .babelrc file.

{
  "plugins": ["pretty-console"]
}

Examples

// #
function add(a, b) {
  return a + b;
}

// equals:

function add(a, b) {
  console.log('add:a', a)
  console.log('add:b', b)
  return a + b;
}
// #warn
let a = add(1, 2)

// equals:

let a = add(1, 2)
console.warn(a)
// #error TestFunction
let add = (a, b) => a + b

// equals:

let add = (a, b) => {
  console.error('TestFunction:a', a)
  console.error('TestFunction:b', b)
  return a + b
}

Plugin options

  • token Set hook token used in comments
  • open Set plugin enabled status
  • printFileName Set print filename to console.log

Comments hook options

// token[consoleType] [hookName]

// ex:
// #warn TestFunction

Keywords

FAQs

Package last updated on 11 Jan 2022

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc