Skip to content

elixiao/first-chunk

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

get the first chunk of readable stream

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published