verifiable-file-read-all-cache

Read file all and cache it. Also, you can verify sha-256 hash.

Usage no npm install needed!

<script type="module">
  import verifiableFileReadAllCache from 'https://cdn.skypack.dev/verifiable-file-read-all-cache';
</script>

README

verifiable-file-read-all-cache

CircleCI Greenkeeper badge

Read file all and cache it. Also, you can verify sha-256 hash.

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());
})