How to use the taskgroup.Task function in taskgroup

To help you get started, we’ve selected a few taskgroup 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 bevry / kava / source / tester.js View on Github external
function test(opts) {
	const { expected, script, reporter } = opts
	return new Task(function(complete) {
		// Prepare
		const expectedCleaned = expected.trim()

		// Test Reporter
		let output = ''
		const env = { KAVA_REPORTER: reporter, ...process.env }
		const args = [script, '--no-colors']
		const str = args.join(' ')
		process.stdout.write(sep(str.length, '=') + '\n' + str + '\n\n')
		const runner = spawn('node', args, { env })
		runner.stdout.on('data', function(data) {
			output += data
			process.stdout.write(data)
		})
		runner.stderr.on('data', function(data) {
			output += data

taskgroup

Group together synchronous and asynchronous tasks and execute them with support for concurrency, naming, and nesting.

Artistic-2.0
Latest version published 7 months ago

Package Health Score

61 / 100
Full package analysis