UNPKG

unbundle

Version:

`require()` and `import`/`export` in the browser, without the bundling

10 lines (8 loc) 264 B
import {createWriteStream} from 'fs' import streamToPromise from 'stream-to-promise' export async function write (data, path) { const stream = createWriteStream(path) const promise = streamToPromise(stream) stream.end(data, 'utf8') return await promise }