sigmaSd / js-dbg

A module that exports javascript `dbg` fuction just like rust `dbg!` macro

Home Page:https://jsr.io/@sigma/dbg

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Debug

This module exports a single function dbg that prints a variable and return it.

Its taken from rust dbg! macro. The nice thing about it that it can be inserted anywhere, see below for an example.

This is very useful for debugging.

Examples

Example 1

import { dbg } from "@sigma/dbg";

// the nice thing is that `dbg` can be inserted anywhere
let value = fn2(dbg(fn1()));

// output: var = 4

About

A module that exports javascript `dbg` fuction just like rust `dbg!` macro

https://jsr.io/@sigma/dbg

License:MIT License


Languages

Language:TypeScript 100.0%