{"library":"loader-fs-cache","title":"loader-fs-cache","description":"A filesystem cache helper extracted from babel-loader's fs-cache module. Version 1.0.3 is the latest and only release. This package provides a simple promisified file system cache that stores compiled results on disk, checking timestamps and content hashes to invalidate stale entries. It is a standalone extraction from the babel-loader source. Not recommended for direct use; prefer babel-loader or other caching solutions like webpack's persistent cache.","language":"javascript","status":"deprecated","last_verified":"Sat Apr 25","install":{"commands":["npm install loader-fs-cache"],"cli":null},"imports":["import cache from 'loader-fs-cache'","import cache from 'loader-fs-cache'","type Cache = typeof import('loader-fs-cache')"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"import cache from 'loader-fs-cache';\nimport findCacheDir from 'find-cache-dir';\nimport { join } from 'path';\n\nconst cacheDir = findCacheDir({ name: 'my-repo' }) ?? '.';\n\nconst src = 'const x = 1;';\nconst options = {\n  directory: cacheDir,\n  identifier: 'babel',\n  config: { presets: ['@babel/preset-env'] },\n};\n\ncache(options).then((result) => {\n  if (result && result.src === src) {\n    console.log('Cache hit');\n  } else {\n    console.log('Cache miss');\n  }\n});","lang":"typescript","description":"Demonstrates basic usage: import, find cache directory, set up cache options, and check for cache hit/miss.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}