{"id":44929,"library":"fastqueue","title":"fastqueue","description":"A fast FIFO queue for Node.js that uses a two-array cycling strategy to avoid the O(n) reindexing cost of Array.shift() on large queues. Version 0.1.0 is the only release, currently in maintenance mode. Key differentiator: implements only push/shift/unshift/length with minimal overhead, unlike alternatives like denque or double-ended-queue which offer more features.","status":"maintenance","version":"0.1.0","language":"javascript","source_language":"en","source_url":null,"tags":["javascript"],"install":[{"cmd":"npm install fastqueue","lang":"bash","label":"npm"},{"cmd":"yarn add fastqueue","lang":"bash","label":"yarn"},{"cmd":"pnpm add fastqueue","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"This package only supports CommonJS (require). No ESM or named exports available.","wrong":"import Queue from 'fastqueue'","symbol":"Queue","correct":"const Queue = require('fastqueue')"}],"quickstart":{"code":"const Queue = require('fastqueue');\nconst q = new Queue();\nq.push(1);\nq.push(2);\nconsole.log(q.shift()); // 1\nconsole.log(q.shift()); // 2\nconsole.log(q.length);   // 0\nq.unshift(3);\nconsole.log(q.shift()); // 3","lang":"javascript","description":"Shows basic FIFO queue operations: push, shift, unshift, and length property."},"warnings":[{"fix":"Use require() instead of import.","message":"Package does not expose an ESM interface; using import will fail.","severity":"gotcha","affected_versions":">=0"},{"fix":"Check if these features are needed; consider using denque or double-ended-queue for richer API.","message":"Queue only supports push/shift/unshift and length; no iteration, peek, or clear methods.","severity":"gotcha","affected_versions":">=0"},{"fix":"Test thoroughly if using with very large queues; consider using a well-maintained alternative.","message":"The tiny queue implementation may have subtle bugs with large numbers of elements due to internal array cycling.","severity":"gotcha","affected_versions":">=0"}],"env_vars":null,"search_vec":"'0.1.0':29 'altern':47 'array':13 'array.shift':24 'avoid':17 'cost':22 'current':34 'cycl':14 'denqu':49 'differenti':39 'doubl':52 'double-ended-queu':51 'end':53 'fast':3 'fastqueu':1 'featur':58 'fifo':4 'implement':40 'javascript':59 'key':38 'larg':26 'like':48 'mainten':36 'minim':44 'mode':37 'n':20 'node.js':7 'o':19 'offer':56 'overhead':45 'push/shift/unshift/length':42 'queue':5,27,54 'reindex':21 'releas':33 'strategi':15 'two':12 'two-array':11 'unlik':46 'use':9 'version':28","created_at":"2026-06-07T12:52:32.385850+00:00","updated_at":"2026-06-07T12:52:32.385850+00:00","problems":[{"fix":"Run 'npm install fastqueue' and ensure the module name is lowercase.","cause":"Package not installed or incorrectly spelled.","error":"Error: Cannot find module 'fastqueue'"},{"fix":"Replace 'import Queue from \"fastqueue\"' with 'const Queue = require(\"fastqueue\")'.","cause":"Using ES module import syntax on a CommonJS-only package.","error":"TypeError: fastqueue_1.default is not a constructor"}],"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":null,"github":null,"docs":null,"changelog":null,"pypi":null,"npm":"fastqueue","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}}