node package manager

Introducing npm Enterprise add-ons. Integrate third-party dev tools into npm…


Store and get files from cache

Store and get files from cache with Node.js.

Install with npm: npm install cache-file

var cache = require('cache-file');
// store test.jpg inside a test folder in cache'test.jpg');
// get test.jpg from cache and save it as test-restored.jpg 
cache.get('test.jpg', 'test-restored.jpg');
// check if test.jpg exists in cache 
// get the path to test.jpg in cache 
// remove test.jpg from cache 

Store a file inside cache. Use dest to specify a custom name.

Get a cached file and save it to a desired location.

Check if a cached file exists.

Get the path to a cached file.

Remove a file from cache.

MIT License (c) Kevin Mårtensson