{"id":17091362,"url":"https://github.com/jhurliman/node-zookeeper-queue","last_synced_at":"2026-04-17T03:01:15.319Z","repository":{"id":13131214,"uuid":"15813273","full_name":"jhurliman/node-zookeeper-queue","owner":"jhurliman","description":"FIFO queue using ZooKeeper, implemented with node.js streams","archived":false,"fork":false,"pushed_at":"2014-01-11T07:11:41.000Z","size":164,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-23T16:14:09.120Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jhurliman.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-01-10T23:55:01.000Z","updated_at":"2014-01-11T07:11:43.000Z","dependencies_parsed_at":"2022-09-01T15:52:39.672Z","dependency_job_id":null,"html_url":"https://github.com/jhurliman/node-zookeeper-queue","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/jhurliman/node-zookeeper-queue","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jhurliman%2Fnode-zookeeper-queue","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jhurliman%2Fnode-zookeeper-queue/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jhurliman%2Fnode-zookeeper-queue/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jhurliman%2Fnode-zookeeper-queue/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jhurliman","download_url":"https://codeload.github.com/jhurliman/node-zookeeper-queue/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jhurliman%2Fnode-zookeeper-queue/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262632322,"owners_count":23340213,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-14T13:58:24.704Z","updated_at":"2026-04-17T03:01:10.274Z","avatar_url":"https://github.com/jhurliman.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"node-zookeeper-queue\n====================\n\n[![Build Status](https://travis-ci.org/jhurliman/node-zookeeper-queue.png)](https://travis-ci.org/jhurliman/node-zookeeper-queue)\n\nFIFO queue using ZooKeeper, implemented with node.js streams\n\n## Download\n\nThe source is available for download from\n[GitHub](http://github.com/jhurliman/node-zookeeper-queue).\nAlternatively, you can install using Node Package Manager (npm):\n\n    npm install zookeeper-queue\n\n## Quick Example\n\nThis library exports two different stream constructors, depending on whether\nyou want publish or subscribe (write or read). Both streams follow the standard\nstream interface for Writable or Readable with the addition of a `destroy()`\nmethod on SubQueue to disconnect from ZooKeeper, which is done with the `end()`\nmethod on PubQueue.\n\n```js\nvar zkQueue = require('zookeeper-queue');\nvar ZKPubQueue = zkQueue.PubQueue; // Inherits from streams.Writable\nvar ZKSubQueue = zkQueue.SubQueue; // Inherits from streams.Readable\n\nvar options = { path: '/myqueue', host: 'localhost', port: 2181 };\n\nvar subQueue = ZKSubQueue(options)\n  .on('connect', function() {\n    console.log('[SUB] Connected');\n  })\n  .on('data', function(data) {\n    console.log('[SUB] Received a message: ' + data.toString());\n\n    pubQueue.end();\n    subQueue.destroy();\n  })\n  .on('close', function() {\n    console.log('[SUB] Closed the queue connection');\n  });\n\nvar pubQueue = new ZKPubQueue(options)\n  .on('error', function(err) {\n    console.error('[PUB] An error occurred: ' + err);\n  })\n  .on('connect', function() {\n    console.log('[PUB] Connected. Writing \"hello world\" to the queue');\n    pubQueue.write('hello world');\n  })\n  .on('close', function() {\n    console.log('[PUB] Closed the queue connection');\n  });\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjhurliman%2Fnode-zookeeper-queue","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjhurliman%2Fnode-zookeeper-queue","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjhurliman%2Fnode-zookeeper-queue/lists"}