1

Is it possible to get a list of ALL variables (and their values) at that place in a node js script?

Not only like displaying this.

Also globals like this:

var http = require('http'),
util = require('util'),
fs   = require('fs');

And also the super-globals ones like the node js: process or console. Really ALL possible variables at that moment ?

BramscoChill
  • 383
  • 4
  • 17
  • not programmically afaik but a good ide will probably have a debug tool to do something close to what you're asking. Eclipse debugger can do this for java but I've never tried for javascript. – digital-pollution May 18 '18 at 12:23
  • Related: https://stackoverflow.com/questions/2051678/getting-all-variables-in-scope – TGrif May 18 '18 at 21:51
  • I'd REALLY like to know the answer to this. Starting to get pretty good at Node, but I'm coming from the PHP world and some things are just kind of dumb in Node. – Netside Jul 13 '20 at 03:22
  • In PHP you could just do "print_r($GLOBALS);" or even "print_r($POST);" and it'll print everything in the whole script, or in all the POST requests. Node just seems to make this stuff unnecessarily hard. – Netside Jul 13 '20 at 03:23

0 Answers0