add require.cache

This commit is contained in:
Ryan Dahl 2010-10-07 09:58:08 -07:00
parent 3d4e4d8909
commit 54e844cf08
2 changed files with 5 additions and 0 deletions

View File

@ -3243,6 +3243,10 @@ a directory.
paths onto it, or at startup with the `NODE_PATH` environmental
variable (which should be a list of paths, colon separated).
The second time `require('foo')` is called, it is not loaded again from
disk. It looks in the `require.cache` object to see if it has been loaded
before.
## Addons

View File

@ -268,6 +268,7 @@ var module = (function () {
require.extensions = extensions;
// TODO: Insert depreciation warning
require.registerExtension = registerExtension;
require.cache = moduleCache;
var dirname = path.dirname(filename);