{"_id":"@alexmchan/memocache-store-libsql","_rev":"3-9b546e4959b1c3133d567da49cd7ef98","name":"@alexmchan/memocache-store-libsql","dist-tags":{"latest":"1.0.0"},"versions":{"0.8.0":{"name":"@alexmchan/memocache-store-libsql","version":"0.8.0","_id":"@alexmchan/memocache-store-libsql@0.8.0","maintainers":[{"name":"alexanderchan","email":"alexander.m.chan@gmail.com"}],"homepage":"https://github.com/alexmchan/memocache#readme","bugs":{"url":"https://github.com/alexmchan/memocache/issues"},"dist":{"shasum":"b7327578816e96d5d27e5f685376a302c33086ae","tarball":"https://registry.npmjs.org/@alexmchan/memocache-store-libsql/-/memocache-store-libsql-0.8.0.tgz","fileCount":22,"integrity":"sha512-Sab4v1TJqFe/6LB+/Q9kIySjFe/4/Jq4ZkHcVDGOOPovcESLY7choh0/RDKOgvU+ZeLZDYVWyynsSpvyz47Y7g==","signatures":[{"sig":"MEQCIA8WhDQtdAbvgDmeXvs7Uhal70xB/EzfHbP2VbfT+r4wAiBWYdhXi3O2wPXP0SDz+gHoV0Yyc2bj36AlKGq7ln7Oyw==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":44333},"main":"dist/index.js","type":"module","_from":"file:alexmchan-memocache-store-libsql-0.8.0.tgz","types":"dist/index.d.ts","exports":{".":{"import":"./dist/index.js","default":"./dist/index.cjs"}},"private":false,"scripts":{"lint":"eslint .","test":"vitest run","build":"tsup","typecheck":"tsc --noEmit","test:watch":"vitest --watch","check-exports":"yarn pack --out ./ignore-package.tgz && yarn attw ./ignore-package.tgz && rm ./ignore-package.tgz"},"_npmUser":{"name":"alexanderchan","email":"alexander.m.chan@gmail.com"},"_resolved":"/private/var/folders/7z/p1d5g8xj233bp74pfgx6fykh0000gp/T/1262ebdc0144687824501da6caa096a7/alexmchan-memocache-store-libsql-0.8.0.tgz","_integrity":"sha512-Sab4v1TJqFe/6LB+/Q9kIySjFe/4/Jq4ZkHcVDGOOPovcESLY7choh0/RDKOgvU+ZeLZDYVWyynsSpvyz47Y7g==","repository":{"url":"git+https://github.com/alexmchan/memocache.git","type":"git"},"_npmVersion":"10.9.2","description":"This package provides a LibSQL store implementation for the [@alexmchan/memocache](https://github.com/alexmchan/memocache) caching library. It allows you to use [LibSQL](https://github.com/libsql/libsql) (Turso) as a persistent storage backend for your ca","directories":{},"_nodeVersion":"22.13.0","dependencies":{"superjson":"^2.2.2","@libsql/client":"^0.15.2","@upstash/redis":"^1.34.7","@alexmchan/memocache-common":"^0.7.0"},"publishConfig":{"registry":"https://npm.pkg.github.com"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.4.0","vitest":"^3.1.1","typescript":"^5.8.3","typescript-eslint":"^8.29.0","@repo/eslint-config":"^0.2.0","vite-tsconfig-paths":"^5.1.4","@alexmchan/memocache":"^0.10.0","@testcontainers/redis":"^10.24.0"},"_npmOperationalInternal":{"tmp":"tmp/memocache-store-libsql_0.8.0_1744039274957_0.4886737442538709","host":"s3://npm-registry-packages-npm-production"},"deprecated":"Removed in favor of @alexmchan/memocache-store-sqlite (stdlib node:sqlite, zero deps). Remote libsql:// is no longer supported."},"1.0.0":{"name":"@alexmchan/memocache-store-libsql","version":"1.0.0","_id":"@alexmchan/memocache-store-libsql@1.0.0","maintainers":[{"name":"alexanderchan","email":"alexander.m.chan@gmail.com"}],"homepage":"https://github.com/alexmchan/memocache#readme","bugs":{"url":"https://github.com/alexmchan/memocache/issues"},"dist":{"shasum":"33ef99adef31419f4238076c14dfc352a383113a","tarball":"https://registry.npmjs.org/@alexmchan/memocache-store-libsql/-/memocache-store-libsql-1.0.0.tgz","fileCount":21,"integrity":"sha512-CNNq79KRZLkKsXZNeOs8J36T2M00qGW5yP+RQSGbCmnreDXPIwqysGQr1j/I5eC60cl5cdtMB2GQamKPHdYBFQ==","signatures":[{"sig":"MEQCIDvJvnIaY90qzMc96bQsXkrTZP6/cW/a/2TECFXPHPC5AiB/h2Zw5n6IB6YmXky/CgH1+91sga61emo/GtJF90tY7g==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":46242},"main":"dist/index.js","type":"module","_from":"file:alexmchan-memocache-store-libsql-1.0.0.tgz","types":"dist/index.d.ts","exports":{".":{"import":"./dist/index.js","default":"./dist/index.cjs"}},"private":false,"scripts":{"lint":"biome check .","test":"vitest run","build":"tsup","coverage":"vitest run --coverage","lint:fix":"biome check --write .","typecheck":"tsc --noEmit","test:watch":"vitest --watch","check-exports":"yarn pack --out ./ignore-package.tgz && yarn attw ./ignore-package.tgz && rm ./ignore-package.tgz"},"_npmUser":{"name":"alexanderchan","email":"alexander.m.chan@gmail.com"},"_resolved":"/private/var/folders/r7/v6yxz7l93hj4jz_lp08p8fbh0000gn/T/e4c66e728d2b70861bcceafc824e6803/alexmchan-memocache-store-libsql-1.0.0.tgz","_integrity":"sha512-CNNq79KRZLkKsXZNeOs8J36T2M00qGW5yP+RQSGbCmnreDXPIwqysGQr1j/I5eC60cl5cdtMB2GQamKPHdYBFQ==","repository":{"url":"git+https://github.com/alexmchan/memocache.git","type":"git"},"_npmVersion":"11.6.0","description":"This package provides a LibSQL store implementation for the [@alexmchan/memocache](https://github.com/alexmchan/memocache) caching library. It allows you to use [LibSQL](https://github.com/libsql/libsql) (Turso) as a persistent storage backend for your ca","directories":{},"_nodeVersion":"22.14.0","dependencies":{"superjson":"^2.2.6","@libsql/client":"^0.17.0","@upstash/redis":"^1.37.0","@alexmchan/memocache-common":"^1.0.0"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.5.1","vitest":"^4.1.0","typescript":"^5.9.3","@vitest/coverage-v8":"^4.1.0","vite-tsconfig-paths":"^6.1.1","@alexmchan/memocache":"^1.0.0","@testcontainers/redis":"^11.12.0"},"_npmOperationalInternal":{"tmp":"tmp/memocache-store-libsql_1.0.0_1773520542770_0.493115967936983","host":"s3://npm-registry-packages-npm-production"},"deprecated":"Removed in favor of @alexmchan/memocache-store-sqlite (stdlib node:sqlite, zero deps). Remote libsql:// is no longer supported."}},"time":{"created":"2025-04-07T15:21:14.847Z","modified":"2026-07-14T17:19:28.948Z","0.8.0":"2025-04-07T15:21:15.306Z","1.0.0":"2026-03-14T20:35:42.920Z"},"bugs":{"url":"https://github.com/alexmchan/memocache/issues"},"homepage":"https://github.com/alexmchan/memocache#readme","repository":{"url":"git+https://github.com/alexmchan/memocache.git","type":"git"},"description":"This package provides a LibSQL store implementation for the [@alexmchan/memocache](https://github.com/alexmchan/memocache) caching library. It allows you to use [LibSQL](https://github.com/libsql/libsql) (Turso) as a persistent storage backend for your ca","maintainers":[{"name":"alexanderchan","email":"alexander.m.chan@gmail.com"}],"readme":"## LibSQL Store for Memocache\n\nThis package provides a LibSQL store implementation for the [@alexmchan/memocache](https://github.com/alexmchan/memocache) caching library. It allows you to use [LibSQL](https://github.com/libsql/libsql) (Turso) as a persistent storage backend for your cache.\n\n## Installation\n\n```bash\npnpm install @alexmchan/memocache-store-libsql\n```\n\n## Usage\n\n```typescript\nimport { createCache } from '@alexmchan/memocache'\nimport { Time } from '@alexmchan/memocache-common'\nimport { createClient } from '@libsql/client'\nimport { createSqliteStore } from '@alexmchan/memocache-store-libsql'\n\n// Create a LibSQL client\nconst sqliteClient = createClient({\n  url: 'file::memory:', // In-memory database\n  // Or use a file-based database:\n  // url: 'file:./cache.db',\n  // Or use Turso:\n  // url: 'https://your-database.turso.io',\n  // authToken: 'your-auth-token'\n})\n\n// Create a SQLite store\nconst sqliteStore = createSqliteStore({\n  sqliteClient,\n  cleanupInterval: 5 * Time.Minute,\n  defaultTTL: 10 * Time.Minute,\n})\n\n// Create a cache with the SQLite store\nconst cache = createCache({\n  stores: [sqliteStore],\n  defaultFresh: 1 * Time.Minute,\n  defaultTTL: 5 * Time.Minute,\n})\n\n// Use the cache\nconst { createCachedFunction } = cache\n\n// Create a cached version of a function\nconst cachedFunction = createCachedFunction(async (id) => {\n  // Some expensive operation or fetch\n  return `Result for ${id}`\n})\n\n// Use the cached function\nconst result = await cachedFunction('example')\n```\n\n## Configuration Options\n\nThe `createSqliteStore` function accepts the following options:\n\n- `sqliteClient`: An instance of `@libsql/client`. If not provided, an in-memory database will be created.\n- `tableName`: Name of the table to create. Defaults to `cache`.\n- `defaultTTL`: Default time-to-live for cache entries in milliseconds. Defaults to 5 minutes.\n- `cleanupInterval`: Interval in milliseconds for cleaning up expired entries. Defaults to 5 minutes.\n- `logger`: Custom logger implementation. Defaults to the common logger.\n\n## Features\n\n- Persistent storage for cache entries\n- Automatic cleanup of expired entries\n- Support for custom TTL per cache entry\n- Works with both in-memory and file-based SQLite databases\n- Compatible with Turso's distributed SQLite service\n\n## License\n\nSee the main project license for details.\n","readmeFilename":"README.md"}