1.6.0 • Published 6 years ago

as-buffer v1.6.0

Weekly downloads
147
License
ISC
Repository
github
Last release
6 years ago

Read stream and other types as buffer*

npm version build status coverage status

const read = require('as-buffer');

const stream = fs.createReadStream('./photo.png');

read(stream, { maxsize: 1e6 }) // with a max-size, default to 1e7, 10MiB
	.then(buf => console.log('read', buf))
	.catch(e => console.log('file too large'));

*: exception of object-mode streams that are returned as array

like https://github.com/stream-utils/stream-to-array but simpler

1.6.0

6 years ago

1.5.3

6 years ago

1.5.2

6 years ago

1.5.1

6 years ago

1.5.0

6 years ago

1.4.3

6 years ago

1.4.2

6 years ago

1.4.1

6 years ago

1.4.0

7 years ago

1.3.0

7 years ago

1.2.0

7 years ago