new api that emits data rather than writing files directly