From 2f1c119550f3ef6213a8ce1446811e8c386ef175 Mon Sep 17 00:00:00 2001 From: mon-jai <91261297+mon-jai@users.noreply.github.com> Date: Tue, 13 Feb 2024 03:56:10 +0800 Subject: [PATCH] chore: simplify ESM `execute` example (#942) * chore: simplify ESM `execute` example * Fix import issues --- src/execute.ts | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/src/execute.ts b/src/execute.ts index 767d1735b..3ec729142 100644 --- a/src/execute.ts +++ b/src/execute.ts @@ -13,23 +13,17 @@ import {settings} from './settings' * @example For ESM dev.js * ``` * #!/usr/bin/env -S node --loader ts-node/esm --no-warnings=ExperimentalWarning - * async function main() { - * const oclif = await import('@oclif/core') - * await oclif.execute({development: true, dir: import.meta.url}) - * } + * import { execute } from "@oclif/core" * - * await main() + * await execute({development: true, dir: import.meta.url}) * ``` * * @example For ESM run.js * ``` * #!/usr/bin/env node - * async function main() { - * const oclif = await import('@oclif/core') - * await oclif.execute({dir: import.meta.url}) - * } + * import { execute } from "@oclif/core" * - * await main() + * await execute({dir: import.meta.url}) * ``` * * @example For CJS dev.js