cachedir

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

MIT 15 个版本
安装
npm install cachedir
yarn add cachedir
pnpm add cachedir
bun add cachedir
README

node-cachedir

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

Installation

npm install --save cachedir

Usage

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.

版本列表
2.4.0 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