How to export all children of all selected artboards in an async manner

const folder = await fs.getFolder();
	const artboards = selection.items.filter(node => node instanceof scenegraph.Artboard);
	const arr = await artboards.reduce(async (all, ab) => {
		const currentTask = ab.children.map(async item => {
			const file = await folder.createFile(`${item.guid}.png`);
			let obj = {};
			obj.node = item;
			obj.outputFile = file;
			obj.type = 'png';
			obj.scale = 2;
			return obj;
		});
                const current = await Promise.all(currentTask);
		return (await all).concat(current);
	}, []);
	const renditions = await Promise.all(arr);
	await application.createRenditions(renditions);
3 Likes