0.0.1 • Published 8 years ago

first-chunk v0.0.1

Weekly downloads
4
License
MIT
Repository
github
Last release
8 years ago

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