vlad 6f123ff03e 18.07 | %!s(int64=6) %!d(string=hai) anos | |
---|---|---|
.. | ||
node_modules | %!s(int64=6) %!d(string=hai) anos | |
index.js | %!s(int64=6) %!d(string=hai) anos | |
license | %!s(int64=6) %!d(string=hai) anos | |
package.json | %!s(int64=6) %!d(string=hai) anos | |
readme.md | %!s(int64=6) %!d(string=hai) anos |
Read a chunk from a file
Because the built-in way requires way too much boilerplate.
$ npm install read-chunk
const readChunk = require('read-chunk');
// foo.txt => hello
readChunk.sync('foo.txt', 1, 3);
//=> 'ell'
Returns a Promise<Buffer>
.
Returns a Buffer
.
Type: string
Type: number
Position to start reading.
Type: number
Number of bytes to read.
MIT © Sindre Sorhus