Skip to content

[I] ResolveModuleHost

File-system operations needed to resolve package and file specifiers without loading their code.

readFile(path): Promise<string>;

Read a utf-8 encoded file.

ParameterType
pathstring

Promise<string>


realpath(path): Promise<string>;

Resolve the real path for the current host.

ParameterType
pathstring

Promise<string>


stat(path): Promise<{
isDirectory: boolean;
isFile: boolean;
}>;

Inspect a path without reading its contents. The result’s isDirectory() and isFile() predicates distinguish package directories from candidate entry-point files. Reject with a host error such as ENOENT for a missing path.

ParameterType
pathstring

Promise<{ isDirectory: boolean; isFile: boolean; }>