Registry / storage / flac
library0.3.0jsnpmunverified

FLAC (Find, Load and make the Cache) is a file caching utility for Node.js that simplifies finding, loading, and caching data. Version 0.3.0, with Node.js >=0.4. It provides a simple API to manage file-based cache with automatic loading and caching of data from files. Not actively maintained; consider using modern alternatives like node-cache-manager.

npm install flac
INSTALL
IMPORT
SIG · FLAC
F
flac
storagejavascriptv0.3.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

default
✓ import flac from 'flac'
✗ const flac = require('flac')
ESM import syntax; CJS require may work but ESM is recommended.
Flac
✓ import { Flac } from 'flac'
✗ import Flac from 'flac'
Named export for the Flac class; default export also exists.
find
✓ import { find } from 'flac'
✗ import find from 'flac'
Named export for the find function.

Basic usage of FLAC to create a cache instance, set and get a cached value.

import { Flac } from 'flac'; const cache = new Flac({ directory: './cache', maxAge: 3600 }); await cache.set('key', { data: 'value' }); const result = await cache.get('key'); console.log(result); // { data: 'value' }
Debug
Known issues
gotchaCache directory is not created automatically; must exist.
fix
Ensure directory exists before creating Flac instance.
affects: >=0.0.0
deprecatedPackage is no longer maintained and has known vulnerabilities.
fix
Migrate to a maintained alternative like node-cache-manager.
affects: >=0.0.0
gotchaThe find method returns undefined if no file matches pattern.
fix
Check for undefined before using the result.
affects: >=0.0.0
gotchaFile caching is synchronous; blocks event loop.
fix
Use asynchronous alternatives or limit cache size.
affects: >=0.0.0
gotchamaxAge is in seconds but documented as milliseconds.
fix
Use seconds when setting maxAge.
affects: >=0.0.0
Errors
Common errors & fixes
Error: ENOENT: no such file or directory, open './cache/somefile.json'
Cache directory does not exist.
fix
Create the cache directory before initializing Flac: fs.mkdirSync('./cache', { recursive: true });
TypeError: Cannot read properties of undefined (reading 'data')
Cache get returns undefined for missing keys.
fix
Check if result is undefined before accessing properties: if (result) { ... }
Warning: flac is deprecated and has known vulnerabilities
Using an outdated and unmaintained package.
fix
Replace with a maintained cache library like node-cache-manager.
Upgrade
Version history
0.3.0latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
38 hits · last 30 days
node
34
Amazon
1
OpenAI (training)
1
Resources
packageflac ↗
flac — npm install flac · libregistry