$ npm install read-chunk
Read a chunk from a file
Because the built-in way requires way too much boilerplate.
npm install read-chunk
import {readChunk} from 'read-chunk';
// foo.txt => hello
await readChunk('foo.txt', {length: 3, startPosition: 1});
//=> 'ell'
Returns a Promise<Uint8Array>
with the read chunk.
Returns a Uint8Array
with the read chunk.
Type: string
Type: number
The number of bytes to read.
Type: number
The position to start reading from.
© 2010 - cnpmjs.org x YWFE | Home | YWFE