1.0.28 • Published 4 months ago

@visulima/find-cache-dir v1.0.28

Weekly downloads
-
License
MIT
Repository
github
Last release
4 months ago

typescript-image npm-image license-image



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

typescript-url: https://www.typescriptlang.org/ "TypeScript" "typescript"

1.0.26

5 months ago

1.0.25

5 months ago

1.0.24

5 months ago

1.0.23

5 months ago

1.0.28

4 months ago

1.0.27

4 months ago

1.0.22

5 months ago

1.0.21

6 months ago

1.0.19

6 months ago

1.0.20

6 months ago

1.0.18

6 months ago

1.0.17

6 months ago

1.0.16

7 months ago

1.0.15

8 months ago

1.0.14

9 months ago

1.0.13

9 months ago

1.0.12

9 months ago

1.0.11

9 months ago

1.0.9

10 months ago

1.0.8

10 months ago

1.0.7

10 months ago

1.0.10

10 months ago

1.0.6

11 months ago

1.0.5

11 months ago

1.0.4

11 months ago

1.0.3

12 months ago

1.0.2

12 months ago

1.0.1

12 months ago

1.0.0

1 year ago