• Home
Name Date Size #Lines LOC

..--

LICENSED12-May-2024756 1612

README.mdD12-May-2024558 2215

index.jsD12-May-2024661 2518

package.jsonD12-May-20241.4 KiB5655

test.jsD12-May-2024873 2420

README.md

1# npm-cache-filename
2
3Given a cache folder and url, return the appropriate cache folder.
4
5## USAGE
6
7```javascript
8var cf = require('npm-cache-filename');
9console.log(cf('/tmp/cache', 'https://registry.npmjs.org:1234/foo/bar'));
10// outputs: /tmp/cache/registry.npmjs.org_1234/foo/bar
11```
12
13As a bonus, you can also bind it to a specific root path:
14
15```javascript
16var cf = require('npm-cache-filename');
17var getFile = cf('/tmp/cache');
18
19console.log(getFile('https://registry.npmjs.org:1234/foo/bar'));
20// outputs: /tmp/cache/registry.npmjs.org_1234/foo/bar
21```
22