@mysetup/cache 2.0.1 → 2.0.4

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 ADDED
@@ -0,0 +1,32 @@
1
+ # @mysetup/cache
2
+
3
+ Thin wrapper around `node-cache` for in-memory key/value storage.
4
+
5
+ ## Installation
6
+
7
+ ```bash
8
+ pnpm add @mysetup/cache
9
+ ```
10
+
11
+ ## Supported libraries and runtimes
12
+
13
+ | Supported | Notes |
14
+ | ---------------------- | ------------------------------------------------------ |
15
+ | Node.js | Full support |
16
+ | Next.js server runtime | Use in route handlers, server actions, or backend code |
17
+ | Vite browser apps | Not supported |
18
+
19
+ ## Usage
20
+
21
+ ```ts
22
+ import { setCacheData, getCacheData, deleteCacheData } from "@mysetup/cache";
23
+
24
+ setCacheData("session:user:1", { id: 1 }, 60);
25
+ const session = getCacheData("session:user:1");
26
+ deleteCacheData("session:user:1");
27
+ ```
28
+
29
+ ## Notes
30
+
31
+ - Cache data is stored in process memory.
32
+ - Do not rely on this package for distributed caching across multiple servers.
package/dist/cache.d.ts CHANGED
@@ -2,4 +2,3 @@ declare const setCacheData: (key: string, value: unknown, expiry?: number) => vo
2
2
  declare const getCacheData: (key: string) => unknown;
3
3
  declare const deleteCacheData: (key: string) => number;
4
4
  export { setCacheData, getCacheData, deleteCacheData };
5
- //# sourceMappingURL=cache.d.ts.map
package/dist/index.d.ts CHANGED
@@ -1,2 +1 @@
1
1
  export * from "./cache";
2
- //# sourceMappingURL=index.d.ts.map
package/package.json CHANGED
@@ -1,40 +1,52 @@
1
1
  {
2
- "name": "@mysetup/cache",
3
- "version": "2.0.1",
4
- "license": "MIT",
5
- "main": "dist/index.js",
6
- "files": [
7
- "dist"
8
- ],
9
- "exports": {
10
- ".": {
11
- "types": "./dist/index.d.ts",
12
- "import": "./dist/index.js",
13
- "require": "./dist/index.js"
14
- },
15
- "./package.json": "./package.json"
2
+ "name": "@mysetup/cache",
3
+ "version": "2.0.4",
4
+ "description": "Shared in-memory cache helpers built on top of node-cache.",
5
+ "author": "krishnaraj <krishnaraj.webdev@gmail.com>",
6
+ "license": "MIT",
7
+ "keywords": [
8
+ "cache",
9
+ "node-cache",
10
+ "nodejs",
11
+ "typescript"
12
+ ],
13
+ "publishConfig": {
14
+ "access": "public"
15
+ },
16
+ "main": "dist/index.js",
17
+ "types": "dist/index.d.ts",
18
+ "sideEffects": false,
19
+ "files": [
20
+ "dist"
21
+ ],
22
+ "exports": {
23
+ ".": {
24
+ "types": "./dist/index.d.ts",
25
+ "import": "./dist/index.js",
26
+ "require": "./dist/index.js"
16
27
  },
17
- "scripts": {
18
- "lint": "eslint .",
19
- "typecheck": "tsc --noEmit",
20
- "build": "rm -rf ./dist && tsc",
21
- "format": "prettier --write \"**/*.{ts,tsx,md,js}\"",
22
- "checks": "pnpm typecheck && pnpm lint",
23
- "clean": "rm -rf node_modules .swc dist pnpm-lock.yaml && echo \"✅ Successfully removed \""
24
- },
25
- "dependencies": {
26
- "node-cache": "^5.1.2"
27
- },
28
- "devDependencies": {
29
- "@mysetup/eslint-config": "latest",
30
- "@mysetup/prettier-config": "latest",
31
- "@mysetup/tsconfig": "latest",
32
- "@types/node": "^22.13.1",
33
- "typescript": "5.5.4"
34
- },
35
- "prettier": "@mysetup/prettier-config",
36
- "engines": {
37
- "node": ">=20.15.1"
38
- },
39
- "packageManager": "pnpm@9.9.0"
40
- }
28
+ "./package.json": "./package.json"
29
+ },
30
+ "dependencies": {
31
+ "node-cache": "^5.1.2"
32
+ },
33
+ "devDependencies": {
34
+ "@types/node": "^22.13.1",
35
+ "typescript": "5.5.4",
36
+ "@mysetup/prettier-config": "^2.0.4",
37
+ "@mysetup/eslint-config": "^2.0.5",
38
+ "@mysetup/tsconfig": "^2.0.4"
39
+ },
40
+ "prettier": "@mysetup/prettier-config",
41
+ "engines": {
42
+ "node": ">=20.15.1"
43
+ },
44
+ "scripts": {
45
+ "lint": "node ../scripts/run-eslint.cjs .",
46
+ "typecheck": "tsc --noEmit",
47
+ "build": "node ../scripts/package-fs.cjs remove dist && tsc",
48
+ "format": "prettier --write \"**/*.{ts,tsx,md,js}\"",
49
+ "checks": "pnpm typecheck && pnpm lint && pnpm build",
50
+ "clean": "node ../scripts/package-fs.cjs remove node_modules .swc dist pnpm-lock.yaml && echo \"Cleaned\""
51
+ }
52
+ }
@@ -1 +0,0 @@
1
- {"version":3,"file":"cache.d.ts","sourceRoot":"","sources":["../cache.ts"],"names":[],"mappings":"AAKA,QAAA,MAAM,YAAY,QAAS,MAAM,SAAS,OAAO,WAAW,MAAM,SAMjE,CAAC;AAGF,QAAA,MAAM,YAAY,QAAS,MAAM,YAEhC,CAAC;AAGF,QAAA,MAAM,eAAe,QAAS,MAAM,WAEnC,CAAC;AAEF,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,eAAe,EAAE,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC"}