{"_id":"@anyq/memory","_rev":"7-b40c9b919148eced362da755533d1084","name":"@anyq/memory","dist-tags":{"latest":"0.5.0"},"versions":{"0.1.0":{"name":"@anyq/memory","version":"0.1.0","keywords":["queue","message-queue","memory","testing","anyq"],"author":{"name":"Shantanu Sharma"},"license":"MIT","_id":"@anyq/memory@0.1.0","maintainers":[{"name":"sns45","email":"notifyshantanu@gmail.com"}],"homepage":"https://github.com/sns45/anyq#readme","bugs":{"url":"https://github.com/sns45/anyq/issues"},"dist":{"shasum":"61c18c0478ef21aff405b9f0eb07e1f010f5754d","tarball":"https://registry.npmjs.org/@anyq/memory/-/memory-0.1.0.tgz","fileCount":14,"integrity":"sha512-NiE3W7m4eKzobPbVIt1yUwn14pKEPNw7axkUoXwQqFINF64c6UvSOgXESvkyD8gOZeEYlqhyYRYujxjdkbmhgg==","signatures":[{"sig":"MEQCIEWLZID2pBOaesMtH3v+/qzDRiBZMYnNeCAjN6OkqBX+AiBpr61UH4gwEsLop5fC7TCTYmMdhlPIQP8QwdimUOD1Kw==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":42812},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"gitHead":"1210b51fe4a55144ebf5bc798db0732b4c89ddba","scripts":{"dev":"bun build ./src/index.ts --outdir ./dist --target bun --watch","test":"bun test","build":"bun build ./src/index.ts --outdir ./dist --target bun && bun run build:types","clean":"rm -rf dist coverage","typecheck":"tsc --noEmit","test:watch":"bun test --watch","build:types":"tsc --emitDeclarationOnly --outDir dist"},"_npmUser":{"name":"sns45","email":"notifyshantanu@gmail.com"},"repository":{"url":"git+https://github.com/sns45/anyq.git","type":"git","directory":"packages/memory"},"_npmVersion":"10.9.2","description":"In-memory queue adapter for anyq - for testing and development","directories":{},"_nodeVersion":"22.17.0","dependencies":{"@anyq/core":"workspace:*"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"@types/bun":"^1.1.0","typescript":"^5.3.0"},"_npmOperationalInternal":{"tmp":"tmp/memory_0.1.0_1765990918358_0.5441778908370494","host":"s3://npm-registry-packages-npm-production"}},"0.1.1":{"name":"@anyq/memory","version":"0.1.1","keywords":["queue","message-queue","memory","testing","anyq"],"author":{"name":"Shantanu Sharma"},"license":"MIT","_id":"@anyq/memory@0.1.1","maintainers":[{"name":"sns45","email":"notifyshantanu@gmail.com"}],"homepage":"https://github.com/sns45/anyq#readme","bugs":{"url":"https://github.com/sns45/anyq/issues"},"dist":{"shasum":"3c99580799019e01e1c281b25c980cd931621d26","tarball":"https://registry.npmjs.org/@anyq/memory/-/memory-0.1.1.tgz","fileCount":15,"integrity":"sha512-iqAQD2Q1mvFpmBEb2Dvup8DG0BLt2GcfTxBtlJzaGDWwCvVtWhdWvfB5zteLAGYLhxPNeISoRVXhOk0BlCtaZA==","signatures":[{"sig":"MEYCIQD9OORv/ozauHUSI0W3+qGQh7hNp/gjThygMJylsusdWgIhAK0vh5kj2rRvLtXszKm5o3+tg3U5JGMDWW8z1H6DUjey","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":44027},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"gitHead":"30128d564178a5a1d25b736b605bf69644178a0f","scripts":{"dev":"bun build ./src/index.ts --outdir ./dist --target bun --watch","test":"bun test","build":"bun build ./src/index.ts --outdir ./dist --target bun && bun run build:types","clean":"rm -rf dist coverage","typecheck":"tsc --noEmit","test:watch":"bun test --watch","build:types":"tsc --emitDeclarationOnly --outDir dist"},"_npmUser":{"name":"sns45","email":"notifyshantanu@gmail.com"},"repository":{"url":"git+https://github.com/sns45/anyq.git","type":"git","directory":"packages/memory"},"_npmVersion":"10.9.2","description":"In-memory queue adapter for anyq - for testing and development","directories":{},"_nodeVersion":"22.17.0","dependencies":{"@anyq/core":"workspace:*"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"@types/bun":"^1.1.0","typescript":"^5.3.0"},"_npmOperationalInternal":{"tmp":"tmp/memory_0.1.1_1765991334482_0.4648566773853997","host":"s3://npm-registry-packages-npm-production"}},"0.3.0":{"name":"@anyq/memory","version":"0.3.0","keywords":["queue","message-queue","memory","testing","anyq"],"author":"Shantanu Sharma","license":"MIT","_id":"@anyq/memory@0.3.0","maintainers":[{"name":"sns45","email":"notifyshantanu@gmail.com"}],"homepage":"https://github.com/sns45/anyq#readme","bugs":{"url":"https://github.com/sns45/anyq/issues"},"dist":{"shasum":"1521b23472380fc786843c6157eea7cbeeede5b8","tarball":"https://registry.npmjs.org/@anyq/memory/-/memory-0.3.0.tgz","fileCount":15,"integrity":"sha512-TWH1JSeoqSFz9oZ2WOHq+TSq+QI3gekxW3K9I9/pRO/BsrtlQr8/707gnpklZZkFq9ootVedZlhIZPQaf1acbQ==","signatures":[{"sig":"MEUCIDfP1v+AtbsxT8uIY7Br7zSioGe82QWk9baxp4uLtzN7AiEAtbs6uXLmKb0cflz7/fsjXa/7nO6RK1BxfOsj8UTcUgU=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":53318},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","shasum":"1521b23472380fc786843c6157eea7cbeeede5b8","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"scripts":{"dev":"bun build ./src/index.ts --outdir ./dist --target bun --watch","test":"bun test","build":"bun build ./src/index.ts --outdir ./dist --target bun && bun run build:types","clean":"rm -rf dist coverage","typecheck":"tsc --noEmit","test:watch":"bun test --watch","build:types":"tsc --emitDeclarationOnly --outDir dist"},"_npmUser":{"name":"sns45","email":"notifyshantanu@gmail.com"},"_integrity":"sha512-TWH1JSeoqSFz9oZ2WOHq+TSq+QI3gekxW3K9I9/pRO/BsrtlQr8/707gnpklZZkFq9ootVedZlhIZPQaf1acbQ==","repository":{"url":"https://github.com/sns45/anyq","type":"git","directory":"packages/memory"},"_npmVersion":"10.8.3","description":"In-memory queue adapter for anyq - for testing and development","directories":{},"_nodeVersion":"24.3.0","dependencies":{"@anyq/core":"0.3.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"@types/bun":"^1.1.0","typescript":"^5.3.0"},"_npmOperationalInternal":{"tmp":"tmp/memory_0.3.0_1781961967571_0.7155459773534143","host":"s3://npm-registry-packages-npm-production"}},"0.3.1":{"name":"@anyq/memory","version":"0.3.1","keywords":["queue","message-queue","memory","testing","anyq"],"author":"Shantanu Sharma","license":"MIT","_id":"@anyq/memory@0.3.1","maintainers":[{"name":"sns45","email":"notifyshantanu@gmail.com"}],"homepage":"https://github.com/sns45/anyq#readme","bugs":{"url":"https://github.com/sns45/anyq/issues"},"dist":{"shasum":"70db9e52148e924dec00cc6c40b5094d70f9ab29","tarball":"https://registry.npmjs.org/@anyq/memory/-/memory-0.3.1.tgz","fileCount":15,"integrity":"sha512-/RfqZawFuvEv9Q7A3GOO0cPtBkI0+6Fa3KmobUS+FLQCSTfV1sUtNPEVe0R36RQi/wHW+NBanmX52/qjkGD6Yg==","signatures":[{"sig":"MEYCIQC1bi7Ed/hyfALKwMs9zjC+9KwFE32CMLdW4S5SbDW0UAIhAJCuGIpqDuN4ikzYEELsKoMEtXdu+VYcqIcUM0M/YsBn","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":56056},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","shasum":"70db9e52148e924dec00cc6c40b5094d70f9ab29","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"scripts":{"dev":"bun build ./src/index.ts --outdir ./dist --target bun --watch","test":"bun test","build":"bun build ./src/index.ts --outdir ./dist --target bun && bun run build:types","clean":"rm -rf dist coverage","typecheck":"tsc --noEmit","test:watch":"bun test --watch","build:types":"tsc --emitDeclarationOnly --outDir dist"},"_npmUser":{"name":"sns45","email":"notifyshantanu@gmail.com"},"_integrity":"sha512-/RfqZawFuvEv9Q7A3GOO0cPtBkI0+6Fa3KmobUS+FLQCSTfV1sUtNPEVe0R36RQi/wHW+NBanmX52/qjkGD6Yg==","repository":{"url":"https://github.com/sns45/anyq","type":"git","directory":"packages/memory"},"_npmVersion":"10.8.3","description":"In-memory queue adapter for anyq - for testing and development","directories":{},"_nodeVersion":"24.3.0","dependencies":{"@anyq/core":"0.3.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"@types/bun":"^1.1.0","typescript":"^5.3.0"},"_npmOperationalInternal":{"tmp":"tmp/memory_0.3.1_1782054592616_0.35972161127736557","host":"s3://npm-registry-packages-npm-production"}},"0.3.2":{"name":"@anyq/memory","version":"0.3.2","keywords":["queue","message-queue","memory","testing","anyq"],"author":"Shantanu Sharma","license":"MIT","_id":"@anyq/memory@0.3.2","maintainers":[{"name":"sns45","email":"notifyshantanu@gmail.com"}],"homepage":"https://github.com/sns45/anyq#readme","bugs":{"url":"https://github.com/sns45/anyq/issues"},"dist":{"shasum":"6f257791e3a69ddf268ec8be165c47877cc83757","tarball":"https://registry.npmjs.org/@anyq/memory/-/memory-0.3.2.tgz","fileCount":15,"integrity":"sha512-P189Xp/YR/75UwqRCiHLVXbticg+vnpnuB077+vrodjt+SurbPM3N/aMWd3+abmvTexZMXBWtD/EdlivCPOy2w==","signatures":[{"sig":"MEYCIQDQWkNCBAwjbAeISGzJzHFQedfbVwjNzeoTii8C7Ca3cgIhAK6lxOlVIp4D+iYPLMR/CQGAlL/J+XebmtfO0ZJujG8P","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":56056},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","shasum":"6f257791e3a69ddf268ec8be165c47877cc83757","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"scripts":{"dev":"bun build ./src/index.ts --outdir ./dist --target bun --watch","test":"bun test","build":"bun build ./src/index.ts --outdir ./dist --target bun && bun run build:types","clean":"rm -rf dist coverage","typecheck":"tsc --noEmit","test:watch":"bun test --watch","build:types":"tsc --emitDeclarationOnly --outDir dist"},"_npmUser":{"name":"sns45","email":"notifyshantanu@gmail.com"},"_integrity":"sha512-P189Xp/YR/75UwqRCiHLVXbticg+vnpnuB077+vrodjt+SurbPM3N/aMWd3+abmvTexZMXBWtD/EdlivCPOy2w==","repository":{"url":"https://github.com/sns45/anyq","type":"git","directory":"packages/memory"},"_npmVersion":"10.8.3","description":"In-memory queue adapter for anyq - for testing and development","directories":{},"_nodeVersion":"24.3.0","dependencies":{"@anyq/core":"0.3.2"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"@types/bun":"^1.1.0","typescript":"^5.3.0"},"_npmOperationalInternal":{"tmp":"tmp/memory_0.3.2_1784910258817_0.6093344525967093","host":"s3://npm-registry-packages-npm-production"}},"0.4.0":{"name":"@anyq/memory","version":"0.4.0","keywords":["queue","message-queue","memory","testing","anyq"],"author":"Shantanu Sharma","license":"Apache-2.0","_id":"@anyq/memory@0.4.0","maintainers":[{"name":"sns45","email":"notifyshantanu@gmail.com"}],"homepage":"https://github.com/sns45/anyq#readme","bugs":{"url":"https://github.com/sns45/anyq/issues"},"dist":{"shasum":"bd672d431b8cd909dc2ad5dd1027b5cc60d1bb27","tarball":"https://registry.npmjs.org/@anyq/memory/-/memory-0.4.0.tgz","fileCount":17,"integrity":"sha512-Jf+4jWVhRw5qCnxFEhTLbsH1Fe/OAxPpWrRKOoO/fsz43L13g9rDOSt2RJsMZIsVOmPvsBHwfkn2AhRsHr0KVQ==","signatures":[{"sig":"MEYCIQDuWDB/Kv+4V24Kx1wP/jL4eo64QCQZZsnpYgkAQl8/ZwIhANnjUOyMf7+gIl7QKWB9jIcNfl0PiZilsQQ9Yn6wNvVW","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"sig":"MEQCIDRbSNmgfHdO6VZNDT/PuWsgC7B5KWogLCzWUWhGy2jWAiBbY3FEiJNmQmAy0TfRBdc3wRJpKAB0MQTf00GRjLUneg==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":68074},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","shasum":"bd672d431b8cd909dc2ad5dd1027b5cc60d1bb27","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"scripts":{"dev":"bun build ./src/index.ts --outdir ./dist --target bun --watch","test":"bun test","build":"bun build ./src/index.ts --outdir ./dist --target bun && bun run build:types","clean":"rm -rf dist coverage","typecheck":"tsc --noEmit","test:watch":"bun test --watch","build:types":"tsc --emitDeclarationOnly --outDir dist"},"_npmUser":{"name":"sns45","email":"notifyshantanu@gmail.com"},"_integrity":"sha512-Jf+4jWVhRw5qCnxFEhTLbsH1Fe/OAxPpWrRKOoO/fsz43L13g9rDOSt2RJsMZIsVOmPvsBHwfkn2AhRsHr0KVQ==","repository":{"url":"https://github.com/sns45/anyq","type":"git","directory":"packages/memory"},"_npmVersion":"10.8.3","description":"In-memory queue adapter for anyq - for testing and development","directories":{},"_nodeVersion":"26.3.0","dependencies":{"@anyq/core":"0.4.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"@types/bun":"^1.1.0","typescript":"^5.3.0"},"_npmOperationalInternal":{"tmp":"tmp/memory_0.4.0_1787860750369_0.3389015008156422","host":"s3://npm-registry-packages-npm-production"}},"0.5.0":{"_id":"@anyq/memory@0.5.0","bugs":{"url":"https://github.com/sns45/anyq/issues"},"dist":{"shasum":"8f424bad745666792191382e0ecb1dee30cb4b0a","tarball":"https://registry.npmjs.org/@anyq/memory/-/memory-0.5.0.tgz","fileCount":17,"integrity":"sha512-ZxiWdH4SL4pS+XLUmPYk5FcAORvRVskh0Bz4n9QanSEq2C0hWZnaJjowdJRXZ/BbupauVtcYfl7w6pMcseEh7g==","signatures":[{"sig":"MEUCIQD/cjZv/pegJWh+m8guoRFvaU4tHFrmXWxAHI6u6jDe3gIgVawv0v/kbs/qE1/gQXzJVhE4Y0JDHr8tnimkUlYzdv8=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIAHPYDYj6e4zRbzq5+lWN0xgOcDWv6zDyaVHFqRT2JbGAiEAtzUI3maRC+Oep02aDCyGhzRknCHydCfldpeGWL/z1QM="}],"unpackedSize":68078},"main":"./dist/index.js","name":"@anyq/memory","type":"module","types":"./dist/index.d.ts","author":"Shantanu Sharma","shasum":"8f424bad745666792191382e0ecb1dee30cb4b0a","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"license":"Apache-2.0","scripts":{"dev":"bun build ./src/index.ts --outdir ./dist --target bun --watch","test":"bun test","build":"bun build ./src/index.ts --outdir ./dist --target bun && bun run build:types","clean":"rm -rf dist coverage","typecheck":"tsc --noEmit","test:watch":"bun test --watch","build:types":"tsc --emitDeclarationOnly --outDir dist"},"version":"0.5.0","_npmUser":{"name":"sns45","email":"notifyshantanu@gmail.com"},"homepage":"https://github.com/sns45/anyq#readme","keywords":["queue","message-queue","memory","testing","anyq"],"_integrity":"sha512-ZxiWdH4SL4pS+XLUmPYk5FcAORvRVskh0Bz4n9QanSEq2C0hWZnaJjowdJRXZ/BbupauVtcYfl7w6pMcseEh7g==","repository":{"url":"https://github.com/sns45/anyq","type":"git","directory":"packages/memory"},"_npmVersion":"10.8.3","description":"In-memory queue adapter for anyq - for testing and development","directories":{},"maintainers":[{"name":"sns45","email":"notifyshantanu@gmail.com"}],"_nodeVersion":"26.3.0","dependencies":{"@anyq/core":"0.5.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"@types/bun":"^1.1.0","typescript":"^5.3.0"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/memory_0.5.0_1788809042592_0.9679183127013176"}}},"time":{"created":"2025-12-17T17:01:58.295Z","modified":"2026-09-07T19:24:02.965Z","0.1.0":"2025-12-17T17:01:58.517Z","0.1.1":"2025-12-17T17:08:54.678Z","0.3.0":"2026-06-20T13:26:07.694Z","0.3.1":"2026-06-21T15:09:52.758Z","0.3.2":"2026-07-24T16:24:18.946Z","0.4.0":"2026-08-27T19:59:10.456Z","0.5.0":"2026-09-07T19:24:02.669Z"},"bugs":{"url":"https://github.com/sns45/anyq/issues"},"author":"Shantanu Sharma","license":"Apache-2.0","homepage":"https://github.com/sns45/anyq#readme","keywords":["queue","message-queue","memory","testing","anyq"],"repository":{"url":"https://github.com/sns45/anyq","type":"git","directory":"packages/memory"},"description":"In-memory queue adapter for anyq - for testing and development","maintainers":[{"name":"sns45","email":"notifyshantanu@gmail.com"}],"readme":"# @anyq/memory\n\nIn-memory queue adapter for **anyq** - perfect for testing and development.\n\n## Installation\n\n```bash\nnpm install @anyq/memory @anyq/core\n```\n\n## Usage\n\n```typescript\nimport { MemoryProducer, MemoryConsumer } from '@anyq/memory';\n\n// Create producer\nconst producer = new MemoryProducer({\n  queue: 'my-queue'\n});\n\n// Create consumer\nconst consumer = new MemoryConsumer({\n  queue: 'my-queue'\n});\n\nawait producer.connect();\nawait consumer.connect();\n\n// Subscribe to messages\nawait consumer.subscribe(async (message) => {\n  console.log('Received:', message.data);\n  await message.ack();\n});\n\n// Publish messages\nawait producer.publish({ hello: 'world' });\nawait producer.publishBatch([\n  { order: 1 },\n  { order: 2 }\n]);\n\n// Cleanup\nawait consumer.disconnect();\nawait producer.disconnect();\n```\n\n## Configuration\n\n```typescript\ninterface MemoryQueueConfig {\n  queue: string;           // Queue name\n  maxSize?: number;        // Max messages in queue (default: unlimited)\n  deliveryDelay?: number;  // Delay before message delivery (ms)\n}\n```\n\n## Features\n\n- No external dependencies\n- Perfect for unit tests\n- Supports ack/nack\n- Message persistence during session\n- Batch publishing\n\n## Retry strategies (0.3.0)\n\nThis adapter participates in the opt-in pluggable retry strategies from `@anyq/core`. Pass a strategy via `BaseQueueConfig.strategy` and `MemoryConsumer.applyStrategy()` takes over per-message error handling; omit it and the legacy DLQ-after-`maxDeliveryAttempts` path runs unchanged.\n\n| Capability | Support |\n|---|---|\n| `supportsNativeDelay` | **true** |\n| Native `park` | `setTimeout` re-enqueue onto the same queue |\n| Native `deadLetterMessage` | routes via the existing `MemoryQueue.deadLetter()` so `x-death-reason` / `x-original-queue` headers are preserved |\n\n```typescript\nimport { retryThenDeadLetter } from '@anyq/core';\n\nconst consumer = new MemoryConsumer({\n  driver: 'memory',\n  queueName: 'orders',\n  strategy: retryThenDeadLetter({ maxAttempts: 5 }),\n});\n```\n\nSee `@anyq/core` for the full strategy catalogue and the `apps/examples/retry-strategies` workspace for runnable demos.\n\n## License\n\nApache License 2.0. See [LICENSE](https://github.com/sns45/anyq/blob/main/LICENSE).\n","readmeFilename":"README.md"}