Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

varlog

yigalirani26ISC1.0.5TypeScript support: included

Dump complex js variables and view using drill down interface

dump, log, javascript, drill-down, visualize, node

readme

varlog

Dump and inspect complex JavaScript variables through an interactive drill-down interface, especially valuable for debugging Node.js applications. The interface allows you to:

  • Explore nested objects and arrays
  • Inspect complex data structures
  • View detailed property information
  • Navigate through multiple levels of object hierarchy

Perfect for debugging server-side code and inspecting large data structures in Node.js environments.

Installation

$ npm install varlog

Sample code

const http = require('http');
var varlog = require("varlog");

const server = http.createServer((req, res) => {
    res.statusCode = 200;
    res.setHeader('Content-Type', 'text/html');
    res.end(
        varlog.css+
        varlog.dump('req',req,2)+//2 refers to depth, default is 3
        varlog.dump('res',res)
    );
});

server.listen(80, 'localhost', () => {
  console.log(`Server running`);
});

Screenshot

Screenshot