https://github.com/vweevers/fs-read-chunk
Read n bytes of an fd or file
https://github.com/vweevers/fs-read-chunk
Last synced: about 1 year ago
JSON representation
Read n bytes of an fd or file
- Host: GitHub
- URL: https://github.com/vweevers/fs-read-chunk
- Owner: vweevers
- License: mit
- Created: 2016-12-19T20:41:09.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2020-12-11T17:47:57.000Z (over 5 years ago)
- Last Synced: 2025-03-28T21:39:05.655Z (about 1 year ago)
- Language: JavaScript
- Size: 1.95 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: LICENSE
Awesome Lists containing this project
README
# fs-read-chunk
**Read n bytes of an fd or file.**
[](https://www.npmjs.org/package/fs-read-chunk) [](https://www.npmjs.org/package/fs-read-chunk) [](http://travis-ci.org/vweevers/fs-read-chunk) [](https://ci.appveyor.com/project/vweevers/fs-read-chunk) [](https://david-dm.org/vweevers/fs-read-chunk)
## example
```js
const readChunk = require('fs-read-chunk')
readChunk('readme.md', 0, 15, function (err, chunk) {
console.log(chunk.toString()) // '# fs-read-chunk'
})
```
## `readChunk(mixed, pos, length, callback)`
Where `mixed` is either a filename or a file descriptor.
## install
With [npm](https://npmjs.org) do:
```
npm install fs-read-chunk
```
## license
[MIT](http://opensource.org/licenses/MIT) © Vincent Weevers