@resolid/cache-file 0.1.0 → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -5,6 +5,29 @@
5
5
 
6
6
  <b>[Documentation](https://www.resolid.tech/docs/cache)</b> | [Framework Bundle](https://github.com/resolid/framework)
7
7
 
8
+ A simple file-based cache implementation for Node.js with TTL support and concurrency-safe locks.
9
+
10
+ ## Installation
11
+
12
+ ```shell
13
+ pnpm add @resolid/cache @resolid/cache-file
14
+ # or
15
+ npm install @resolid/cache @resolid/cache-file
16
+ # or
17
+ yarn add @resolid/cache @resolid/cache-file
18
+ # or
19
+ bun add @resolid/cache @resolid/cache-file
20
+ ```
21
+
22
+ ## Usage
23
+
24
+ ```ts
25
+ import { Cacher } from "@resolid/cache";
26
+ import { FileCache } from "@resolid/cache";
27
+
28
+ const cache = new Cacher({ store: new FileCache("./.tmp/cache"), defaultTtl: 1000 });
29
+ ```
30
+
8
31
  ## License
9
32
 
10
33
  MIT License (MIT). Please see [LICENSE](./LICENSE) for more information.
package/dist/index.d.mts CHANGED
@@ -1,4 +1,4 @@
1
- import { CacheStore } from "@resolid/cache/types";
1
+ import { CacheStore } from "@resolid/cache/stores";
2
2
 
3
3
  //#region src/index.d.ts
4
4
  declare class FileCache implements CacheStore {
package/package.json CHANGED
@@ -1,57 +1,55 @@
1
1
  {
2
2
  "name": "@resolid/cache-file",
3
- "version": "0.1.0",
3
+ "version": "1.0.0",
4
4
  "private": false,
5
5
  "description": "File Cache store for @resolid/cache",
6
6
  "keywords": [
7
- "resolid",
8
7
  "cache",
9
8
  "cache manager",
10
- "file"
9
+ "file",
10
+ "resolid"
11
11
  ],
12
12
  "homepage": "https://www.resolid.tech",
13
- "repository": {
14
- "type": "git",
15
- "url": "git+https://github.com/resolid/framework.git",
16
- "directory": "packages/cache-file"
17
- },
18
13
  "license": "MIT",
19
14
  "author": {
20
15
  "name": "Huijie Wei",
21
16
  "email": "hello@resolid.tech"
22
17
  },
23
- "sideEffects": false,
18
+ "repository": {
19
+ "type": "git",
20
+ "url": "git+https://github.com/resolid/framework.git",
21
+ "directory": "packages/cache-file"
22
+ },
23
+ "files": [
24
+ "dist"
25
+ ],
24
26
  "type": "module",
27
+ "sideEffects": false,
28
+ "types": "./dist/index.d.mts",
25
29
  "exports": {
26
30
  ".": {
27
31
  "types": "./dist/index.d.mts",
28
32
  "import": "./dist/index.mjs"
29
33
  }
30
34
  },
31
- "main": "./dist/index.mjs",
32
- "types": "./dist/index.d.mts",
33
- "files": [
34
- "dist"
35
- ],
36
- "scripts": {
37
- "build": "tsdown",
38
- "lint": "eslint .",
39
- "test": "vitest run",
40
- "typecheck": "tsc --noEmit"
35
+ "publishConfig": {
36
+ "access": "public",
37
+ "provenance": true
41
38
  },
42
- "dependencies": {},
43
39
  "devDependencies": {
44
- "tsdown": "^0.16.3",
40
+ "tsdown": "^0.20.3",
45
41
  "typescript": "^5.9.3"
46
42
  },
47
43
  "peerDependencies": {
48
- "@resolid/cache": "workspace:^"
44
+ "@resolid/cache": "^1.0.0"
49
45
  },
50
46
  "engines": {
51
- "node": "^20.19.0 || ^22.13.0 || >=24"
47
+ "node": "^22.13.0 || >=24"
52
48
  },
53
- "publishConfig": {
54
- "access": "public",
55
- "provenance": true
49
+ "scripts": {
50
+ "build": "tsdown",
51
+ "lint": "oxlint",
52
+ "test": "vitest run",
53
+ "typecheck": "tsc --noEmit"
56
54
  }
57
- }
55
+ }