# fs-read-exactly

> Read exactly n bytes of an fd or file

Latest version **1.0.0** (published 2016-12-19) · MIT license · 0 weekly downloads

## Install

```sh
npm install fs-read-exactly
pnpm add fs-read-exactly
yarn add fs-read-exactly
bun add fs-read-exactly
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2016-12-19 |
| First published | 2016-12-19 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=4.0.0 |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Vincent Weevers |
| Maintainers | vweevers |
| Keywords | chunk, fs, read |

## Links

- npm: https://www.npmjs.com/package/fs-read-exactly
- Repository: https://github.com/vweevers/fs-read-exactly
- Issues: https://github.com/vweevers/fs-read-exactly/issues
- npm.io page: https://npm.io/package/fs-read-exactly

## Dependencies (1)

- [fs-lotus](https://npm.io/package/fs-lotus.md) ~1.0.1

## Alternatives

- [unionfs](https://npm.io/package/unionfs.md) — 2.2M weekly downloads
- [path-starts-with](https://npm.io/package/path-starts-with.md) — 35.9K weekly downloads
- [redzip](https://npm.io/package/redzip.md) — 1.2K weekly downloads
- [vscode-anymatch](https://npm.io/package/vscode-anymatch.md) — 848 weekly downloads
- [@ledgerhq/coin-filecoin](https://npm.io/package/@ledgerhq/coin-filecoin.md) — 793 weekly downloads

## Recent versions

- 1.0.0 (latest) — 2016-12-19

## README

# fs-read-exactly

**Read exactly n bytes of an fd or file**

[![npm status](http://img.shields.io/npm/v/fs-read-exactly.svg?style=flat-square)](https://www.npmjs.org/package/fs-read-exactly) [![node](https://img.shields.io/node/v/fs-read-exactly.svg?style=flat-square)](https://www.npmjs.org/package/fs-read-exactly) [![Travis build status](https://img.shields.io/travis/vweevers/fs-read-exactly.svg?style=flat-square&label=travis)](http://travis-ci.org/vweevers/fs-read-exactly) [![AppVeyor build status](https://img.shields.io/appveyor/ci/vweevers/fs-read-exactly.svg?style=flat-square&label=appveyor)](https://ci.appveyor.com/project/vweevers/fs-read-exactly) [![Dependency status](https://img.shields.io/david/vweevers/fs-read-exactly.svg?style=flat-square)](https://david-dm.org/vweevers/fs-read-exactly)

## example

```js
const readExactly = require('fs-read-exactly')

readExactly('readme.md', 0, 15, function (err, chunk) {
  console.log(err) // null
  console.log(chunk.toString()) // '# fs-read-exact'
})

readExactly('readme.md', 0, 1e4, function (err, chunk) {
  console.log(err.code) // 'EOF'
})
```

## `readExactly(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-exactly
```

## license

[MIT](http://opensource.org/licenses/MIT) © Vincent Weevers

---
_Source: https://npm.io/package/fs-read-exactly · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
