{"id":15740291,"url":"https://github.com/alesanchezr/text-queue","last_synced_at":"2025-08-13T23:05:52.381Z","repository":{"id":138549659,"uuid":"393114626","full_name":"alesanchezr/text-queue","owner":"alesanchezr","description":null,"archived":false,"fork":false,"pushed_at":"2021-08-05T17:32:36.000Z","size":38,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-03T15:27:36.989Z","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":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/alesanchezr.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-08-05T16:50:59.000Z","updated_at":"2021-08-05T17:32:38.000Z","dependencies_parsed_at":"2023-05-24T17:30:33.214Z","dependency_job_id":null,"html_url":"https://github.com/alesanchezr/text-queue","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/alesanchezr/text-queue","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alesanchezr%2Ftext-queue","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alesanchezr%2Ftext-queue/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alesanchezr%2Ftext-queue/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alesanchezr%2Ftext-queue/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/alesanchezr","download_url":"https://codeload.github.com/alesanchezr/text-queue/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alesanchezr%2Ftext-queue/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":270330595,"owners_count":24565816,"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","status":"online","status_checked_at":"2025-08-13T02:00:09.904Z","response_time":66,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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-04T02:20:40.917Z","updated_at":"2025-08-13T23:05:52.357Z","avatar_url":"https://github.com/alesanchezr.png","language":"JavaScript","readme":"# Text-Based-Queue\n\nExtremelly simple text-based polling queue engine. Similar to RabbitMQ but simpler, text-based and unidirectional (polling protocol).\n\n![Text Based Queue](https://github.com/alesanchezr/text-queue/blob/main/preview.png?raw=true)\n\n## What is this for?\n\nIs a simpler alternative to Socket.io with less restrictions.\n- Some times using sockets is impossible because of security or network limitations.\n- Faster than sockets\n- Persistent (if option.create = false the queue history will never be deleted)\n\n## How to use\n\n1. Initializing a new queue and dispatiching your first event:\n\n```js\n// initialize your dispatcher\nconst dispatcher = queue.dispatcher({ create: true, path: `./path/to/file.json` })\n\n//you can send any data as event payload\nlet data = { foo: \"bar\" }\n// start enqueing/dispatching any events\ndispatcher.enqueue(\"initilialized\", data)\n\n\n// dispatch any other custom event you want\ndispatcher.enqueue(\"send_email\")\n```\n\n\n2. Listening to incoming events from the queue:\n\n```js\n  //initialize your queue listener\n  const listener = queue.listener({ path: `./path/to/file.json` })\n  \n  // when a new event is added to the queue, the onPull method will be triggered \n  // and you receive the incoming event name and the payload/data\n  listener.onPull((e) =\u003e console.log(`Incoming event with name ${e.name}`, e.data))\n  \n  // if the queue file gets deleted or reseted we can also listen and receive any queued events\n  listener.onReset((e) =\u003e console.log(`Incoming event with name ${e.name}`, e.data))\n```\n\n## Options and Settings\n\n### For the queue dispatcher\n\n```js\nqueue.dispatcher({ \n  create: true, // Will create a new queue every time its initialized, defaults to false\n  path: `./path/to/file.json` // path to the file that will store the queue\n})\n```\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falesanchezr%2Ftext-queue","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falesanchezr%2Ftext-queue","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falesanchezr%2Ftext-queue/lists"}