{"id":44966,"library":"flac","title":"FLAC","description":"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.","status":"abandoned","version":"0.3.0","language":"javascript","source_language":"en","source_url":"git://github.com/gregof/flac","tags":["javascript"],"install":[{"cmd":"npm install flac","lang":"bash","label":"npm"},{"cmd":"yarn add flac","lang":"bash","label":"yarn"},{"cmd":"pnpm add flac","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"ESM import syntax; CJS require may work but ESM is recommended.","wrong":"const flac = require('flac')","symbol":"default","correct":"import flac from 'flac'"},{"note":"Named export for the Flac class; default export also exists.","wrong":"import Flac from 'flac'","symbol":"Flac","correct":"import { Flac } from 'flac'"},{"note":"Named export for the find function.","wrong":"import find from 'flac'","symbol":"find","correct":"import { find } from 'flac'"}],"quickstart":{"code":"import { Flac } from 'flac';\nconst cache = new Flac({ directory: './cache', maxAge: 3600 });\nawait cache.set('key', { data: 'value' });\nconst result = await cache.get('key');\nconsole.log(result); // { data: 'value' }","lang":"typescript","description":"Basic usage of FLAC to create a cache instance, set and get a cached value."},"warnings":[{"fix":"Ensure directory exists before creating Flac instance.","message":"Cache directory is not created automatically; must exist.","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"Migrate to a maintained alternative like node-cache-manager.","message":"Package is no longer maintained and has known vulnerabilities.","severity":"deprecated","affected_versions":">=0.0.0"},{"fix":"Check for undefined before using the result.","message":"The find method returns undefined if no file matches pattern.","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"Use asynchronous alternatives or limit cache size.","message":"File caching is synchronous; blocks event loop.","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"Use seconds when setting maxAge.","message":"maxAge is in seconds but documented as milliseconds.","severity":"gotcha","affected_versions":">=0.0.0"}],"env_vars":null,"search_vec":"'0.3.0':24 '0.4':27 'activ':49 'altern':54 'api':32 'automat':40 'base':37 'cach':8,12,21,38,43,58 'consid':51 'data':22,45 'file':11,36,47 'file-bas':35 'find':3,18 'flac':1,2 'javascript':60 'like':55 'load':4,19,41 'maintain':50 'make':6 'manag':34,59 'modern':53 'node':57 'node-cache-manag':56 'node.js':15,26 'provid':29 'simpl':31 'simplifi':17 'use':52 'util':13 'version':23","created_at":"2026-06-07T12:52:42.257572+00:00","updated_at":"2026-06-07T12:52:42.257572+00:00","problems":[{"fix":"Create the cache directory before initializing Flac: fs.mkdirSync('./cache', { recursive: true });","cause":"Cache directory does not exist.","error":"Error: ENOENT: no such file or directory, open './cache/somefile.json'"},{"fix":"Check if result is undefined before accessing properties: if (result) { ... }","cause":"Cache get returns undefined for missing keys.","error":"TypeError: Cannot read properties of undefined (reading 'data')"},{"fix":"Replace with a maintained cache library like node-cache-manager.","cause":"Using an outdated and unmaintained package.","error":"Warning: flac is deprecated and has known vulnerabilities"}],"ecosystem":"npm","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":null,"cli_version":null,"type":"library","homepage":"git://github.com/gregof/flac","github":"git://github.com/gregof/flac","docs":null,"changelog":null,"pypi":null,"npm":"flac","openapi_spec":null,"status_page":null,"smithery":null,"categories":["storage"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-07","next_check":"2026-09-05","install_tag":null}}