Gathering detailed insights and metrics for find-cache-dir
Gathering detailed insights and metrics for find-cache-dir
Gathering detailed insights and metrics for find-cache-dir
Gathering detailed insights and metrics for find-cache-dir
cache-path
return a cache directory, like `find-cache-dir` do
@visulima/find-cache-dir
Finds the common standard cache directory
pkg-dir
Find the root directory of a Node.js project or npm package
find-parent-dir
Finds the first parent directory that contains a given file or directory.
npm install find-cache-dir
Module System
Min. Node Version
Typescript Support
Node Version
NPM Version
151 Stars
51 Commits
24 Forks
3 Watching
1 Branches
14 Contributors
Updated on 12 Oct 2024
Minified
Minified + Gzipped
JavaScript (89%)
TypeScript (11%)
Cumulative downloads
Total Downloads
Last day
-8%
7,086,246
Compared to previous day
Last week
1.2%
41,036,528
Compared to previous week
Last month
11.9%
169,272,345
Compared to previous month
Last year
1.2%
1,819,250,555
Compared to previous year
Finds the common standard cache directory
The nyc
and AVA
projects decided to standardize on a common directory structure for storing cache information:
1# nyc 2./node_modules/.cache/nyc 3 4# ava 5./node_modules/.cache/ava 6 7# your-module 8./node_modules/.cache/your-module
This module makes it easy to correctly locate the cache directory according to this shared spec. If this pattern becomes ubiquitous, clearing the cache for multiple dependencies becomes easy and consistent:
rm -rf ./node_modules/.cache
1npm install find-cache-dir
1import findCacheDirectory from 'find-cache-dir'; 2 3findCacheDirectory({name: 'unicorns'}); 4//=> '/user/path/node-modules/.cache/unicorns'
Finds the cache directory using the given options.
The algorithm checks for the CACHE_DIR
environmental variable and uses it if it is not set to true
, false
, 1
or 0
. If one is not found, it tries to find a package.json
file, searching every parent directory of the cwd
specified (or implied from other options). It returns a string
containing the absolute path to the cache directory, or undefined
if package.json
was never found or if the node_modules
directory is unwritable.
Type: object
Required
Type: string
Should be the same as your project name in package.json
.
Type: string[]
An array of files that will be searched for a common parent directory. This common parent directory will be used in lieu of the cwd
option below.
Type: string
Default process.cwd()
The directory to start searching for a package.json
from.
Type: boolean
Default false
Create the directory synchronously before returning.
find-cache-dir
, set the CACHE_DIR
environment variable to temporarily override the directory that is resolved.No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
security policy file detected
Details
Reason
0 existing vulnerabilities detected
Reason
license file detected
Details
Reason
Found 12/30 approved changesets -- score normalized to 4
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2024-11-18
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More