Make an optional import function bound to the caller's import.meta.
import.meta
import.meta from the caller's context
function to log if the module is not found
the optional import function
const optionalImport = makeOptionalImport(import.meta);// undefined only if chalk is NOT INSTALLED -- if chalk is installed but throws or has a// missing dependency of its own, that error propagatesconst chalk = await optionalImport("chalk"); Copy
const optionalImport = makeOptionalImport(import.meta);// undefined only if chalk is NOT INSTALLED -- if chalk is installed but throws or has a// missing dependency of its own, that error propagatesconst chalk = await optionalImport("chalk");
Make an optional import function bound to the caller's
import.meta.