Security News
Maven Central Adds Sigstore Signature Validation
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.
find-files-extra
Advanced tools
Simple file finder with both file name and content search options
Simple (with advanced feature) file search
// Find all json files (Loading content + parse to json)
let jsonFiles = await findFileExtra({
root: MY_PROJECT_ROOT,
filePattern: "**/*.json",
loadFileContent: true,
parseJson: true,
});
// Find all ts files with 'search-me' in content (Not loading content)
let files = await findFileExtra({
root: MY_PROJECT_ROOT,
filePattern: "**/*.ts",
fileContentPattern: "search-me",
});
// Find all ts files with content that match regexp (Loading content)
let files = await findFileExtra({
root: MY_PROJECT_ROOT,
filePattern: "**/*.ts",
fileContentPattern: /search\-me|searchMe/,
loadFileContent: true,
});
The result is list of findFileExtraFileInfo
(interface)
export interface findFileExtraFileInfo {
fullPath: string;
pathFromRoot: string;
fileName: string;
dirFullPath: string;
dirPathFromRoot: string;
ext: string;
json?: unknown;
content?: string;
}
Option | Required | Type | Default | Description |
---|---|---|---|---|
root | true | string | - | Root directory to search in. |
filePattern | false | string | "**/*.*" | File pattern to search for. glob pattern |
ignoreFilePattern | false | string[] | ["**/bin/**", "**/node_modules/**", "**/obj/**"] | File pattern to ignore. glob pattern |
fileContentPattern | false | regexp / string | undefined | File content pattern to search for. |
loadFileContent | false | boolean | false | Load file content. |
parseJson | false | boolean | false | Parse file content to json. |
dot | false | boolean | true | Use dot notation for json keys. |
nocase | false | boolean | true | Case insensitive search. |
parseJson
requiresloadFileContent
to be true.
if
filePattern
andfileContentPattern
is bothundefined
(not set) all files will be found in the root.
- npm install find-files-extra
- yarn add find-files-extra
FAQs
Simple file finder with both file name and content search options
We found that find-files-extra demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.
Security News
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
Research
Security News
Socket researchers uncovered a backdoored typosquat of BoltDB in the Go ecosystem, exploiting Go Module Proxy caching to persist undetected for years.