Skip to content

Instantly share code, notes, and snippets.

@RyadPasha
Created August 1, 2023 16:02
Show Gist options
  • Save RyadPasha/261dfe6e3bcf5716412632180f052c7f to your computer and use it in GitHub Desktop.
Save RyadPasha/261dfe6e3bcf5716412632180f052c7f to your computer and use it in GitHub Desktop.
Printing a circular structure in a JSON-like format
import util from 'util' // In TS
// Or
import { inspect } from 'util' // Directly (TS)
// Or
const util = require('util') // In JS
// Or
const { inspect } = require('util') // Directly (JS)
// Then:
console.log(util.inspect(request)) // Or `console.log(inspect(request))` in case you directly imported it
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment