Skip to content

Instantly share code, notes, and snippets.

@TooTallNate

TooTallNate/foo.js

Forked from mediaupstream/foo.js
Created Aug 15, 2012
Embed
What would you like to do?
Recursive require crashes node
module.exports = foo;
require('./index.js')();
function foo(){
console.log('foo.js', Date.now() );
}
module.exports = index;
require('./foo.js')();
function index(){
console.log('index.js', Date.now());
}
@mediaupstream

This comment has been minimized.

Copy link

@mediaupstream mediaupstream commented Aug 15, 2012

How can I do this:

module.exports = index;

require('./foo.js')();

var index = function(){
  console.log('index.js', Date.now());
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.