f
isDenoCompiledBinary(): boolean
hasDeno?: boolean,
execPath?: string
True when running inside a deno compiled binary (vs deno run script.ts or
plain Node). Detection is on process.execPath: under deno run it ends with
deno (or deno.exe on Windows); inside a compiled binary it's the user's
binary name. Deno.mainModule looked tempting but is also a file: URL in
compiled binaries (a virtual path under /tmp/deno-compile-<name>/), so it
can't differentiate the two.
f
runUserModule(): Task<void, UserScriptFailedFailure>
modulePath: string,
params: unknown,
scriptPosition: string
Dynamically imports modulePath and calls its default export with params.
T
UserScriptFailedFailure = Failure.Of<UserScriptFailed>
The one failure runUserModule declares.
v
UserScriptFailed
A user-supplied --before/--after script threw, or could not be imported.
Usage
import * as mod from "lib/utils/run-user-module.ts";