{"_id":"@bitfinex/bfx-facs-ttlcache-fs","name":"@bitfinex/bfx-facs-ttlcache-fs","dist-tags":{"latest":"2.0.0"},"versions":{"2.0.0":{"name":"@bitfinex/bfx-facs-ttlcache-fs","version":"2.0.0","private":false,"description":"Bitfinex TTLCache FS Fac","author":{"name":"Michal Kralik","email":"michal.kralik@bitfinex.com"},"keywords":["bitfinex","ttlcache","fs"],"scripts":{"test":"mocha"},"dependencies":{"@bitfinex/bfx-facs-base":"git+https://github.com/bitfinexcom/bfx-facs-base.git","@isaacs/ttlcache":"1.2.2"},"devDependencies":{"mocha":"10.2.0","standard":"17.1.2"},"engines":{"node":">=16.0"},"main":"index.js","license":"Apache-2.0","repository":{"type":"git","url":"git+https://github.com/bitfinexcom/bfx-facs-ttlcache-fs.git"},"homepage":"https://github.com/bitfinexcom/bfx-facs-ttlcache-fs","maintainers":[{"name":"vigan-abd","email":"vigan.abd@gmail.com"},{"name":"bitfinexorg","email":"paolo@bitfinex.com"},{"name":"prdn","email":"paolo.ardoino@gmail.com"},{"name":"mafintosh","email":"mathiasbuus@gmail.com"}],"_id":"@bitfinex/bfx-facs-ttlcache-fs@2.0.0","gitHead":"79ed22348d96b3149daa37dba9f7f4cc0a3d4897","bugs":{"url":"https://github.com/bitfinexcom/bfx-facs-ttlcache-fs/issues"},"_nodeVersion":"18.20.4","_npmVersion":"10.7.0","dist":{"integrity":"sha512-u7Kdn/rwSB0zN+V6AUxgNjISUj+DgoFRMP+4yxHtnD+4tGTouBwmts+DpyGumiYjtXWFwwzyrfKxl4VfUPOAdQ==","shasum":"8d74ec424439d207857ab9bb5a8c84570f478be2","tarball":"https://registry.npmjs.org/@bitfinex/bfx-facs-ttlcache-fs/-/bfx-facs-ttlcache-fs-2.0.0.tgz","fileCount":3,"unpackedSize":4733,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCICrtOPihfFKmmk+Es/Ei3Bx0bAaqfCU3aaLNDqvTAePPAiAii24S8iD6wTKEXm9U98unDMxR3KKB0eRCDFo4XQUUuQ=="}]},"_npmUser":{"name":"vigan-abd","email":"vigan.abd@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/bfx-facs-ttlcache-fs_2.0.0_1772715077209_0.40107668132402563"},"_hasShrinkwrap":false}},"time":{"created":"2026-03-05T12:51:17.106Z","2.0.0":"2026-03-05T12:51:17.345Z","modified":"2026-03-05T12:51:17.561Z"},"maintainers":[{"name":"vigan-abd","email":"vigan.abd@gmail.com"},{"name":"bitfinexorg","email":"paolo@bitfinex.com"},{"name":"prdn","email":"paolo.ardoino@gmail.com"},{"name":"mafintosh","email":"mathiasbuus@gmail.com"}],"description":"Bitfinex TTLCache FS Fac","homepage":"https://github.com/bitfinexcom/bfx-facs-ttlcache-fs","keywords":["bitfinex","ttlcache","fs"],"repository":{"type":"git","url":"git+https://github.com/bitfinexcom/bfx-facs-ttlcache-fs.git"},"author":{"name":"Michal Kralik","email":"michal.kralik@bitfinex.com"},"bugs":{"url":"https://github.com/bitfinexcom/bfx-facs-ttlcache-fs/issues"},"license":"Apache-2.0","readme":"# TTL Cache with file system storage\n\nA time-based cache with support for storing large objects in a file system instead of memory.\n\n## Quick start\n\n```js\nthis.setInitFacs([\n  ['fac', 'bfx-facs-ttlcache-fs', '0', '0', {\n      cache: {\n        max: 300, // max 300 objects\n        ttl: 3600 * 1000 // 1h\n      }\n  }],\n])\n\nconst largeBlockObject = {\n  txs: [...]\n}\n\nawait this.ttlcacheFs_0.set('block-123', largeBlockObject)\nconst block = await this.ttlcacheFs_0.get('block-123')\n\n// block has the same value as the largeBlockObject variable set previously\n```\n\n## How it works?\n\nThe facility uses TTL Cache to expire keys and automatically remove cached files from the file system\nonce the key expires.\nThe stored value is stringified with JSON and saved to disk.\nThe value returned from the cache is parsed and returned as provided to the cache.\n\n## Configuration\n\nDuring initialization, the following options, with their defaults, are supported:\n```js\n{\n  directory: \"./cache/data\",    // Directory where to store cached files\n  deleteCacheDirOnStart: true,  // True to delete cache on startup\n  cache: {                      // Options object passed to TTLCache on startup. See https://github.com/isaacs/ttlcache for more details\n    max: 1000,                  // Maximum number of objects in cache\n    ttl: 3600 * 1000,           // TTL for objects\n  },\n}\n```\n","readmeFilename":"README.md","_rev":"1-4c8d7e1fc0d5a347e4d06db30693d68c"}