0.1.0 • Published 10 years ago
readfilecache v0.1.0
SYNOPSIS
Returns data from fs.readFile or memory conditional on the mtime from an fs.stat.
USAGE
//
// create a cache instance
//
var cache = require('reafilecache')()
//
// read a file, a call to the same path will return
// the data from memory if the mtime is the same
// on the file as it is in memory.
//
cache.readFile(filename, function(err, data, stat) {
// err or null, the data from the file and the stat info
})
//
// supports a sync api as well
//
cache.readFileSync(filename) // returns the file
//
// clear the cache
//
cache.invalidate()
0.1.0
10 years ago