Product
Introducing Socket Optimize
We're excited to introduce Socket Dependency Optimization, a powerful CLI command to secure open source dependencies with tested, optimized package overrides.
@visulima/find-cache-dir
Advanced tools
Finds the common standard cache directory, a commonjs and esm version of find-cache-dir.
Daniel Bannert's open source work is supported by the community on GitHub Sponsors
npm install @visulima/find-cache-dir
yarn add @visulima/find-cache-dir
pnpm add @visulima/find-cache-dir
import { findCacheDir, findCacheDirSync } from "@visulima/find-cache-dir";
const cacheDir = await findCacheDir("my-app");
console.log(cacheDir); //=> '/Users/test/Library/node_mdules/.cache/my-app'
const syncCacheDir = findCacheDirSync("my-app");
console.log(syncCacheDir); //=> '/Users/test/Library/node_mdules/.cache/my-app'
The same can be done for cjs:
const { findCacheDir, findCacheDirSync } = require("@visulima/find-cache-dir");
const cacheDir = findCacheDir("my-app");
console.log(cacheDir); //=> '/Users/test/Library/node_mdules/.cache/my-app'
const syncCacheDir = findCacheDirSync("my-app");
console.log(syncCacheDir); //=> '/Users/test/Library/node_mdules/.cache/my-app'
Required
Type: string
Should be the same as your project name in package.json
.
Type: object
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.
Type: boolean
Default false
Throw an error if a .cache
folder can't be found.
@visulima/find-cache-dir
, set the CACHE_DIR
environment variable to temporarily override the directory that is resolved.Libraries in this ecosystem make the best effort to track Node.js’ release schedule. Here’s a post on why we think this is important.
If you would like to help take a look at the list of issues and check our Contributing guidelines.
Note: please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms.
The visulima find-cache-dir is open-sourced software licensed under the MIT
FAQs
Finds the common standard cache directory
The npm package @visulima/find-cache-dir receives a total of 378 weekly downloads. As such, @visulima/find-cache-dir popularity was classified as not popular.
We found that @visulima/find-cache-dir demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers 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.
Product
We're excited to introduce Socket Dependency Optimization, a powerful CLI command to secure open source dependencies with tested, optimized package overrides.
Product
We're excited to announce that Socket now supports the Java programming language.
Security News
Socket detected a malicious Python package impersonating a popular browser cookie library to steal passwords, screenshots, webcam images, and Discord tokens.