MCPcopy
hub / github.com/brunch/brunch / require

Function require

test/fixtures/public/javascripts/app.js:50–61  ·  view source on GitHub ↗
(name, root)

Source from the content-addressed store, hash-verified

48 };
49
50 var require = function(name, root) {
51 var path = expand(root, name);
52 var fullPath;
53
54 if (fullPath = getFullPath(path, true)) {
55 return cache[fullPath];
56 } else if (fullPath = getFullPath(path, false)) {
57 return cacheModule(name, fullPath, modules[fullPath]);
58 } else {
59 throw new Error("Cannot find module '" + name + "'");
60 }
61 };
62
63 var dirname = function(path) {
64 return path.split('/').slice(0, -1).join('/');

Callers 15

cacheModuleFunction · 0.70
app.jsFile · 0.70
createFunction · 0.50
buildFunction · 0.50
watch.jsFile · 0.50
serve.jsFile · 0.50
customFileServerMethod · 0.50
cli.jsFile · 0.50
init-skeleton.jsFile · 0.50
run-cli.jsFile · 0.50
hmr.jsFile · 0.50
modules.jsFile · 0.50

Calls 3

expandFunction · 0.70
getFullPathFunction · 0.70
cacheModuleFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…