# line-number

> Get the line number for each regex match found in a string.

Latest version **0.1.0** (published 2014-07-02) · 0 weekly downloads

## Install

```sh
npm install line-number
pnpm add line-number
yarn add line-number
bun add line-number
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.0 |
| Published | 2014-07-02 |
| First published | 2014-07-02 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=0.10.0 |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 15 |
| Author | Jon Schlinkert |
| Maintainers | jonschlinkert |
| Keywords | each, expression, file, find, index, line, line-no, line-number, lines, locate, match, matches, num, number, pattern, re, regex, regexp, regular, search, string |

## Links

- npm: https://www.npmjs.com/package/line-number
- Repository: https://github.com/jonschlinkert/line-number
- Issues: https://github.com/jonschlinkert/line-number/issues
- npm.io page: https://npm.io/package/line-number

## Alternatives

- [memory-cache](https://npm.io/package/memory-cache.md) — 795.0K weekly downloads
- [@httptoolkit/proxy-agent](https://npm.io/package/@httptoolkit/proxy-agent.md) — 11.2K weekly downloads
- [express-cache-controller](https://npm.io/package/express-cache-controller.md) — 5.3K weekly downloads
- [http-cache-middleware](https://npm.io/package/http-cache-middleware.md) — 4.5K weekly downloads
- [cache2](https://npm.io/package/cache2.md) — 1.5K weekly downloads

## Recent versions

- 0.1.0 (latest) — 2014-07-02

## README

# line-number [![NPM version](https://badge.fury.io/js/line-number.png)](http://badge.fury.io/js/line-number)

> Get the line number for each regex match found in a string.

## Install
Install with [npm](npmjs.org):

```bash
npm i line-number --save-dev
```

## Usage

```js
var lineNumber = require('line-number');
var fixture = fs.readFileSync('LICENSE-MIT', 'utf8');
var re = /Jon[^,]+/g;
console.log(lineNumber(fixture, re));
//=> results in:
// [
//   {
//     "line": "Copyright (c) 2014 Jon Schlinkert, contributors.",
//     "number": 1,
//     "match": "Jon Schlinkert"
//   }
// ];
```


## Author

**Jon Schlinkert**

+ [github/jonschlinkert](https://github.com/jonschlinkert)
+ [twitter/jonschlinkert](http://twitter.com/jonschlinkert)

## License
Copyright (c) 2014 Jon Schlinkert, contributors.
Released under the MIT license

***

_This file was generated by [verb-cli](https://github.com/assemble/verb-cli) on July 02, 2014._

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