Package Exports
- file-exists-safe
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (file-exists-safe) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
Check if a file exists without a try catch.
- Returns
true
if the path exists and is a file. - Returns
false
if the path is not a file, or does not exist. - Returns
undefined
for other errors (for example, permission denied) rather than throwing.
Installation
yarn add file-exists-safe
npm install file-exists-safe
API
import { fileExists, fileExistsSync } from "file-exists-safe";
function fileExists(path: string): Promise<boolean | undefined>;
function fileExistsSync(path: string): boolean | undefined;
Dev Dependencies
- @bconnorwhite/bob: Bob is a toolkit for typescript projects
- @types/mock-fs: TypeScript definitions for mock-fs
- @types/node: TypeScript definitions for Node.js
- mock-fs: A configurable mock file system. You know, for testing.
License 
Related Packages
- dir-exists-safe: Check if a directory exists without a try catch