# @vipulc/line-match

> Returns lines matching a pattern in a string. Supports inverse operation as well, to exclude lines with matches.

Latest version **1.0.3** (published 2019-11-02) · MIT license · 0 weekly downloads

## Install

```sh
npm install @vipulc/line-match
pnpm add @vipulc/line-match
yarn add @vipulc/line-match
bun add @vipulc/line-match
```

## 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.3 |
| Published | 2019-11-02 |
| First published | 2019-10-29 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 6.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Vipul Chaudhary |
| Maintainers | vipulc |
| Keywords | match, line, grep, regex, regular-expression, pattern, find, search, lines, line match, filter-lines, locate, inverse-match, text-processing |

## Links

- npm: https://www.npmjs.com/package/@vipulc/line-match
- Repository: https://github.com/vpul/line-match
- Homepage: https://github.com/vpul/line-match#readme
- Issues: https://github.com/vpul/line-match/issues
- npm.io page: https://npm.io/package/@vipulc/line-match

## 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.3 (latest) — 2019-11-02
- 1.0.2 — 2019-11-02
- 1.0.1 — 2019-11-02
- 1.0.0 — 2019-10-29

## README

# line-match

![npm (scoped)](https://img.shields.io/npm/v/@vipulc/line-match)
![npm](https://img.shields.io/npm/dt/@vipulc/line-match)
[![GitHub issues](https://img.shields.io/github/issues/vpul/line-match)](https://github.com/vpul/line-match/issues)
[![GitHub forks](https://img.shields.io/github/forks/vpul/line-match)](https://github.com/vpul/line-match/network)
[![GitHub stars](https://img.shields.io/github/stars/vpul/line-match)](https://github.com/vpul/line-match/stargazers)
[![GitHub license](https://img.shields.io/github/license/vpul/line-match)](https://github.com/vpul/line-match/blob/master/LICENSE)

Returns lines matching a pattern in a string. Supports inverse operation as well, to exclude lines with matches.

## Install

`$ npm install @vipulc/line-match`

## Usage

```js
multiLineString.lineMatch(pattern);
```

## Example

```js
require("@vipulc/line-match");

const str1 = `Brave New World
  Fear and Loathing in Las Vegas
  World War Z`;

// lines ending with 'World'
console.log(str1.lineMatch(/World$/));
//=> ['Brave New World']

const str2 = `Brave New World
  Fear and Loathing in Las Vegas
  World War Z`;

// exclude lines ending with 'World'
console.log(str2.lineMatch(/World$/, { inverse: true }));
//=> [ '  Fear and Loathing in Las Vegas', '  World War Z' ]
```

## License

[MIT License](https://github.com/vpul/line-match/blob/master/LICENSE)

```

```

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