# cachedir

> Provides a directory where the OS wants you to store cached files.

Latest version **2.4.0** (published 2023-07-24) · MIT license · 0 weekly downloads

## Install

```sh
npm install cachedir
pnpm add cachedir
yarn add cachedir
bun add cachedir
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.4.0 |
| Published | 2023-07-24 |
| First published | 2013-09-26 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Node | >=6 |
| Dependencies | 0 |
| Unpacked size | 6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 26 |
| Author | Linus Unnebäck |
| Maintainers | linusu |

## Links

- npm: https://www.npmjs.com/package/cachedir
- Repository: https://github.com/LinusU/node-cachedir
- Homepage: https://github.com/LinusU/node-cachedir#readme
- Issues: https://github.com/LinusU/node-cachedir/issues
- npm.io page: https://npm.io/package/cachedir

## Recent versions

- 2.4.0 (latest) — 2023-07-24
- 2.3.0 — 2019-11-17
- 2.2.0 — 2019-03-13
- 2.1.0 — 2018-08-31
- 2.0.0 — 2018-06-12
- 1.3.0 — 2018-06-12
- 1.2.0 — 2018-01-10
- 1.1.1 — 2016-12-25
- 1.1.0 — 2016-12-12
- 1.0.0 — 2016-04-03
- 0.1.4 — 2016-04-03
- 0.1.3 — 2016-04-03
- 0.1.2 — 2016-04-03
- 0.1.1 — 2014-12-10
- 0.1.0 — 2013-09-26

## README

# node-cachedir

Provides a directory where the OS wants you to store cached files.

## Installation

```sh
npm install --save cachedir
```

## Usage

```javascript
const cachedir = require('cachedir')

console.log(cachedir('myapp'))
// e.g.
//=> '/Users/linus/Library/Caches/myapp'
//=> '/home/linus/.cache/myapp'
//=> 'C:\Users\linus\AppData\Local\myapp\Cache'
```

## API

### `cachedir(id)`

- `id` (`string`, required)
- returns `string`

Return path to an appropriate place to store cache files.

---
_Source: https://npm.io/package/cachedir · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
