
Security News
Crates.io Implements Trusted Publishing Support
Crates.io adds Trusted Publishing support, enabling secure GitHub Actions-based crate releases without long-lived API tokens.
fs-exists-cached
Advanced tools
The fs-exists-cached npm package provides a simple and efficient way to check if a file or directory exists, with caching to improve performance for repeated checks.
Check if a file or directory exists
This feature allows you to check if a specified file or directory exists. The result is cached to improve performance for subsequent checks.
const fsExistsCached = require('fs-exists-cached');
fsExistsCached('path/to/file/or/directory').then(exists => {
console.log(exists ? 'Exists' : 'Does not exist');
});
Synchronous check if a file or directory exists
This feature provides a synchronous method to check if a specified file or directory exists. The result is cached for performance optimization.
const fsExistsCached = require('fs-exists-cached');
const exists = fsExistsCached.sync('path/to/file/or/directory');
console.log(exists ? 'Exists' : 'Does not exist');
fs-extra is a package that extends the native Node.js fs module with additional methods, including methods to check if a file or directory exists. Unlike fs-exists-cached, fs-extra does not cache the results of existence checks.
path-exists is a simple package to check if a path exists. It provides both asynchronous and synchronous methods. However, it does not include caching like fs-exists-cached.
file-exists is another package for checking if a file exists. It offers both asynchronous and synchronous methods but does not provide caching functionality.
Just like fs.exists
and fs.existsSync
, but cached
FAQs
Just like `fs.exists` and `fs.existsSync`, but cached
The npm package fs-exists-cached receives a total of 662,876 weekly downloads. As such, fs-exists-cached popularity was classified as popular.
We found that fs-exists-cached demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Crates.io adds Trusted Publishing support, enabling secure GitHub Actions-based crate releases without long-lived API tokens.
Research
/Security News
Undocumented protestware found in 28 npm packages disrupts UI for Russian-language users visiting Russian and Belarusian domains.
Research
/Security News
North Korean threat actors deploy 67 malicious npm packages using the newly discovered XORIndex malware loader.