Skip to content

This babel plugin creates a log statement on your functions

License

Fimba-Code/babel-logger-plugin

babel-logger-plugin 🔍

This babel plugins hacks into your functions by using $log key and adds a console.log() statement with your return value. Here is how:

function sum(a, b) { $log; const result = a + b; return result; } add(2, 3);       function sum(a, b) { const result = a + b; console.log("Final Result 😛 ==> ", result); return result; } add(2, 3);

Installation

$ npm install @codefimba/babel-logger-plugin --save-dev or $ yarn add -D @codefimba/babel-logger-plugin

The solution requires you to have babel installed in your project.

Usage

Via .babelrc or babel-loader.

{ plugins: ["@codefimba/babel-logger-plugin"] }

Contributing

Pull requests are most welcome!

Authors

See also the list of contributors who participated in this project.

About

This babel plugin creates a log statement on your functions

Topics

Resources

License

Code of conduct

Contributing

Stars

Watchers

Forks

Contributors 2

  •  
  •