How to use the ora.promise function in ora

To help you get started, we’ve selected a few ora 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 bitpshr / caster / index.js View on Github external
(async function() {
	// Intro logging
	console.log(`\n${figlet.textSync('CASTER')}\n`);

	try {
		// Collect user configuration
		const config = sanitizeInput(await collectInput());
		console.log('');

		// Generate project structure
		const generation = generateStructure(config);
		ora.promise(generation, { text: 'Generating project structure' });
		await generation;

		// Install project dependencies
		const installation = execute('npm install', config.name);
		ora.promise(installation, { text: 'Installing project dependencies' });
		await installation;

		// Success outro logging
		console.log(
			`\n  ${chalk.bold(chalk.green('Success!'))} Generated ${config.name} at ${path.resolve(config.name)}.`
		);
		console.log('  The following commands are available within that directory:\n');
		config.tech.js && console.log(`  ${chalk.cyan('npm run test')}            Runs JavaScript unit tests`);
		config.tech.js && console.log(`  ${chalk.cyan('npm run eslint')}          Lints JavaScript files`);
		config.tech.css && console.log(`  ${chalk.cyan('npm run stylelint')}       Lints CSS files`);
		console.log(`  ${chalk.cyan('npm run prettier')}        Format files`);
github ottomatica / Baker / lib / modules / spinner.js View on Github external
static async spinPromise(promise, text, spinner, stream = process.stdout) {
        ora.promise(promise, {
            text: text,
            spinner: spinner,
            stream: stream
            // color: false,
            // enabled: true
        });
        return promise;
    }
}
github frontity / frontity / packages / frontity / src / actions / create.ts View on Github external
emitter.on("create", (message, action) => {
    if (action) ora.promise(action, message);
    else console.log(message);
  });
github jalalazimi / react-library-generator / lib / library-genrator.js View on Github external
}

  {
    const promise = mergeFiles(path.join(dest, name, 'package.json'), {
      name,
      description,
      author,
      license
    }, [ { value: pkg, pattern: '\\$packageManager' } ])
    ora.promise(promise, messageLogger(4, 'gear', `Project configurations..`))
    await promise
  }

  {
    const promise = execShPromise(`cd ${name} && ${pkg} install `, true)
    ora.promise(promise, messageLogger(5, 'truck', `Installing packages..`))
    await promise
  }
  console.log('')
}
github frontity / frontity / packages / frontity / src / actions / subscribe.ts View on Github external
emitter.on("subscribe", (message, action) => {
    if (action) ora.promise(action, message);
    else console.log(message);
  });
github freesewing / freesewing / packages / create-freesewing-pattern / lib / create-library.js View on Github external
{
    const promise = pEachSeries(files, async file => {
      return module.exports.copyTemplateFile({
        file,
        source,
        dest,
        info
      });
    });
    ora.promise(promise, `Copying ${template} template to ${dest}`);
    await promise;
  }

  {
    const promise = module.exports.initPackageManager({ dest, info });
    ora.promise(promise, `Running ${manager} install and ${manager} link`);
    await promise;
  }

  if (git) {
    const promise = module.exports.initGitRepo({ dest });
    ora.promise(promise, "Initializing git repo");
    await promise;
  }

  return dest;
};
github freesewing / freesewing / packages / create-freesewing-pattern / lib / create-library.js View on Github external
info
      });
    });
    ora.promise(promise, `Copying ${template} template to ${dest}`);
    await promise;
  }

  {
    const promise = module.exports.initPackageManager({ dest, info });
    ora.promise(promise, `Running ${manager} install and ${manager} link`);
    await promise;
  }

  if (git) {
    const promise = module.exports.initGitRepo({ dest });
    ora.promise(promise, "Initializing git repo");
    await promise;
  }

  return dest;
};
github ovh / manager / scripts / release / index.js View on Github external
Promise.prototype.logging = function logging(opts) {
  ora.promise(this, opts);
  return this;
};
github Hermanya / create-react-hook / lib / create-library.js View on Github external
info
      })
    })
    ora.promise(promise, `Copying ${template} template to ${dest}`)
    await promise
  }

  {
    const promise = module.exports.initPackageManager({ dest, info })
    ora.promise(promise, `Running ${manager} install and ${manager} link`)
    await promise
  }

  if (gitInit) {
    const promise = module.exports.initGitRepo({ dest })
    ora.promise(promise, 'Initializing git repo')
    await promise
  }

  return dest
}

ora

Elegant terminal spinner

MIT
Latest version published 20 days ago

Package Health Score

91 / 100
Full package analysis