first-chunk
v0.0.1
Published
get the first chunk of readable stream
Downloads
3
Readme
first-chunk
get the first chunk of readable stream
Install
npm install first-chunk --save
yarn add first-chunk
Usage
const firstChunk = require('first-chunk')
const options = {
encoding: 'utf8',
size: 12 // defaults to 16384 (16kb)
}
firstChunk('path/to/file', options)
.then(data => {
console.log(data)
})
.catch(e => {
console.log(e)
})
License
MIT