1.2.0 • Published 9 months ago

@d-zero/dealer v1.2.0

Weekly downloads
-
License
MIT
Repository
-
Last release
9 months ago

Dealer

Dealer is an API and CLI that processes a given collection in parallel and logs the output in sequence to the standard output.

Install

npm install @d-zero/dealer

API

import { deal } from '@d-zero/dealer';

await deal(items, {
	limit: 30,
	header: (progress, done, total, limit) =>
		progress === 1
			? 'HeaderMessage: Done!'
			: `HeaderMessage: %earth% %dots% %block% %propeller%`,
	setup: (item, update, index) => {
		item.setup();
		item.addListeners((state) => {
			update(`item(${index}): ${state}`);
		});

		return async () => {
			await item.start();
			item.cleanup();
		};
	},
});
1.2.0

9 months ago

1.1.0

10 months ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago

1.0.0-alpha.2

1 year ago

1.0.0-alpha.1

1 year ago