You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
constfoo=require('./subfolder/foo.js')console.log('foo "%s"',foo)// "foo"// now grab the "module" wrapper around './foo.js'constfooModule=require.cache[require.resolve('./subfolder/foo.js')]console.log('foo module',fooModule)// load module ./bar relative to ./foo// real path to './bar' is './subfolder/bar'constbar=fooModule.require('./bar')console.log('bar "%s"',bar)// "bar"
The text was updated successfully, but these errors were encountered:
https://github.com/LeCoupa/awesome-cheatsheets/blob/master/backend/node.js#L77 should be more like
The text was updated successfully, but these errors were encountered: