{"id":47679,"library":"fileq","title":"fileq","description":"File-based FIFO queue for Node.js, version 1.4.1. It stores JSON objects in files, allowing independent read/write operations without increasing memory usage. Supports multiple readers and writers, callback and promise modes, transactional commits via a done callback, queue recovery on process restart, and configurable persistence. Compared to in-memory queues like Bull or Bee-Queue, fileq offers simplicity and zero external dependencies (no Redis), but is limited to file-based storage and single-machine use.","status":"active","version":"1.4.1","language":"javascript","source_language":"en","source_url":"https://github.com/solzimer/fileq","tags":["javascript","file","buffer","json","queue","FIFO","peek","poll","transactional"],"install":[{"cmd":"npm install fileq","lang":"bash","label":"npm"},{"cmd":"yarn add fileq","lang":"bash","label":"yarn"},{"cmd":"pnpm add fileq","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"This package uses CommonJS and does not ship ESM types; use require().","wrong":"import FileQueue from 'fileq'","symbol":"FileQueue","correct":"const FileQueue = require('fileq')"}],"quickstart":{"code":"const FileQueue = require('fileq');\nconst queue = FileQueue.from('./myqueue');\n\n// Push items\nsetInterval(() => {\n  queue.push({ timestamp: Date.now(), message: 'Hello' });\n}, 1000);\n\n// Peek (read and remove) items\nsetInterval(async () => {\n  try {\n    const item = await queue.peek(1000);\n    console.log('Got:', item);\n  } catch (err) {\n    console.error('Peek error:', err.message);\n  }\n}, 1000);\n\n// Peek with commit (transactional) to process and later remove\nqueue.peek((err, item, done) => {\n  if (err) { console.error(err); return; }\n  console.log('Processing:', item);\n  done(); // removes item from queue after processing\n}, 0, true);","lang":"javascript","description":"Creates a file-based FIFO queue, pushes JSON items every second, and peeks them in promise mode and transactional callback mode."},"warnings":[{"fix":"Ensure done() is called promptly, or avoid commit mode if parallel reads are needed.","message":"In commit mode (peek with done callback), no further reads occur until done() is called, blocking the queue.","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"Explicitly pass a timeout value (e.g., 0 for infinite) or use the correct argument order.","message":"peek() with a timeout but without commit: the timeout is the second argument, but if only a callback is passed, timeout defaults to infinite.","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"Use one queue per process or implement external locking; fileq does not handle inter-process synchronization.","message":"The queue is file-based; concurrent access from multiple Node processes may cause race conditions on the same directory.","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"Use queue.peek(time, callback, false) instead of queue.poll.","message":"The 'poll' method is documented but is identical to 'peek' without commit; consider using peek with false commit for clarity.","severity":"deprecated","affected_versions":"<2.0.0"}],"env_vars":null,"search_vec":"'1.4.1':10 'allow':17 'base':4,75 'bee':58 'bee-queu':57 'buffer':84 'bull':55 'callback':30,39 'commit':35 'compar':48 'configur':46 'depend':66 'done':38 'extern':65 'fifo':5,87 'file':3,16,74,83 'file-bas':2,73 'fileq':1,60 'in-memori':50 'increas':22 'independ':18 'javascript':82 'json':13,85 'like':54 'limit':71 'machin':80 'memori':23,52 'mode':33 'multipl':26 'node.js':8 'object':14 'offer':61 'oper':20 'peek':88 'persist':47 'poll':89 'process':43 'promis':32 'queue':6,40,53,59,86 'read/write':19 'reader':27 'recoveri':41 'redi':68 'restart':44 'simplic':62 'singl':79 'single-machin':78 'storag':76 'store':12 'support':25 'transact':34,90 'usag':24 'use':81 'version':9 'via':36 'without':21 'writer':29 'zero':64","created_at":"2026-06-07T16:52:45.377248+00:00","updated_at":"2026-06-07T16:52:45.377248+00:00","problems":[{"fix":"Ensure the parent directory exists and is writable, or use an absolute path with appropriate permissions.","cause":"The queue path does not exist or FileQueue.from() cannot create the directory due to permissions.","error":"Error: ENOENT: no such file or directory, open '...'"},{"fix":"Install with 'npm install fileq' and require correctly: const FileQueue = require('fileq');","cause":"Using wrong import or fileq not installed incorrectly.","error":"TypeError: queue.peek is not a function"},{"fix":"Check that items have been pushed before peeking, or increase the timeout, or handle the error gracefully.","cause":"peek() called with a timeout but the queue is empty.","error":"Timeout: No data available within 100ms"}],"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":"https://github.com/solzimer/fileq#readme","github":"https://github.com/solzimer/fileq","docs":null,"changelog":null,"pypi":null,"npm":"fileq","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}}