INNER CODE UNIT · TypeScript

runMain

nodejs/corepack · sources/main.ts:48

export async function runMain(argv: Array<string>) {
  const engine = new Engine();

  const [firstArg, ...restArgs] = argv;
  const request = getPackageManagerRequestFromCli(firstArg, engine);

  if (!request) {
    // If the first argument doesn't match any supported package manager, we fallback to the standard Corepack CLI
    const cli = new Cli({
      binaryLabel: `Corepack`,
      binaryName: `corepack`,
      binaryVersion: corepackVersion,
    });

    cli.register(Builtins.HelpCommand);
    cli.register(Builtins.VersionCommand);

    cli.register(CacheCommand);

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…