# lineder

> Finds and returns information on each line of the file that matches a regular expression,

Latest version **0.1.1** (published 2015-01-07) · MIT license · 0 weekly downloads

## Install

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

## 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.1 |
| Published | 2015-01-07 |
| First published | 2015-01-07 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >= 0.10.0 |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Jason Bellamy |
| Maintainers | jasonbellamy |
| Keywords | line, find, search, regex |

## Links

- npm: https://www.npmjs.com/package/lineder
- Repository: https://github.com/jasonbellamy/lineder
- Issues: https://github.com/jasonbellamy/lineder/issues
- npm.io page: https://npm.io/package/lineder

## 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

- 0.1.1 (latest) — 2015-01-07
- 0.1.0 — 2015-01-07

## README

# Lineder [![Build Status](https://travis-ci.org/jasonbellamy/lineder.png?branch=master)](https://travis-ci.org/jasonbellamy/lineder)

> Finds and returns information on each line of the file that matches a regular expression.


## Features
[Lineder](https://github.com/jasonbellamy/lineder) finds and returns information on each line of the file that matches your search.

- Search with regular expressions.
- Get the line number(s) that the matched result was found on.
- Get the entire line(s) that the matched result was found in.


## Getting Started

- Install with [NPM](https://www.npmjs.org/) - `npm install --save lineder`


## Usage

```javascript
var lineder = require( "lineder" );

/* file.txt
   1. this is the text for line one.
   2. this is the text for line two.
   3. this is the text for line three.
*/

lineder( "file.txt", "line two", function( err, results ) {
  //=> [ { line: 2, value "this is the text for line two." } ]
});
```


## API

### lineder( path )

Name   | Type     | Argument     | Description
-------|----------|--------------|------------
path   | `string` | `<required>` | the path of the file to be searched.

### lineder.find( regex, callback )

Name     | Type           | Argument     | Description
---------|----------------|--------------|------------
regex    | `string|regex` | `<required>` | a string or regular expression to search the file for.
callback | `function`     | `<required>` | callback that returns the results of the search

#### callback( error, results )

Name     | Type       | Argument     | Description
---------|------------|--------------|------------
error    | `error`    | `<required>` | any errors that may have occured.
results  | `array`    | `<required>` | an array of objects containg the line number and values from the results of the search.


## Contributing
In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality.


## License
Copyright (c) 2015 [Jason Bellamy ](http://jasonbellamy.com)  
Licensed under the MIT license.

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