first-chunk

0.0.1 • Public • Published

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

Dependencies (0)

    Dev Dependencies (0)

      Package Sidebar

      Install

      npm i first-chunk

      Weekly Downloads

      2

      Version

      0.0.1

      License

      MIT

      Last publish

      Collaborators

      • elixiao