0.3.1 • Published 6 years ago

with-fs-cache v0.3.1

Weekly downloads
2
License
GPL-3.0-only
Repository
-
Last release
6 years ago

with-fs-cache

Wrap any method, sync or async with a File System Cache.

Usage

const sleep = ms => new Promise(resolve => setTimeout(resolve, ms));

const myID = await withFsCache(
  // Can be anything
  "my-id",
  async () => {
    await sleep(500);
    functionCallCount += 1;
    return { someData: "1" };
  }
);

// If called again it will return without waiting.
0.3.1

6 years ago

0.3.0

6 years ago

0.2.5

6 years ago

0.2.4

6 years ago

0.2.3

6 years ago

0.2.2

6 years ago

0.1.1

6 years ago

0.1.0

6 years ago