Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/erikengervall/fast-find-in-files
Node.js library written in C++ for text in file search
https://github.com/erikengervall/fast-find-in-files
cpp javascript native-module nodejs typescript
Last synced: 3 days ago
JSON representation
Node.js library written in C++ for text in file search
- Host: GitHub
- URL: https://github.com/erikengervall/fast-find-in-files
- Owner: erikengervall
- License: mit
- Created: 2019-12-21T19:29:17.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2023-10-23T13:35:37.000Z (about 1 year ago)
- Last Synced: 2024-05-02T05:52:36.191Z (7 months ago)
- Topics: cpp, javascript, native-module, nodejs, typescript
- Language: C
- Homepage: https://www.npmjs.com/package/fast-find-in-files
- Size: 269 KB
- Stars: 3
- Watchers: 4
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
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.
# 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: '',
// queryHits: [
// {
// line: 'It would appear there is a on this particular line',
// lineNumber: 1,
// link: ':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