{"_id":"SimpleQueue","_rev":"10-43ccf7ab62076dabc31756cbbaaa7f05","name":"SimpleQueue","dist-tags":{"latest":"2.0.0"},"versions":{"0.0.1":{"name":"SimpleQueue","version":"0.0.1","author":{"name":"Felix Boehm","email":"me@feedic.com"},"_id":"SimpleQueue@0.0.1","maintainers":[{"name":"feedic","email":"me@feedic.com"}],"dist":{"shasum":"74466490afa37c1878653767f23c59067a8e7d70","tarball":"https://registry.npmjs.org/SimpleQueue/-/SimpleQueue-0.0.1.tgz","integrity":"sha512-tKhoUTeM1UctloT+AkjwoY7LoMTg52Re1GdWdZJsLYUmXsW4RUYnRm5kT8whSnYIR9osC8LJCQJx3tZNA+RVjg==","signatures":[{"sig":"MEQCIA9FgHILBVFzh3dZOe6llJzYZelt2KTWwb5NGqCpEKJwAiBwAT3O+nUM2KPK22EsNl/nfsJEbfDsacIG4A6ZdjhkAw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"main":"./SimpleQueue.js","engines":{"node":"*"},"scripts":{"test":"node ./tests/00-basic.js"},"_npmUser":{"name":"feedic","email":"me@feedic.com"},"repository":{"url":"git://github.com/fb55/simplequeue.git","type":"git"},"_npmVersion":"1.0.106","description":"a simple fifo queue","directories":{},"_nodeVersion":"v0.6.2","dependencies":{},"_defaultsLoaded":true,"devDependencies":{},"_engineSupported":true},"1.0.0":{"name":"SimpleQueue","version":"1.0.0","author":{"name":"Felix Boehm","email":"me@feedic.com"},"license":"MIT","_id":"SimpleQueue@1.0.0","maintainers":[{"name":"feedic","email":"me@feedic.com"}],"homepage":"https://github.com/fb55/simplequeue#readme","bugs":{"url":"https://github.com/fb55/simplequeue/issues"},"dist":{"shasum":"d4764a2e894e8bfd2ac2d584a354e7e932c1f530","tarball":"https://registry.npmjs.org/SimpleQueue/-/SimpleQueue-1.0.0.tgz","fileCount":6,"integrity":"sha512-sWtcBQ51q9/tMQ5K7VzEXbajGCLOHitV2TxLXh5XcYYoaoFgbGJr+OjEH8REKCa80FdvmcCh9g1N3wBD2jQklQ==","signatures":[{"sig":"MEYCIQCFqrx3crveO5rdNvsMboLpHZ/HQ9f3PDbyDEaucOJ6xgIhANVtPSqgR72rDOltfsEpIqKvaQ1MkC3IMiNhmmm6fIBC","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":12111,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfkJ4sCRA9TVsSAnZWagAAi54P/3iqXsY5nDAEnPWomv+C\nDgoApINX/RccByqpGOYuIDdiUg7C4U9Qgi0bOqmlevEfPM85TDFiwRXsM6bz\n4/YXYu4CHoysjYC416QqyZZyOeMRvVREiZOuweOZDfE/dArhEgP8EYxkU7bV\nUwVs+c3U+5nBccjhhKFzS1Wznx7POXHTakfL57XS9SVHER3si9W4B5nKyrJ4\nPYItG4IwZtNXboFWrhae68bRlVfO/XKubR7Xg99VjSEA+9z1Omws9CjeMIxN\nPbl8fYsVk+mudtgEHctW+cj5bfPPxGBxvGy+pcBkVu10HvTYQu8UYNkR+0Ip\n4IR0Kxj26tb2pgPfTEB1eFqucPOsjgPTO3eaUM84Fh5NkYLP6FpvSK9ta+MY\ntn3lE7E1u2ZZJ2FV10m0OM+qIZRQdNJglrJ/1mXTuhKFJQteYR3jg9pPC7+S\nlXRS97vMtZ4HA5DOYZ5X5nXGqyywxwHe7OaIhYRDx7WcL0f0YtcLs8tz/qhO\n91MwP4w7ss338ym2nyAGvpVPsA8eztpeyZ9/asmGupjMmDjQ7QdMbEP6Eeg6\nkkc1GAmivIs9LSWB72lpjv5Z0qmJWvTD0JZRe79XJbmLXi4465jxgsgdT0Lh\nKAgxzvXqtQSmIm2bSeGb8Xy4oGZbCGpEnTL5C9DpI8ZGT93dpZVBg+Cw1Lek\nHMCJ\r\n=gAD9\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"preset":"ts-jest","testEnvironment":"node"},"main":"lib/index.js","types":"lib/index.d.ts","funding":"https://github.com/sponsors/fb55","gitHead":"49871b997b414b36f8af6ed5f66a02a5c6f8f34a","scripts":{"lint":"npm run lint:es && npm run lint:prettier","test":"jest --coverage && npm run lint","build":"tsc","format":"npm run format:es && npm run format:prettier","lint:es":"eslint .","prepare":"npm run build","coverage":"cat coverage/lcov.info | coveralls","prettier":"prettier '**/*.{js,ts,md,json,yml}'","format:es":"npm run lint:es -- --fix","lint:prettier":"npm run prettier -- --check","format:prettier":"npm run prettier -- --write"},"_npmUser":{"name":"feedic","email":"me@feedic.com"},"prettier":{"tabWidth":4},"repository":{"url":"git://github.com/fb55/simplequeue.git","type":"git"},"_npmVersion":"6.14.8","description":"a simple fifo queue","directories":{"lib":"lib/"},"sideEffects":false,"_nodeVersion":"14.14.0","_hasShrinkwrap":false,"devDependencies":{"jest":"^26.5.3","eslint":"^7.11.0","ts-jest":"^26.1.0","prettier":"^2.0.5","coveralls":"*","typescript":"^4.0.2","@types/jest":"^26.0.0","@types/node":"^14.11.8","eslint-plugin-node":"^11.1.0","eslint-config-prettier":"^6.0.0","@typescript-eslint/parser":"^4.4.1","@typescript-eslint/eslint-plugin":"^4.4.1"},"_npmOperationalInternal":{"tmp":"tmp/SimpleQueue_1.0.0_1603313196347_0.999759750456791","host":"s3://npm-registry-packages"}},"2.0.0":{"type":"module","name":"SimpleQueue","license":"MIT","version":"2.0.0","description":"a simple fifo queue","author":{"name":"Felix Boehm","email":"me@feedic.com"},"funding":"https://github.com/sponsors/fb55","sideEffects":false,"main":"dist/index.js","types":"dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","default":"./dist/index.js"}},"repository":{"type":"git","url":"git://github.com/fb55/simplequeue.git"},"engines":{"node":">=20.19.0"},"scripts":{"build":"tsc","format":"npm run format:es && npm run format:biome","format:biome":"biome check --write .","format:es":"npm run lint:es -- --fix","lint":"npm run lint:es && npm run lint:ts && npm run lint:biome","lint:biome":"biome check .","lint:es":"eslint .","lint:ts":"tsc --noEmit","prepare":"npm run build","test":"npm run test:vi && npm run lint","test:vi":"vitest run"},"devDependencies":{"@biomejs/biome":"^2.4.7","@eslint/compat":"^2.0.3","@feedic/eslint-config":"^0.3.1","@types/node":"^25.5.0","eslint":"^10.0.3","eslint-config-biome":"^2.1.3","typescript":"^5.9.3","typescript-eslint":"^8.57.1","vitest":"^4.0.18"},"gitHead":"0d80288cf8023628d563233f42ba80b89488aa84","_id":"SimpleQueue@2.0.0","bugs":{"url":"https://github.com/fb55/simplequeue/issues"},"homepage":"https://github.com/fb55/simplequeue#readme","_nodeVersion":"24.14.0","_npmVersion":"11.9.0","dist":{"integrity":"sha512-PDjdgrPZPadQz/6WS+kZHSENQ3GfapwjubUmQzYefCeehJErW9w9FFWMdcSMIgdDBWCZ7eSEhMO7/dBb/g7Euw==","shasum":"68b17cd8a592f9f158328233613b1f737b422a90","tarball":"https://registry.npmjs.org/SimpleQueue/-/SimpleQueue-2.0.0.tgz","fileCount":6,"unpackedSize":12055,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/SimpleQueue@2.0.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQCDL2k44rRalvzNK/2nfEBHcmGqM/Ij1yu1MUVhg2puAgIgFtxcqgb8r1zm3QALbKslP3afsJaUATKqiS94gBvTqPg="}]},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:00ed6707-0d34-4a19-9cca-2e6314699507"}},"directories":{},"maintainers":[{"name":"fb55","email":"me@feedic.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/SimpleQueue_2.0.0_1773752282386_0.4661929985645843"},"_hasShrinkwrap":false}},"time":{"created":"2011-12-01T14:15:19.380Z","modified":"2026-03-17T12:58:02.818Z","0.0.1":"2011-12-01T14:15:21.383Z","1.0.0":"2020-10-21T20:46:36.503Z","2.0.0":"2026-03-17T12:58:02.557Z"},"bugs":{"url":"https://github.com/fb55/simplequeue/issues"},"author":{"name":"Felix Boehm","email":"me@feedic.com"},"license":"MIT","homepage":"https://github.com/fb55/simplequeue#readme","repository":{"type":"git","url":"git://github.com/fb55/simplequeue.git"},"description":"a simple fifo queue","maintainers":[{"name":"fb55","email":"me@feedic.com"}],"readme":"# SimpleQueue\n\n[![NPM version](http://img.shields.io/npm/v/SimpleQueue.svg?style=flat)](https://npmjs.org/package/SimpleQueue)\n[![Node.js CI](https://github.com/fb55/SimpleQueue/actions/workflows/nodejs-test.yml/badge.svg)](https://github.com/fb55/SimpleQueue/actions/workflows/nodejs-test.yml)\n[![Coverage](http://img.shields.io/coveralls/fb55/SimpleQueue.svg?style=flat)](https://coveralls.io/r/fb55/SimpleQueue)\n\nA simple FIFO queue\n\n    npm install SimpleQueue\n\n## What is this?\n\nThere are plenty queues for node, but even those branded as FIFO (first in first out) usually destroy the order.\nEg. when mapping over an RSS feeds & doing something with all of the pages,\nyou need to know what element had what position - so I created this little helper.\n\n## API\n\n### Class: SimpleQueue\\<T, R>\n\nA simple FIFO queue, delivering items in order.\n\n#### Type parameters\n\n| Name | Default | Description                              |\n| ---- | ------- | ---------------------------------------- |\n| `T`  | -       | Type that is pushed onto the stack.      |\n| `R`  | void    | Type that the passed `callback` maps to. |\n\n### Constructors\n\n#### constructor\n\n\\+ **new SimpleQueue**(`worker`: (element: T, callback: (error: Error \\| null, result: R) => void) => void, `callback`: (error: Error \\| null, result: R, element: T) => void, `done?`: undefined \\| () => void, `concurrent?`: number): `SimpleQueue`\n\n_Defined in [index.ts:16](https://github.com/fb55/SimpleQueue/blob/master/src/index.ts#L16)_\n\nCreates a new FIFO queue.\n\n##### Parameters:\n\n| Name         | Type                                                                      | Default value | Description                                                |\n| ------------ | ------------------------------------------------------------------------- | ------------- | ---------------------------------------------------------- |\n| `worker`     | (element: T, callback: (error: Error \\| null, result: R) => void) => void | -             | Method to call for each child. Args:                       |\n| `callback`   | (error: Error \\| null, result: R, element: T) => void                     | -             | Method to call when an element was processed.              |\n| `done?`      | undefined \\| () => void                                                   | -             | Method to call once the stack is cleared.                  |\n| `concurrent` | number                                                                    | 20            | Number of elements to process in parallel. Defaults to 20. |\n\n**Returns:** `SimpleQueue`\n\n### Properties\n\n#### paused\n\n• **paused**: boolean = false\n\n_Defined in [index.ts:16](https://github.com/fb55/SimpleQueue/blob/master/src/index.ts#L16)_\n\n### Methods\n\n#### abort\n\n▸ **abort**(): void\n\n_Defined in [index.ts:48](https://github.com/fb55/SimpleQueue/blob/master/src/index.ts#L48)_\n\nClears the queue (can't stop running processes).\n\n**Returns:** void\n\n---\n\n#### pause\n\n▸ **pause**(): void\n\n_Defined in [index.ts:57](https://github.com/fb55/SimpleQueue/blob/master/src/index.ts#L57)_\n\nPause the queue execution.\nWill not stop already in-flight items.\n\n**Returns:** void\n\n---\n\n#### push\n\n▸ **push**(`properties`: T): void\n\n_Defined in [index.ts:41](https://github.com/fb55/SimpleQueue/blob/master/src/index.ts#L41)_\n\nAdds an element to the queue.\n\n##### Parameters:\n\n| Name    | Type |\n| ------- | ---- |\n| `properties` | T    |\n\n**Returns:** void\n\n---\n\n#### resume\n\n▸ **resume**(): void\n\n_Defined in [index.ts:64](https://github.com/fb55/SimpleQueue/blob/master/src/index.ts#L64)_\n\nResume the queue execution,\nand catch up with remaining items.\n\n**Returns:** void\n\n## Example\n\n```js\nimport SimpleQueue from \"SimpleQueue\";\n\nconst queue = new SimpleQueue(\n    (element, callback) => {\n        // Set\n        setTimeout(() => callback(null, element / 1000), element);\n    },\n    (err, result, element) => {\n        console.log(result);\n    },\n    () => {\n        console.log(\"done\");\n    },\n    4,\n);\n\nqueue.push(1000);\nqueue.push(5000);\nqueue.push(3000);\nqueue.push(4000);\nqueue.push(8000);\nqueue.push(2000);\nqueue.push(0);\n```\n\nOutput:\n\n    1, 5, 3, 4, 8, 2, 0, \"done\"\n\nThis takes 9 seconds to run.\n","readmeFilename":"README.md"}