3 Given a cache folder and url, return the appropriate cache folder.
8 var cf = require('npm-cache-filename');
9 console.log(cf('/tmp/cache', 'https://registry.npmjs.org:1234/foo/bar'));
10 // outputs: /tmp/cache/registry.npmjs.org_1234/foo/bar
13 As a bonus, you can also bind it to a specific root path:
16 var cf = require('npm-cache-filename');
17 var getFile = cf('/tmp/cache');
19 console.log(getFile('https://registry.npmjs.org:1234/foo/bar'));
20 // outputs: /tmp/cache/registry.npmjs.org_1234/foo/bar