包详细信息

@visulima/find-cache-dir

visulima4.6kMIT1.0.28

Finds the common standard cache directory

visulima, find-cache, find-cache-directory, find-cache-dir

自述文件

visulima find-cache-dir

Finds the common standard cache directory, a commonjs and esm version of find-cache-dir.


typescript-image npm-image license-image

Daniel Bannert's open source work is supported by the community on GitHub Sponsors


Install

npm install @visulima/find-cache-dir
yarn add @visulima/find-cache-dir
pnpm add @visulima/find-cache-dir

Usage

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'

API

name

Required\ Type: string

Should be the same as your project name in package.json.

options

Type: object

cwd

Type: string\ Default process.cwd()

The directory to start searching for a package.json from.

create

Type: boolean\ Default false

Create the directory synchronously before returning.

throwError

Type: boolean\ Default false

Throw an error if a .cache folder can't be found.

Tips

  • To test modules using @visulima/find-cache-dir, set the CACHE_DIR environment variable to temporarily override the directory that is resolved.

Related

Supported Node.js Versions

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.

Contributing

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.

Credits

License

The visulima find-cache-dir is open-sourced software licensed under the MIT

更新日志

@visulima/find-cache-dir 1.0.28 (2025-03-07)

Bug Fixes

  • updated @visulima/packem and other dev deps, for better bundling size (e940581)

Dependencies

  • @visulima/fs: upgraded to 3.1.2
  • @visulima/path: upgraded to 1.3.5

@visulima/find-cache-dir 1.0.27 (2025-03-03)

Miscellaneous Chores

  • updated dev dependencies (487a976)

Dependencies

  • @visulima/fs: upgraded to 3.1.1

@visulima/find-cache-dir 1.0.26 (2025-01-29)

Dependencies

  • @visulima/fs: upgraded to 3.1.0

@visulima/find-cache-dir 1.0.25 (2025-01-25)

Bug Fixes

  • fixed wrong node version range in package.json (4ae2929)

Miscellaneous Chores

Dependencies

  • @visulima/fs: upgraded to 3.0.1
  • @visulima/path: upgraded to 1.3.4

@visulima/find-cache-dir 1.0.24 (2025-01-25)

Miscellaneous Chores

  • updated all dev dependencies (37fb298)

Dependencies

  • @visulima/fs: upgraded to 3.0.0

@visulima/find-cache-dir 1.0.23 (2025-01-22)

Miscellaneous Chores

  • updated all dev dependencies and all dependencies in the app folder (87f4ccb)

Dependencies

  • @visulima/fs: upgraded to 2.3.8

@visulima/find-cache-dir 1.0.22 (2025-01-13)

Dependencies

  • @visulima/fs: upgraded to 2.3.7
  • @visulima/path: upgraded to 1.3.3

@visulima/find-cache-dir 1.0.21 (2025-01-12)

Bug Fixes

  • updated @visulima/packem, and all other dev dependencies (7797a1c)

Dependencies

  • @visulima/fs: upgraded to 2.3.6
  • @visulima/path: upgraded to 1.3.2

@visulima/find-cache-dir 1.0.20 (2025-01-08)

Dependencies

  • @visulima/fs: upgraded to 2.3.5
  • @visulima/path: upgraded to 1.3.1

@visulima/find-cache-dir 1.0.19 (2025-01-08)

Dependencies

  • @visulima/fs: upgraded to 2.3.4
  • @visulima/path: upgraded to 1.3.0

@visulima/find-cache-dir 1.0.18 (2024-12-31)

Dependencies

  • @visulima/fs: upgraded to 2.3.3
  • @visulima/path: upgraded to 1.2.0

@visulima/find-cache-dir 1.0.17 (2024-12-27)

Miscellaneous Chores

  • updated dev dependencies (9de2eab)

Dependencies

  • @visulima/fs: upgraded to 2.3.2

@visulima/find-cache-dir 1.0.16 (2024-12-12)

Bug Fixes

  • allow node v23 (8ca929a)
  • allowed node 23, updated dev dependencies (f99d34e)
  • updated packem to v1.8.2 (23f869b)
  • updated packem to v1.9.2 (47bdc2d)

Styles

Miscellaneous Chores

  • updated dev dependencies (a916944)

Dependencies

  • @visulima/fs: upgraded to 2.3.1
  • @visulima/path: upgraded to 1.1.2

@visulima/find-cache-dir 1.0.15 (2024-10-25)

Dependencies

  • @visulima/fs: upgraded to 2.3.0

@visulima/find-cache-dir 1.0.14 (2024-10-05)

Dependencies

  • @visulima/fs: upgraded to 2.2.2
  • @visulima/path: upgraded to 1.1.1

@visulima/find-cache-dir 1.0.13 (2024-10-05)

Bug Fixes

  • updated dev dependencies, updated packem to v1.0.7, fixed naming of some lint config files (c071a9c)

Dependencies

  • @visulima/fs: upgraded to 2.2.1
  • @visulima/path: upgraded to 1.1.0

@visulima/find-cache-dir 1.0.12 (2024-09-29)

Miscellaneous Chores

  • updated dev dependencies (736c6ce)

Dependencies

  • @visulima/fs: upgraded to 2.2.0

@visulima/find-cache-dir 1.0.11 (2024-09-24)

Bug Fixes

  • update packem to v1 (05f3bc9)
  • updated esbuild from v0.23 to v0.24 (3793010)

Miscellaneous Chores

  • updated dev dependencies (05edb67)

Dependencies

  • @visulima/fs: upgraded to 2.1.18
  • @visulima/path: upgraded to 1.0.9

@visulima/find-cache-dir 1.0.10 (2024-09-11)

Bug Fixes

Miscellaneous Chores

  • updated dev dependencies (28b5ee5)

Dependencies

  • @visulima/fs: upgraded to 2.1.17
  • @visulima/path: upgraded to 1.0.8

@visulima/find-cache-dir 1.0.9 (2024-09-07)

Bug Fixes

  • fixed broken chunk splitting from packem (1aaf277)

Dependencies

  • @visulima/fs: upgraded to 2.1.16
  • @visulima/path: upgraded to 1.0.7

@visulima/find-cache-dir 1.0.8 (2024-09-07)

Bug Fixes

  • added types support for node10 (604583f)

Miscellaneous Chores

  • update dev dependencies (0738f98)

Dependencies

  • @visulima/fs: upgraded to 2.1.15
  • @visulima/path: upgraded to 1.0.6

@visulima/find-cache-dir 1.0.7 (2024-08-30)

Miscellaneous Chores

  • updated dev dependencies (45c2a76)

Dependencies

  • @visulima/fs: upgraded to 2.1.14
  • @visulima/path: upgraded to 1.0.5

@visulima/find-cache-dir 1.0.6 (2024-08-08)

Dependencies

  • @visulima/fs: upgraded to 2.1.13

@visulima/find-cache-dir 1.0.5 (2024-08-04)

Dependencies

  • @visulima/fs: upgraded to 2.1.12
  • @visulima/path: upgraded to 1.0.4

@visulima/find-cache-dir 1.0.4 (2024-08-01)

Bug Fixes

  • upgraded @visulima/packem (dc0cb57)

Miscellaneous Chores

  • updated dev dependencies (ac67ec1)
  • updated dev dependencies and sorted the package.json (9571572)

Dependencies

  • @visulima/fs: upgraded to 2.1.11
  • @visulima/path: upgraded to 1.0.3

@visulima/find-cache-dir 1.0.3 (2024-07-02)

Miscellaneous Chores

  • changed typescript version back to 5.4.5 (55d28bb)

Dependencies

  • @visulima/fs: upgraded to 2.1.10

@visulima/find-cache-dir 1.0.2 (2024-07-02)

Miscellaneous Chores

  • updated dev dependencies (34df456)

Dependencies

  • @visulima/fs: upgraded to 2.1.9

@visulima/find-cache-dir 1.0.1 (2024-07-01)

Styles

Dependencies

  • @visulima/fs: upgraded to 2.1.8

@visulima/find-cache-dir 1.0.0 (2024-06-20)

Features

  • find-cache-dir: a new package out of package find-cache functions (b9a2728)

Styles

  • cs fixes found by eslint and prettier (69ef744)

Miscellaneous Chores

  • find-cache-dir: fixed tests (2b886fe)
  • package: added removed files back (753c10c)