How to use loud-rejection - 5 common examples

To help you get started, we’ve selected a few loud-rejection examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github pikapkg / pack / checkpoint / dist-src / index.js View on Github external
export async function main({ startArgs, args, endArgs, }) {
    const version = getVersion();
    loudRejection();
    handleSignals();
    // set global options
    commander.version(version, '-v, --version');
    commander.usage('[command] [flags]');
    commander.option('--verbose', 'output verbose messages on internal operations');
    commander.option('--json', 'format Pika log messages as lines of JSON (see jsonlines.org)');
    // commander.option('--force', 'install and build packages even if they were built before, overwrite lockfile');
    // commander.option('--prod, --production [prod]', '', boolify);
    commander.option('--emoji [bool]', 'enable emoji in output', boolify, process.platform === 'darwin' || process.env.TERM_PROGRAM === 'Hyper' || process.env.TERM_PROGRAM === 'HyperTerm');
    commander.option('-s, --silent', 'skip Pika console logs, other types of logs (script output) will be printed');
    commander.option('--cwd ', 'working directory to use', process.cwd());
    commander.option('--no-progress', 'disable progress bar');
    commander.option('--no-node-version-check', 'do not warn when using a potentially unsupported Node version');
    // if -v is the first command, then always exit after returning the version
    if (args[0] === '-v') {
        console.log(version.trim());
github pikapkg / pack / src / index.ts View on Github external
export async function main({
  startArgs,
  args,
  endArgs,
}: {
  startArgs: Array,
  args: Array,
  endArgs: Array,
}): Promise {
  const version = getVersion();
  loudRejection();
  handleSignals();

  // set global options
  commander.version(version, '-v, --version');
  commander.usage('[command] [flags]');
  commander.option('--verbose', 'output verbose messages on internal operations');
  commander.option('--json', 'format Pika log messages as lines of JSON (see jsonlines.org)');
  // commander.option('--force', 'install and build packages even if they were built before, overwrite lockfile');
  // commander.option('--prod, --production [prod]', '', boolify);
  commander.option(
    '--emoji [bool]',
    'enable emoji in output',
    boolify,
    process.platform === 'darwin' || process.env.TERM_PROGRAM === 'Hyper' || process.env.TERM_PROGRAM === 'HyperTerm',
  );
  commander.option('-s, --silent', 'skip Pika console logs, other types of logs (script output) will be printed');
github yarnpkg / yarn / src / cli / index.js View on Github external
export async function main({
  startArgs,
  args,
  endArgs,
}: {
  startArgs: Array,
  args: Array,
  endArgs: Array,
}): Promise {
  const collect = (val, acc) => {
    acc.push(val);
    return acc;
  };

  loudRejection();
  handleSignals();

  // set global options
  commander.version(version, '-v, --version');
  commander.usage('[command] [flags]');
  commander.option('--no-default-rc', 'prevent Yarn from automatically detecting yarnrc and npmrc files');
  commander.option(
    '--use-yarnrc 
github bustle / shep / src / cli.js View on Github external
export default function cli () {
  loudRejection()

  yargs
    .wrap(120)
    .usage('Usage: $0  [options]')
    .demand(1)
    .commandDir('./commands')
    .version()
    .help()
    .strict()
    .argv
}

loud-rejection

Make unhandled promise rejections fail loudly instead of the default silent fail

MIT
Latest version published 5 years ago

Package Health Score

74 / 100
Full package analysis

Popular loud-rejection functions