1.0.2 • Published 7 years ago

p-temp-stream v1.0.2

Weekly downloads
5
License
MIT
Repository
github
Last release
7 years ago

p-temp-stream

A Writable stream that writes to a teporary file. That tmpfile can then be used in one of 2 ways.

  1. Move the file to another location
  2. Get a Readable stream to retrieve the data

Whatever the case, the tempfile is cleaned up once the data is consumed or by calling cleanup() explicitly.

const tmpstream = TempFileStream();
tmpstream.moveFile(Path.join(__dirname, 'archive')).then(()=>console.log('file moved'));
process.stdin.pipe(tmpstream);
const tmpstream = TempFileStream();
tmpstream.readStream().then((stream)=>stream.pipe(process.stderr));
process.stdin.pipe(tmpstream);
1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago