end-of-stream-ts
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

end-of-stream-ts

Await the completion or error of a stream with typescript definitions

npm i -s end-of-stream-ts
# or
yarn add end-of-stream-ts
import endOfStream from 'end-of-stream';
import {createReadStream} from 'fs';
 
;(async () => {
 
    const stream = createReadStream(__filename);
    stream.on('data', d => console.log(d.toString()));
 
    try {
      await endOfStream(stream);
      console.log('done');
    } catch(e) {
      console.error(e);
    }
 
})();
 

Package based on end-of-stream.

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
1.0.00latest

Version History

VersionDownloads (Last 7 Days)Published
1.0.00

Package Sidebar

Install

npm i end-of-stream-ts

Weekly Downloads

0

Version

1.0.0

License

MIT

Unpacked Size

4.02 kB

Total Files

8

Last publish

Collaborators

  • stefangab95