babel-plugin-log-and-return

0.0.4 • Public • Published

babel-plugin-log-and-return

babel-plugin-log-and-return Build Status v0.0.4

Use an @log decorator to log the expression in the next line

InstallUsageCreated ByLicense

Install

$ npm install --save-dev babel-plugin-log-and-return

Then add the plugin to your .babelrc file or babel configuration in package.json:

"plugins": ["log-and-return"]

Usage

Simply add an @log decorator in a comment above the line you want to log:

// @log
hello('world')

This compiles to something similar to:

_l(hello('world'))

function _l(x) {
  console.log(x)
  return x
}

Created By

License

MIT

Readme

Keywords

none

Package Sidebar

Install

npm i babel-plugin-log-and-return

Weekly Downloads

1

Version

0.0.4

License

MIT

Last publish

Collaborators

  • markachandler