# linecount

> Count number of lines in a file or stream

Latest version **1.0.1** (published 2016-12-08) · MIT license · 0 weekly downloads

## Install

```sh
npm install linecount
pnpm add linecount
yarn add linecount
bun add linecount
```

## 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.1 |
| Published | 2016-12-08 |
| First published | 2016-12-08 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Espen Hovlandsdal |
| Maintainers | rexxars |
| Keywords | line, count |

## Links

- npm: https://www.npmjs.com/package/linecount
- Repository: https://github.com/rexxars/linecount
- Homepage: https://github.com/rexxars/linecount#readme
- Issues: https://github.com/rexxars/linecount/issues
- npm.io page: https://npm.io/package/linecount

## Dependencies (2)

- [split2](https://npm.io/package/split2.md) ^2.1.0
- [is-stream](https://npm.io/package/is-stream.md) ^1.1.0

## Alternatives

- [localforage](https://npm.io/package/localforage.md) — 6.2M weekly downloads
- [localforage-observable](https://npm.io/package/localforage-observable.md) — 30.8K weekly downloads
- [@y/y](https://npm.io/package/@y/y.md) — 30.1K weekly downloads
- [@metaobjectsdev/render](https://npm.io/package/@metaobjectsdev/render.md) — 3.5K weekly downloads
- [@ledgerhq/coin-algorand](https://npm.io/package/@ledgerhq/coin-algorand.md) — 1.1K weekly downloads

## Recent versions

- 1.0.1 (latest) — 2016-12-08
- 1.0.0 — 2016-12-08

## README

# linecount

Counts number of lines in a file (or a stream)

## Installation

```
npm install --save linecount
```

## Usage

```js
var linecount = require('linecount')

linecount('/usr/share/dict/words', (err, count) => {
  if (err) {
    throw err
  }

  console.log(count) // 99171
})

// Or, promised:
var linecount = require('linecount/promise')

linecount('/usr/share/dict/words')
  .then(count => console.log(count))
  .catch(err => console.error(err))

// You can also pass a stream. Note that this will drain the stream though, so you can't read from the same stream after counting it:
linecount(fs.createReadStream('/usr/share/dict/words'))
  .then(count => console.log(count))
  .catch(err => console.error(err))
```

## License

MIT-licensed. See LICENSE.

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