Today, I’m gonna show you how to print your variables for forget about console.log
.
The problem
Assume that you have a variable. What you does to print information? I suppose something like that:
But what if variable name will be changed, or you would need to change the text for log
function.
The Solution
Let me introduce @rslike/dbg
package. This package is a part of the global rslike
repository.
How to install:
Usage:
Easy, isn’t it?
Advanced Usage
What if you would like to use another delimiter between variable name and value?
What if you would like to change log function? That’s easy
You also can handle information by yourself:
Anatomy of dbg
Where message
is a message which you can call with your function.
Here is 2 related packages from @rslike
org:
Cheers