node package manager
Easy sharing. Manage teams and permissions with one click. Create a free org ยป

node-source

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

Author: Sam Shull
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