JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 179634
  • Score
    100M100P100Q33577F
  • License ISC

existsSync that also checks for symlinks

Package Exports

  • exists-sync

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 (exists-sync) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

exists-sync [DEPRECATED]

Build Status Build status

This project is deprecated, please continue to use fs.existsSync as its deprecation is no more.


Replacement for fs.existsSync() (which has been un-deprecated in Node.js since 6.8.0):

"fs.exists() is an anachronism and exists only for historical reasons. There should almost never be a reason to use it in your own code.

In particular, checking if a file exists before opening it is an anti-pattern that leaves you vulnerable to race conditions: another process may remove the file between the calls to fs.exists() and fs.open(). Just open the file and handle the error when it's not there."

exists-sync will recursively follow symlinks to verify the target file exists, rather than giving a false positive on a symlink whose target has been removed.