read-cache
Reads and caches the entire contents of a file until it is modified
Last updated 3 months ago by GitHub Actions .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ npm install read-cache 
SYNC missed versions from official npm registry.

read-cache CI

Reads and caches the entire contents of a file until it is modified.

Install

$ npm i read-cache

Usage

// foo.js
var readCache = require('read-cache');

readCache('foo.js').then(function (contents) {
	console.log(contents);
});

API

readCache(path[, encoding])

Returns a promise that resolves with the file's contents.

readCache.sync(path[, encoding])

Returns the content of the file.

readCache.get(path[, encoding])

Returns the content of cached file or null.

readCache.clear()

Clears the contents of the cache.

License

MIT © Bogdan Chadkin

Current Tags

  • 1.0.2                                ...           latest (3 months ago)

3 Versions

  • 1.0.2                                ...           3 months ago
  • 1.0.1                                ...           3 months ago
  • 1.0.0                                ...           11 years ago
Maintainers (1)
Downloads
Total 14
Today 0
This Week 0
This Month 3
Last Day 0
Last Week 2
Last Month 0
Dependencies (0)
None
Dev Dependencies (0)
None

© 2010 - cnpmjs.org x YWFE | Home | YWFE