Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/sigmasd/js-dbg
A module that exports javascript `dbg` fuction just like rust `dbg!` macro
https://github.com/sigmasd/js-dbg
dbg debug javascript
Last synced: about 2 months ago
JSON representation
A module that exports javascript `dbg` fuction just like rust `dbg!` macro
- Host: GitHub
- URL: https://github.com/sigmasd/js-dbg
- Owner: sigmaSd
- License: mit
- Created: 2024-03-09T07:53:23.000Z (10 months ago)
- Default Branch: master
- Last Pushed: 2024-09-22T01:01:24.000Z (4 months ago)
- Last Synced: 2024-10-14T12:32:15.523Z (3 months ago)
- Topics: dbg, debug, javascript
- Language: TypeScript
- Homepage: https://jsr.io/@sigma/dbg
- Size: 15.6 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 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**
```ts
import { dbg } from "@sigma/dbg";// the nice thing is that `dbg` can be inserted anywhere
const fn1 = () => 4;
const fn2 = (n: number) => n + 1;
let value = fn2(dbg(fn1()));// output: var = 4
```