4.0.1 • Published 2 months ago

cache-path v4.0.1

Weekly downloads
11
License
ISC
Repository
github
Last release
2 months ago

README

return a cache directory, like `find-cache-dir` do

install

npm install cache-path

desc

like find-cache-dir

what diff

  1. return path at any env
    find-cache-dir will fail return when not runing at a module/package folder
  2. allow change to ur fav order for find cache path

demo

API

there also has async version for getCachePath => getCachePathAsync

import { normalizeName, getCachePath } from 'cache-path';

console.log(normalizeName('@node-novel/sort'));
// => _node_novel_sort
console.log(normalizeName('@node-novel/sort', true));
// => 7bc015f2

// when cwd in a module/package
console.log(getCachePath());
// => D:\Users\Documents\The Project\nodejs-yarn\ws-segment\packages\cache-path\node_modules\.cache
console.log(getCachePath('@node-novel/sort'));
// => D:\Users\Documents\The Project\nodejs-yarn\ws-segment\packages\cache-path\node_modules\.cache\_node_novel_sort

// when other
console.log(getCachePath());
// => T:\cache\npm-cache\.cache
console.log(getCachePath('@node-novel/sort'));
// => T:\cache\npm-cache\.cache\_node_novel_sort
4.0.1

2 months ago

4.0.0

7 months ago

3.0.14

1 year ago

3.0.12

2 years ago

3.0.13

1 year ago

3.0.10

2 years ago

3.0.11

2 years ago

3.0.8

2 years ago

3.0.7

2 years ago

3.0.6

2 years ago

3.0.9

2 years ago

3.0.4

2 years ago

3.0.3

2 years ago

3.0.2

2 years ago

3.0.1

2 years ago

3.0.5

2 years ago

3.0.0

2 years ago

2.0.39

2 years ago

2.0.35

2 years ago

2.0.33

2 years ago

2.0.34

2 years ago

2.0.32

2 years ago

2.0.28

2 years ago

2.0.29

2 years ago

2.0.30

2 years ago

2.0.26

2 years ago

2.0.27

2 years ago

2.0.24

2 years ago

2.0.25

2 years ago

2.0.23

2 years ago

2.0.22

3 years ago

2.0.21

3 years ago

2.0.20

3 years ago

2.0.19

3 years ago

2.0.17

3 years ago

2.0.18

3 years ago

2.0.16

3 years ago

2.0.13

3 years ago

2.0.14

3 years ago

2.0.11

3 years ago

2.0.10

3 years ago

2.0.9

3 years ago

2.0.8

3 years ago

2.0.7

3 years ago

2.0.6

3 years ago

2.0.5

4 years ago

2.0.3

4 years ago

2.0.2

4 years ago

2.0.4

4 years ago

2.0.1

4 years ago

1.0.4

5 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago