source: trip-planner-front/node_modules/read-cache/README.md@ 1ad8e64

Last change on this file since 1ad8e64 was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago

initial commit

  • Property mode set to 100644
File size: 771 bytes
Line 
1# read-cache [![Build Status](https://travis-ci.org/TrySound/read-cache.svg?branch=master)](https://travis-ci.org/TrySound/read-cache)
2
3Reads and caches the entire contents of a file until it is modified.
4
5
6## Install
7
8```
9$ npm i read-cache
10```
11
12
13## Usage
14
15```js
16// foo.js
17var readCache = require('read-cache');
18
19readCache('foo.js').then(function (contents) {
20 console.log(contents);
21});
22```
23
24
25## API
26
27### readCache(path[, encoding])
28
29Returns a promise that resolves with the file's contents.
30
31### readCache.sync(path[, encoding])
32
33Returns the content of the file.
34
35### readCache.get(path[, encoding])
36
37Returns the content of cached file or null.
38
39### readCache.clear()
40
41Clears the contents of the cache.
42
43
44## License
45
46MIT © [Bogdan Chadkin](mailto:trysound@yandex.ru)
Note: See TracBrowser for help on using the repository browser.