Skip to content

Use this tool to dump a visual description of your server-side objects in node.js.

Notifications You must be signed in to change notification settings

figital/cfdump.js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 

Repository files navigation

#cfdump.js

I use cfdump.js to dump my Javascript objects to the browser when using node.js ....

Screenshot

Usage:

<script src="https://gist.github.com/1126635.js?file=cfdump-demo.js"></script>

https://gist.github.com/1126635

// cfdump.js demo 

var http = require('http');
var dump = require('cfdump').dump;
var port = 1337;
var host = "localhost";

function listener(request, response) {
	
	test = {
		port : port,
		host : host,
		listener : listener
	}	
	
	console.log('BEGIN ----------------------------');
	console.log('URI: ' + request.url);
	
	body = '<h3>Hello World</h3>';
	body += 'Dump test object:';
	body += dump(test);
	
	response.writeHead(200, {'Content-Type': 'text/html'});
	
	response.end(body);
	
	console.log('END ------------------------------');

}

http.createServer(listener).listen(port, host);

console.log('Server running at http://' + host + ':' + port);

That's about it.

NOTE: Actual function borks on plenty of objects. This is just a quick wrapper. The client-side CSS, etc is probably from 2003.

About

Use this tool to dump a visual description of your server-side objects in node.js.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published