Skip to content

Instantly share code, notes, and snippets.

@nevir
Created August 27, 2011 02:50
Show Gist options
  • Select an option

  • Save nevir/1174898 to your computer and use it in GitHub Desktop.

Select an option

Save nevir/1174898 to your computer and use it in GitHub Desktop.
NevBook:lib ian$ cat outer.js
console.log(require('./inner.js')());
NevBook:lib ian$ cat inner.js
module.exports = function() {
return __filename;
}
NevBook:lib ian$ node outer.js
/Users/ian/Coding/node-autorequire/lib/inner.js
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment