verifiable-file-read-all-cache

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


Keywords
cache, fs, file, file cache, fi
License
BSL-1.0
Install
npm install verifiable-file-read-all-cache@1.1.2

Documentation

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