{"id":47717,"library":"fs-blob-storage","title":"fs-blob-storage","description":"A Node.js library for blob storage on filesystems with streams and promises API. Current stable version is 4.1.0, released under ISC license and requiring Node >= 16. It provides atomic operations, partial file support, and optional exclusive locking. Compared to similar packages like 'fs-blob-store', this library offers simpler API and built-in commit/partial file handling.","status":"active","version":"4.1.0","language":"javascript","source_language":"en","source_url":"https://github.com/dex4er/js-fs-blob-storage","tags":["javascript","blob","fs","promise","storage","typescript"],"install":[{"cmd":"npm install fs-blob-storage","lang":"bash","label":"npm"},{"cmd":"yarn add fs-blob-storage","lang":"bash","label":"yarn"},{"cmd":"pnpm add fs-blob-storage","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Required for TypeScript type definitions when using the package with TypeScript","package":"@types/node","optional":true}],"imports":[{"note":"Default export; ESM-only since v4","wrong":"const FsBlobStorage = require('fs-blob-storage')","symbol":"FsBlobStorage","correct":"import FsBlobStorage from 'fs-blob-storage'"},{"note":"Named export, not default","wrong":"import DEFAULT_EXT from 'fs-blob-storage'","symbol":"DEFAULT_EXT","correct":"import { DEFAULT_EXT } from 'fs-blob-storage'"},{"note":"Default export, not named; types are included in the package","wrong":"import { FsBlobStorage } from 'fs-blob-storage'","symbol":"FsBlobStorage (TypeScript)","correct":"import FsBlobStorage from 'fs-blob-storage'"}],"quickstart":{"code":"import FsBlobStorage from 'fs-blob-storage';\n\nconst storage = new FsBlobStorage({\n  path: './blobs',\n});\n\nasync function example() {\n  // Write a blob\n  const writable = await storage.createWriteStream('myfile');\n  writable.end('Hello World');\n  // The file is stored as myfile.part until committed\n  await storage.commit('myfile');\n  // Now it's myfile\n\n  // Read a blob\n  const readable = await storage.createReadStream('myfile');\n  readable.on('data', (chunk) => {\n    console.log(chunk.toString());\n  });\n}\n\nexample().catch(console.error);","lang":"typescript","description":"Shows creating a storage instance, writing a blob using streams, committing it, and reading it back."},"warnings":[{"fix":"Use import syntax or upgrade to Node 16+ and set { \"type\": \"module\" } in package.json.","message":"The package uses ESM only since v4.0.0. Requiring via CommonJS will fail.","severity":"breaking","affected_versions":">=4.0.0"},{"fix":"Use try/catch or check existence before reading with stat.","message":"createReadStream throws an error if the object does not exist or its size is zero.","severity":"gotcha","affected_versions":"*"},{"fix":"After writing via createWriteStream, always call storage.commit(key) to finalize the blob.","message":"Partial files with .part extension are used; you must call commit() to rename the file to remove the extension.","severity":"gotcha","affected_versions":"*"},{"fix":"Use on POSIX-like filesystems (Linux, macOS).","message":"The library is not compatible with NTFS filesystems due to rename behavior.","severity":"gotcha","affected_versions":"*"},{"fix":"Use with caution; consider file locking alternatives.","message":"The 'exclusive' option in constructor can cause race conditions if not used carefully.","severity":"deprecated","affected_versions":"*"}],"env_vars":null,"search_vec":"'16':30 '4.1.0':22 'api':17,55 'atom':33 'blob':3,9,49,64 'built':58 'built-in':57 'commit/partial':60 'compar':42 'current':18 'exclus':40 'file':36,61 'filesystem':12 'fs':2,48,65 'fs-blob-stor':47 'fs-blob-storag':1 'handl':62 'isc':25 'javascript':63 'librari':7,52 'licens':26 'like':46 'lock':41 'node':29 'node.js':6 'offer':53 'oper':34 'option':39 'packag':45 'partial':35 'promis':16,66 'provid':32 'releas':23 'requir':28 'similar':44 'simpler':54 'stabl':19 'storag':4,10,67 'store':50 'stream':14 'support':37 'typescript':68 'version':20","created_at":"2026-06-07T16:52:56.601218+00:00","updated_at":"2026-06-07T16:52:56.601218+00:00","problems":[{"fix":"Set { \"type\": \"module\" } in package.json or use dynamic import().","cause":"CommonJS environment trying to use ESM import.","error":"SyntaxError: Cannot use import statement outside a module"},{"fix":"Ensure the storage directory exists and the key is correct.","cause":"The blob or directory does not exist.","error":"Error: ENOENT: no such file or directory, open '...'"},{"fix":"Remove the existing blob first or disable exclusive mode.","cause":"Trying to create a blob with exclusive: true and the key already exists.","error":"Error: Object already exists (exclusive mode)"},{"fix":"Use default import: import FsBlobStorage from 'fs-blob-storage'.","cause":"Using default export incorrectly, e.g., import { FsBlobStorage } instead of import FsBlobStorage.","error":"TypeError: storage.createWriteStream is not a function"}],"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":"http://github.com/dex4er/js-fs-blob-storage","github":"https://github.com/dex4er/js-fs-blob-storage","docs":null,"changelog":null,"pypi":null,"npm":"fs-blob-storage","openapi_spec":null,"status_page":null,"smithery":null,"categories":["storage","devops"],"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}}