INNER CODE UNIT · TypeScript

install

bitjson/typescript-starter · src/cli/tasks.ts:130

export const install = (spawner: typeof execa) => async (
  runner: Runner,
  projectDir: string
) => {
  const opts: Options = {
    cwd: projectDir,
    encoding: 'utf8',
    stdio: 'inherit',
  };
  try {
    runner === Runner.Npm
      ? spawner('npm', ['install'], opts)
      : spawner('yarn', opts);
  } catch (err) {
    // eslint-disable-next-line functional/no-throw-statement
    throw new Error(`Installation failed. You'll need to install manually.`);
  }
};

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…