MCPcopy
hub / github.com/infinitered/gluegun / loadModule

Function loadModule

src/loaders/module-loader.ts:5–15  ·  view source on GitHub ↗
(path)

Source from the content-addressed store, hash-verified

3
4// try loading this module
5export function loadModule(path) {
6 if (strings.isBlank(path)) {
7 throw new Error('path is required')
8 }
9 if (filesystem.isNotFile(path)) {
10 throw new Error(`${path} is not a file`)
11 }
12
13 require.resolve(path)
14 return require(path)
15}

Callers 3

loadCommandFromFileFunction · 0.90
loadExtensionFromFileFunction · 0.90

Calls 2

isBlankMethod · 0.80
isNotFileMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…