-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.ts
28 lines (26 loc) · 981 Bytes
/
index.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
export const VERSION = "0.1.0";
// New cache implementations - recommended
export type { ICache, CacheableFunction } from "./cache/base";
export { Cache } from "./cache/base";
export { SingleJsonCache } from "./cache/json-cache";
export { FileSQLiteCache } from "./cache/file-sqlite-cache";
/**
* @deprecated Use SingleJsonCache or FileSQLiteCache instead. This function will be removed in a future version.
* Example migration:
* ```typescript
* // Old usage:
* import { cache } from 'rumrunner';
* const cachedFn = cache("name:1", myFunction);
*
* // New usage with JSON file:
* import { SingleJsonCache } from 'rumrunner';
* const jsonCache = new SingleJsonCache();
* const cachedFn = jsonCache.wrap("name:1", myFunction);
*
* // New usage with SQLite:
* import { FileSQLiteCache } from 'rumrunner';
* const sqliteCache = new FileSQLiteCache("./cache.db");
* const cachedFn = sqliteCache.wrap("name:1", myFunction);
* ```
*/
export { cache } from "./cache";