fast-find-in-files
Advanced tools
Comparing version 0.1.1 to 0.2.0
@@ -1,2 +0,2 @@ | ||
interface QueryHit { | ||
export interface QueryHit { | ||
link: string; | ||
@@ -7,3 +7,3 @@ line: string; | ||
} | ||
interface fastFindInFiles { | ||
export interface FastFindInFiles { | ||
filePath: string; | ||
@@ -13,3 +13,3 @@ totalHits: number; | ||
} | ||
declare const bindingWrapper: (directory: string, needle: string) => fastFindInFiles[]; | ||
declare const bindingWrapper: (directory: string, needle: string | RegExp) => FastFindInFiles[]; | ||
export { bindingWrapper as fastFindInFiles }; |
@@ -16,5 +16,6 @@ "use strict"; | ||
} | ||
return binding_node_1.default.exportedFn(directory, needle); | ||
const needleStr = needle instanceof RegExp ? needle.source : needle; | ||
return binding_node_1.default.exportedFn(directory, needleStr); | ||
}; | ||
exports.fastFindInFiles = bindingWrapper; | ||
//# sourceMappingURL=index.js.map |
{ | ||
"name": "fast-find-in-files", | ||
"version": "0.1.1", | ||
"version": "0.2.0", | ||
"description": "fast-find-in-files recursively searches sub-directories for needle matches", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -1,4 +0,4 @@ | ||
# Fast find in files | ||
# Fast Find in Files | ||
`fast-find-in-files` recursively searches all files in selected directory and sub-directories for text matches. The library is built completely in c++ and exposes its functionality using [node-addon-api](https://github.com/nodejs/node-addon-api). | ||
`fast-find-in-files` recursively searches all files in selected directory and sub-directories for text matches using partial string matching or regular expressions. The library is built entirely in C++ and exposes its functionality using [node-addon-api](https://github.com/nodejs/node-addon-api). | ||
@@ -29,3 +29,3 @@ <p align="center"> | ||
const directory = process.cwd() | ||
const needle = 'needle' | ||
const needle = 'needle' // also supports string RegExp: 'needle*', and RegExp instances: new RegExp('needle*') | ||
@@ -51,2 +51,27 @@ const result = fastFindInFiles(directory, needle) | ||
## Development | ||
### Install dependencies | ||
```sh | ||
yarn install | ||
``` | ||
### Build | ||
```sh | ||
yarn build | ||
``` | ||
### Test | ||
```sh | ||
yarn test | ||
``` | ||
## Release | ||
1. Bump version in `package.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 | ||
## Documentation | ||
@@ -53,0 +78,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
14480
32
91