How to use p-progress - 1 common examples

To help you get started, we’ve selected a few p-progress 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 JonnyBurger / make-space / index.js View on Github external
module.exports = async input => {
	if (typeof input !== 'string') {
		throw new TypeError(`Expected a string, got ${typeof input}`);
	}
	const spinner = ora('Finding ways to free up space... 0%');
	spinner.start();
	const sizes = await pProgress
		.all(
			strategies.map(strategy => {
				return strategy.probe();
			})
		)
		.onProgress(progress => {
			spinner.text = `Finding ways to free up space... ${percentage(progress)}`;
		});
	spinner.stop();
	const probeSorted = sortBy(
		zip(strategies, sizes).map(([strategy, size]) => ({
			strategy,
			size
		})),
		p => 0 - p.size
	);

p-progress

Create a promise that reports progress

MIT
Latest version published 1 year ago

Package Health Score

54 / 100
Full package analysis

Popular p-progress functions