@robinpath/debug
v0.1.1
Published
Debugging utilities: inspect, timing, counters, logging, memory profiling, value comparison, ASCII tables
Readme
@robinpath/debug
Debugging utilities: inspect, timing, counters, logging, memory profiling, value comparison, ASCII tables
Why use this module?
The debug module lets you:
- Deep inspect a value
- Get detailed type
- Start a timer
- End timer and get duration
- Pass value through with timing
All functions are callable directly from RobinPath scripts with a simple, consistent API.
Installation
npm install @robinpath/debugQuick Start
No credentials needed — start using it right away:
debug.typeOf $dataAvailable Functions
| Function | Description |
|----------|-------------|
| debug.inspect | Deep inspect a value |
| debug.typeOf | Get detailed type |
| debug.timeStart | Start a timer |
| debug.timeEnd | End timer and get duration |
| debug.timeit | Pass value through with timing |
| debug.count | Increment counter |
| debug.countReset | Reset counter |
| debug.countGet | Get counter value |
| debug.log | Add debug log entry |
| debug.getLogs | Get debug logs |
| debug.clearLogs | Clear debug logs |
| debug.assert | Assert condition |
| debug.trace | Get stack trace |
| debug.memory | Get memory usage |
| debug.sizeof | Estimate value memory size |
| debug.diff | Compare two values |
| debug.freeze | Deep freeze object |
| debug.clone | Deep clone value |
| debug.table | Format as ASCII table |
| debug.dump | Pretty-print value |
Examples
Get detailed type
debug.typeOf $dataStart a timer
debug.timeStart "fetch"End timer and get duration
debug.timeEnd "fetch"Integration with RobinPath
import { RobinPath } from "@wiredwp/robinpath";
import Module from "@robinpath/debug";
const rp = new RobinPath();
rp.registerModule(Module.name, Module.functions);
rp.registerModuleMeta(Module.name, Module.functionMetadata);
const result = await rp.executeScript(`
debug.typeOf $data
`);Full API Reference
See MODULE.md for complete documentation including all parameters, return types, error handling, and advanced examples.
Related Modules
@robinpath/json— JSON module for complementary functionality
License
MIT
