0.1.8 • Published 5 months ago
@trenskow/atomic-write-stream v0.1.8
@trenskow/atomic-write-stream
A writeable file stream that writes atomically.
Usage
Usage is works in exactly the same way as Node's build-in createWriteStream
except it writes atomically and supports some options.
import createAtomicWriteStream from '@trenskow/atomic-write-stram';
const stream = createAtomicWriteStream('hello.txt', {
tmpDirectory: '/some/tmp/directory' /* defaults to `os.tmpdir()`. */
});
stream.write('Hello, World!');
stream.end();
LICENSE
See license in LICENSE.