Created
August 25, 2011 05:59
-
-
Save mashihua/1170079 to your computer and use it in GitHub Desktop.
All built-in function and javascript source in Node.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env node | |
//all built-in module and lib/*.js,expcept node.js | |
['constants','io_watcher','timer','buffer','cares','child_process','evals','fs','net','http_parser','signal_watcher','stdio','os'].forEach(function(v){ | |
console.log('built-in module:\t' + v); | |
console.dir(require('sys').inspect(process.binding(v))); | |
}); | |
console.log('all javascript from built-in module natives,expect node.js'); | |
var sources = process.binding('natives'); | |
Object.keys(sources).forEach(function(key){ | |
console.log('\n\n**************************************************') | |
console.log('Source of lib/' + key + '.js'); | |
console.log('**************************************************\n\n') | |
console.log(sources[key]); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Please explain above code and what it does ?
I want to get all built-in functions in node js using terminal cmd, so plz help me