# fast-find-in-files

> fast-find-in-files recursively searches sub-directories for needle matches

Latest version **1.0.5** (published 2024-09-22) · MIT license · 0 weekly downloads

## Install

```sh
npm install fast-find-in-files
pnpm add fast-find-in-files
yarn add fast-find-in-files
bun add fast-find-in-files
```

## Health

**Score 25/100 (F)** — status: maintenance-mode.

Positive: no vulnerabilities.

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

Negative: stale; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.5 |
| Published | 2024-09-22 |
| First published | 2019-12-23 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 45.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | yes |
| GitHub stars | 4 |
| Author | Erik Engervall |
| Maintainers | engervall |
| Keywords | fast, find, in, files, match, regex, text |

## Links

- npm: https://www.npmjs.com/package/fast-find-in-files
- Repository: https://github.com/erikengervall/fast-find-in-files
- Homepage: https://erikengervall.github.io/fast-find-in-files/
- Issues: https://github.com/erikengervall/fast-find-in-files/issues
- npm.io page: https://npm.io/package/fast-find-in-files

## Dependencies (2)

- [bindings](https://npm.io/package/bindings.md) ^1.5.0
- [node-addon-api](https://npm.io/package/node-addon-api.md) ^7.0.0

## Alternatives

- [eslint-plugin-sonarjs](https://npm.io/package/eslint-plugin-sonarjs.md) — 2.9M weekly downloads
- [eslint-config-expo](https://npm.io/package/eslint-config-expo.md) — 1.5M weekly downloads
- [@matter/protocol](https://npm.io/package/@matter/protocol.md) — 63.5K weekly downloads
- [@eventcatalog/linter](https://npm.io/package/@eventcatalog/linter.md) — 24.8K weekly downloads
- [@inrupt/eslint-config-base](https://npm.io/package/@inrupt/eslint-config-base.md) — 4.5K weekly downloads

## Recent versions

- 1.0.5 (latest) — 2024-09-22
- 1.0.4 — 2023-10-23
- 1.0.3 — 2023-10-23
- 1.0.2 — 2023-10-23
- 1.0.1 — 2023-10-23
- 1.0.0 — 2023-10-23
- 0.2.1 — 2023-10-23
- 0.2.0 — 2023-08-23
- 0.1.1 — 2019-12-23
- 0.1.0 — 2019-12-23

## README

# Fast Find in Files

⚡️ Supercharge keyword searches in file systems with blazing speed powered by C++.

Thanks to [node-addon-api](https://github.com/nodejs/node-addon-api) `fast-find-in-files` is able to provide a
significantly faster search than other libraries. The library is built entirely in C++ and exposes its functionality
using TypeScript.

<p align="center">
  <img alt="fast-find-in-files logo" width="300px" src="https://raw.githubusercontent.com/erikengervall/fast-find-in-files/master/resources/img/logo.png">
</p>

<br>
<br>

<p align="center">
  <img alt="licence" src="https://github.com/erikengervall/fast-find-in-files/workflows/Node.js%20CI/badge.svg">

  <a href="https://www.npmjs.com/package/fast-find-in-files">
    <img alt="npm downloads" src="https://img.shields.io/npm/dm/fast-find-in-files.svg?style=flat">
  </a>
  <a href="https://github.com/erikengervall/fast-find-in-files/blob/master/LICENSE">
    <img alt="licence" src="https://img.shields.io/npm/l/fast-find-in-files.svg?style=flat">
  </a>
<p>

# Example

```ts
import { fastFindInFiles } from 'fast-find-in-files'

const directory = process.cwd()
const needle = 'needle' // also supports string RegExp: 'needle*', and RegExp instances: new RegExp('needle*')

const result = fastFindInFiles({ directory, needle })

console.log(result)
// [
//   {
//     filePath: '<path>',
//     queryHits: [
//       {
//         line: 'It would appear there is a <needle> on this particular line',
//         lineNumber: 1,
//         link: '<path>:1:28',
//         offset: 28,
//       },
//     ],
//     totalHits: 1,
//   },
// ]
```

# Development

## Install dependencies

```sh
yarn install
```

## Build

```sh
yarn build
```

## Test

```sh
yarn test
```

# Release

1. Bump version in `package.json` & `lerna.json` (create PR -> merge)
2. Create a new release on GitHub. This will also create a tag which will trigger the CI to publish a new version to npm

# Node Addon API

A Native Addon is a binary compiled from C/C++.

Native Addons compile into a [Dynamically Linked Library (DLL)](https://en.wikipedia.org/wiki/Dynamic-link_library).

## Contributing

If you'd like to contribute, start by searching through the issues and pull requests to see whether someone else has
raised a similar idea or question.

If you don't see your idea listed, and you think it fits into the goals of this guide, do one of the following:

- If your contribution is **minor**, such as a typo fix, open a pull request.
- If your contribution is **major**, such as a new feature, start by opening an issue first. That way, other people can
  weigh in on the discussion before you do any work.

## License

MIT

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