1.0.0 • Published 2 years ago

sgcachedfile v1.0.0

Weekly downloads
-
License
ISC
Repository
-
Last release
2 years ago

Usage

check src or output changed by mtime and fileSize cache.

const { SgCachedLib } = require("sgcachedfile");

(async () => {
    // create a lib with stat cache file
    const testLib = new SgCachedLib("testDBs")

    // create a out file from lib
    let out = testLib.createOut();

    // write datas
    let arr = new Uint8Array(64 * 1023).fill(48);
    console.log("write arr", out.write(arr));
    console.log("write string", out.write("String"));

    // close files
    console.log("close file", await out.close("test.txt"))

    // close lib
    console.log("close lib", testLib.close());
})();