node-source

Find the location of a function in the source

npm install node-source
5 downloads in the last month

Find the source script and line number of a function declaration in node

Author:
Repository: http://github.com/samshull/node-source
Issues: http://github.com/samshull/node-source/issues

Warning: this does not work on native functions

Example:


  console.log( require('node-source').source(process.exit) ); 
  // returns { file: 'node.js', line: 167 }

TODO:
Write proper tests
Write proper examples

npm loves you