https://github.com/heapwolf/readfilecache
does exactly what you think it does
https://github.com/heapwolf/readfilecache
Last synced: 4 months ago
JSON representation
does exactly what you think it does
- Host: GitHub
- URL: https://github.com/heapwolf/readfilecache
- Owner: heapwolf
- Created: 2013-11-24T01:45:39.000Z (almost 12 years ago)
- Default Branch: master
- Last Pushed: 2013-12-01T20:04:54.000Z (almost 12 years ago)
- Last Synced: 2025-06-30T11:54:38.415Z (4 months ago)
- Language: JavaScript
- Homepage:
- Size: 112 KB
- Stars: 0
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# SYNOPSIS
Returns data from fs.readFile or memory conditional on the mtime from an fs.stat.
# USAGE
```js
//
// create a cache instance
//
var cache = require('readfilecache')()
//
// 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()
```