{"id":18396737,"url":"https://github.com/igorskyflyer/npm-pathexists","last_synced_at":"2025-10-09T00:00:09.891Z","repository":{"id":57118115,"uuid":"385040677","full_name":"igorskyflyer/npm-pathexists","owner":"igorskyflyer","description":"🧲 Provides ways of properly checking if a path exists inside a given array of files/directories both on Windows and UNIX-like operating systems. 🗺","archived":false,"fork":false,"pushed_at":"2025-08-30T16:52:59.000Z","size":261,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-09-30T19:41:51.038Z","etag":null,"topics":["back-end","directory","exists","filesystem","folder","igorskyflyer","nodejs","npm","package","path","posix","storage","unix","windows"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/@igorskyflyer/pathexists","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/igorskyflyer.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-07-11T19:56:00.000Z","updated_at":"2025-08-30T16:52:52.000Z","dependencies_parsed_at":"2024-12-24T10:29:59.575Z","dependency_job_id":"875cc163-e209-4c72-96a9-118202461315","html_url":"https://github.com/igorskyflyer/npm-pathexists","commit_stats":{"total_commits":29,"total_committers":1,"mean_commits":29.0,"dds":0.0,"last_synced_commit":"059e773cfa6836f6fd650e0045cb726db4322a76"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/igorskyflyer/npm-pathexists","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/igorskyflyer%2Fnpm-pathexists","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/igorskyflyer%2Fnpm-pathexists/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/igorskyflyer%2Fnpm-pathexists/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/igorskyflyer%2Fnpm-pathexists/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/igorskyflyer","download_url":"https://codeload.github.com/igorskyflyer/npm-pathexists/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/igorskyflyer%2Fnpm-pathexists/sbom","scorecard":{"id":482801,"data":{"date":"2025-08-11","repo":{"name":"github.com/igorskyflyer/npm-pathexists","commit":"059e773cfa6836f6fd650e0045cb726db4322a76"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.4,"checks":[{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Code-Review","score":0,"reason":"Found 0/24 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE.txt:0","Info: FSF or OSI recognized license: MIT License: LICENSE.txt:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'main'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 7 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Vulnerabilities","score":5,"reason":"5 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-grv7-fg5c-xmjg","Warn: Project is vulnerable to: GHSA-4q6p-r6v2-jvc5","Warn: Project is vulnerable to: GHSA-mwcw-c2x4-8c55","Warn: Project is vulnerable to: GHSA-76p7-773f-r4q5"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-19T17:02:38.579Z","repository_id":57118115,"created_at":"2025-08-19T17:02:38.580Z","updated_at":"2025-08-19T17:02:38.580Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279000705,"owners_count":26082862,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-08T02:00:06.501Z","response_time":56,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["back-end","directory","exists","filesystem","folder","igorskyflyer","nodejs","npm","package","path","posix","storage","unix","windows"],"created_at":"2024-11-06T02:14:42.565Z","updated_at":"2025-10-09T00:00:09.872Z","avatar_url":"https://github.com/igorskyflyer.png","language":"TypeScript","funding_links":["https://ko-fi.com/igorskyflyer"],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n  \u003cimg src=\"https://raw.githubusercontent.com/igorskyflyer/npm-pathexists/main/media/pathexists.png\" alt=\"Icon of PathExists\" width=\"256\" height=\"256\"\u003e\n  \u003ch1\u003ePathExists\u003c/h1\u003e\n\u003c/div\u003e\n\n\u003cbr\u003e\n\n\u003ch4 align=\"center\"\u003e\n  🧲 Provides ways of properly checking if a path exists inside a given array of files/directories both on Windows and UNIX-like operating systems, using \u003ccode\u003eString\u003c/code\u003e manipulation techniques. 🗺\n\u003c/h4\u003e\n\n\u003cbr\u003e\n\u003cbr\u003e\n\n## 📃 Table of Contents\n\n- [Features](#-features)\n- [Usage](#-usage)\n- [API](#-api)\n- [Changelog](#-changelog)\n- [Support](#-support)\n- [License](#-license)\n- [Related](#-related)\n- [Author](#-author)\n\n\u003cbr\u003e\n\u003cbr\u003e\n\n## 🤖 Features\n\n- 🖥 OS‑aware checks - Adapts comparison rules for Windows or UNIX‑like systems\n- 🔍 Path lookup - Quickly finds if a path exists in a given list\n- 🛡 Case handling - Case‑insensitive on Windows, case‑sensitive on UNIX‑like\n- ⚙️ Custom comparator - Plug in your own matching logic when needed\n- 🔄 Reusable helpers - Separate functions for Windows, UNIX, and auto‑detect modes\n- 📦 Lightweight - Minimal code, no heavy dependencies\n- 🌍 Cross‑platform - Works consistently across different operating systems\n\n\u003cbr\u003e\n\n\u003e ⚠️ **WARNING**\n\u003e\n\u003e It does **NOT** actually check if the file/directory exists **on the disk**, it only checks if the given path exists in the list of paths. Useful when you have already obtained a list of files/directories and you want to check if a given path is eligible/available to, for example, create a new file at it.\n\u003e\n\n\u003cbr\u003e\n\u003cbr\u003e\n\n## 🕵🏼 Usage\n\nInstall it by executing any of the following, depending on your preferred package manager:\n\n```bash\npnpm add @igorskyflyer/pathexists\n```\n\n```bash\nyarn add @igorskyflyer/pathexists\n```\n\n```bash\nnpm i @igorskyflyer/pathexists\n```\n\n\u003cbr\u003e\n\u003cbr\u003e\n\n## 🤹🏼 API\n\n```ts\nimport { pathExists, pathExistsWindows, pathExistsUnix } from '@igorskyflyer/pathexists'\n\nconst allPaths: string[] = ['abc.js', 'etc.bak']\nconst winPaths: string[] = ['D:\\\\', 'D:\\\\Temp\\\\a.js']\nconst unixPaths: string[] = ['/home/user', '/home/user/a.js']\n\n// #1 - host OS dependent mode - uses the appropriate function for each host OS\nconsole.log(pathExists('abc.js', allPaths)) // prints true\n\n// #1 - force Windows mode\nconsole.log(pathExistsWindows('abc.js', allPaths)) // prints true\n\n// #1 - force UNIX-like mode\nconsole.log(pathExistsUnix('abc.js', allPaths)) // prints true\n\n// #2 - force Windows mode\nconsole.log(pathExistsWindows('abC.js', allPaths)) // prints true\n\n// #2 - force UNIX-like mode\nconsole.log(pathExistsUnix('abC.js', allPaths)) // prints false\n\n// #3 - force Windows mode\nconsole.log(pathExistsWindows('D:\\\\Temp\\\\A.js', winPaths)) // prints true\n\n// #3 - force UNIX-like mode\nconsole.log(pathExistsUnix('D:\\\\Temp\\\\A.js', unixPaths)) // prints false\n\n// #4 - force Windows mode, custom Comparator\nconsole.log(pathExistsWindows('Temp', winPaths, (entry, value) =\u003e entry.indexOf(value) \u003e -1)) // prints true\n\n// #4 - force UNIX-like mode, custom Comparator\nconsole.log(pathExistsUnix('Temp', unixPaths, (entry, value) =\u003e entry.indexOf(value) \u003e -1)) // prints true\n```\n\n\u003cbr\u003e\n\u003cbr\u003e\n\n## 📝 Changelog\n\n📑 The changelog is available here, [CHANGELOG.md](https://github.com/igorskyflyer/npm-pathexists/blob/main/CHANGELOG.md).\n\n\u003cbr\u003e\n\u003cbr\u003e\n\n## 🪪 License\n\nLicensed under the MIT license which is available here, [MIT license](https://github.com/igorskyflyer/npm-pathexists/blob/main/LICENSE).\n\n\u003cbr\u003e\n\u003cbr\u003e\n\n## 💖 Support\n\n\u003cdiv align=\"center\"\u003e\n  I work hard for every project, including this one and your support means a lot to me!\n  \u003cbr\u003e\n  Consider buying me a coffee. ☕\n  \u003cbr\u003e\n  \u003cbr\u003e\n  \u003ca href=\"https://ko-fi.com/igorskyflyer\" target=\"_blank\"\u003e\u003cimg src=\"https://raw.githubusercontent.com/igorskyflyer/igorskyflyer/main/assets/ko-fi.png\" alt=\"Donate to igorskyflyer\" width=\"180\" height=\"46\"\u003e\u003c/a\u003e\n  \u003cbr\u003e\n  \u003cbr\u003e\n  \u003cem\u003eThank you for supporting my efforts!\u003c/em\u003e 🙏😊\n\u003c/div\u003e\n\n\u003cbr\u003e\n\u003cbr\u003e\n\n## 🧬 Related\n\n[@igorskyflyer/adblock-header-extract](https://www.npmjs.com/package/@igorskyflyer/adblock-header-extract)\n\n\u003e _✂️ An npm module that provides ways to extract header and metadata from an Adblock filter file. 📃_\n\n\u003cbr\u003e\n\n[@igorskyflyer/upath](https://www.npmjs.com/package/@igorskyflyer/upath)\n\n\u003e _🎍 Provides a universal way of formatting file-paths in Unix-like and Windows operating systems as an alternative to the built-in path.normalize(). 🧬_\n\n\u003cbr\u003e\n\n[@igorskyflyer/uarray](https://www.npmjs.com/package/@igorskyflyer/uarray)\n\n\u003e _🎉 Provides UArray, an Array type that supports negative indices/indexes, just wrap your regular JavaScript array with UArray() and you are all set! 🙌_\n\n\u003cbr\u003e\n\n[@igorskyflyer/git-repo-url](https://www.npmjs.com/package/@igorskyflyer/git-repo-url)\n\n\u003e _🌐 Gets the origin URL a local Git repository. 🗺️_\n\n\u003cbr\u003e\n\n[@igorskyflyer/unc-path](https://www.npmjs.com/package/@igorskyflyer/unc-path)\n\n\u003e _🥽 Provides ways of parsing UNC paths and checking whether they are valid. 🎱_\n\n\u003cbr\u003e\n\u003cbr\u003e\n\u003cbr\u003e\n\n## 👨🏻‍💻 Author\nCreated by **Igor Dimitrijević** ([*@igorskyflyer*](https://github.com/igorskyflyer/)).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Figorskyflyer%2Fnpm-pathexists","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Figorskyflyer%2Fnpm-pathexists","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Figorskyflyer%2Fnpm-pathexists/lists"}