Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/linusu/node-cachedir
Get a directory for your caching needs
https://github.com/linusu/node-cachedir
Last synced: 13 days ago
JSON representation
Get a directory for your caching needs
- Host: GitHub
- URL: https://github.com/linusu/node-cachedir
- Owner: LinusU
- License: mit
- Created: 2013-09-26T22:12:50.000Z (about 11 years ago)
- Default Branch: master
- Last Pushed: 2023-07-24T13:21:32.000Z (over 1 year ago)
- Last Synced: 2024-10-30T20:45:12.637Z (13 days ago)
- Language: JavaScript
- Size: 89.8 KB
- Stars: 26
- Watchers: 3
- Forks: 6
- Open Issues: 3
-
Metadata Files:
- Readme: readme.md
- License: license
Awesome Lists containing this project
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.