@types/find-cache-dir

  • Version 3.2.1
  • Published
  • 7.1 kB
  • No dependencies
  • MIT license

Install

npm i @types/find-cache-dir
yarn add @types/find-cache-dir
pnpm add @types/find-cache-dir

Overview

TypeScript definitions for find-cache-dir

Index

Functions

function findCacheDir

findCacheDir: {
(options: findCacheDir.OptionsWithThunk): (...pathParts: string[]) => string;
(options: findCacheDir.Options): string;
};
  • Finds the cache directory using the supplied options. The algorithm 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.

Interfaces

interface Options

interface Options {}

    property create

    create?: boolean | undefined;
    • If true, the directory will be created synchronously before returning. false

    property cwd

    cwd?: string | undefined;
    • Directory to start searching for a package.json from.

    property files

    files?: string | string[] | undefined;
    • 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.

    property name

    name: string;
    • Should be the same as your project name in package.json.

    property thunk

    thunk?: boolean | undefined;
    • If true, this modifies the return type to be a function that is a thunk for path.join(theFoundCacheDirectory). false

    interface OptionsWithThunk

    interface OptionsWithThunk extends Options {}

      property thunk

      thunk: true;
      • If true, this modifies the return type to be a function that is a thunk for path.join(theFoundCacheDirectory). false

      Package Files (1)

      Dependencies (0)

      No dependencies.

      Dev Dependencies (0)

      No dev dependencies.

      Peer Dependencies (0)

      No peer dependencies.

      Badge

      To add a badge like this onejsDocs.io badgeto your package's README, use the codes available below.

      You may also use Shields.io to create a custom badge linking to https://www.jsdocs.io/package/@types/find-cache-dir.

      • Markdown
        [![jsDocs.io](https://img.shields.io/badge/jsDocs.io-reference-blue)](https://www.jsdocs.io/package/@types/find-cache-dir)
      • HTML
        <a href="https://www.jsdocs.io/package/@types/find-cache-dir"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>