existsSync that also checks for symlinks

Please replace with usage of fs.existsSync
Last updated 2 years ago by stefanpenner .
ISC · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install exists-sync 
SYNC missed versions from official npm registry.

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.

Current Tags

  • 0.1.0                                ...           latest (2 years ago)

5 Versions

  • 0.1.0 [deprecated]           ...           2 years ago
  • 0.0.4 [deprecated]           ...           4 years ago
  • 0.0.3 [deprecated]           ...           5 years ago
  • 0.0.2 [deprecated]           ...           5 years ago
  • 0.0.1 [deprecated]           ...           5 years ago
Today 1
This Week 1
This Month 274
Last Day 4
Last Week 165
Last Month 728
Dependencies (0)
Dev Dependencies (3)
Dependents (144)

Copyright 2014 - 2017 © taobao.org |