{"id":17993095,"url":"https://github.com/scottcorgan/file-exists","last_synced_at":"2025-03-26T01:31:44.167Z","repository":{"id":18748913,"uuid":"21961016","full_name":"scottcorgan/file-exists","owner":"scottcorgan","description":"Check if filepath exists and is a file","archived":false,"fork":false,"pushed_at":"2022-04-28T19:35:38.000Z","size":38,"stargazers_count":33,"open_issues_count":4,"forks_count":8,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-03-21T01:11:12.646Z","etag":null,"topics":["file-exists","filepath","fs","javascript"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","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/scottcorgan.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-07-17T23:22:20.000Z","updated_at":"2020-11-18T07:45:23.000Z","dependencies_parsed_at":"2022-08-30T09:10:22.088Z","dependency_job_id":null,"html_url":"https://github.com/scottcorgan/file-exists","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scottcorgan%2Ffile-exists","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scottcorgan%2Ffile-exists/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scottcorgan%2Ffile-exists/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scottcorgan%2Ffile-exists/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/scottcorgan","download_url":"https://codeload.github.com/scottcorgan/file-exists/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245571876,"owners_count":20637415,"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","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":["file-exists","filepath","fs","javascript"],"created_at":"2024-10-29T20:10:14.608Z","updated_at":"2025-03-26T01:31:43.899Z","avatar_url":"https://github.com/scottcorgan.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# file-exists\n\nCheck if filepath exists and is a file. Returns false for directories.\n\n_(Requires node \u003e=6.0.0)_\n\n## Install\n\n```\nnpm install file-exists --save\n```\n\n## Usage\n\n```js\nconst fileExists = require('file-exists');\n\nfileExists('/index.html', (err, exists) =\u003e console.log(exists)) // OUTPUTS: true or false\n\nfileExists('/index.html').then(exists =\u003e {\n  console.log(exists) // OUTPUTS: true or false\n})\n\nconst exists = await fileExists('/index.html')\n\nconsole.log(fileExists.sync('/index.html')) // OUTPUTS: true or false\n```\n\n### Options\n\n#### fileExists(filepath[, options, callback])\n\n* `filepath` - the path to the file to check if it exists\n* `options` - an object of options\n  * `root` - the root directory to look in (or cwd)\n* `callback(err, exists)` - gets called when checking is done\n\n#### fileExists.sync(filepath[, options])\n* `filepath` - the path to the file to check if it exists\n* `options` - an object of options\n  * `root` - the root directory to look in (or cwd)\n\n## Run Tests\n\n```\nnpm install\nnpm test\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fscottcorgan%2Ffile-exists","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fscottcorgan%2Ffile-exists","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fscottcorgan%2Ffile-exists/lists"}