Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/yumetodo/verifiable-file-read-all-cache
Read file all and cache it. Also, you can verify sha-256 hash.
https://github.com/yumetodo/verifiable-file-read-all-cache
cache fi
Last synced: about 20 hours ago
JSON representation
Read file all and cache it. Also, you can verify sha-256 hash.
- Host: GitHub
- URL: https://github.com/yumetodo/verifiable-file-read-all-cache
- Owner: yumetodo
- Created: 2019-02-11T01:16:03.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2023-02-11T09:49:01.000Z (almost 2 years ago)
- Last Synced: 2025-01-21T00:51:45.733Z (4 days ago)
- Topics: cache, fi
- Language: JavaScript
- Homepage:
- Size: 610 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# verifiable-file-read-all-cache
[![CircleCI](https://circleci.com/gh/yumetodo/verifiable-file-read-all-cache.svg?style=svg)](https://circleci.com/gh/yumetodo/verifiable-file-read-all-cache) [![Known Vulnerabilities](https://snyk.io/test/github/yumetodo/verifiable-file-read-all-cache/badge.svg?targetFile=package.json)](https://snyk.io/test/github/yumetodo/verifiable-file-read-all-cache?targetFile=package.json)
Read file all and cache it. Also, you can verify sha-256 hash.
```js
import test from 'ava';
const TextCache = require('verifiable-file-read-all-cache');
const text = new TextCache(
'./path/to/file',
//sha-256 hash
'd270ba28b95e9f256ca2eb993fc0692b9d755c4b397f75ea2d5deb5cf39c49f1'
);
test('hoge', async t => {
await text.verify((actual, expected) => t.true(actual === expected));
foo(text.get());
});
```