{"id":13760266,"url":"https://github.com/marcoonroad/sporadic","last_synced_at":"2025-05-10T10:32:12.587Z","repository":{"id":33784095,"uuid":"162068685","full_name":"marcoonroad/sporadic","owner":"marcoonroad","description":"Composable Concurrency Abstractions for JavaScript. :railway_track: :rhinoceros: :train: :vertical_traffic_light:","archived":false,"fork":false,"pushed_at":"2024-08-02T09:06:15.000Z","size":459,"stargazers_count":18,"open_issues_count":21,"forks_count":3,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-11-10T05:11:02.116Z","etag":null,"topics":["async-await","channels","concurrency","coroutines","javascript","promises","reactive-programming","streams"],"latest_commit_sha":null,"homepage":"https://sporadic.marcoonroad.dev","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/marcoonroad.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":"support/index.js","governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-12-17T03:21:26.000Z","updated_at":"2023-09-29T17:50:58.000Z","dependencies_parsed_at":"2024-04-04T19:47:26.509Z","dependency_job_id":"488eb537-10b8-4f17-a200-522623ef57db","html_url":"https://github.com/marcoonroad/sporadic","commit_stats":{"total_commits":91,"total_committers":4,"mean_commits":22.75,"dds":0.3076923076923077,"last_synced_commit":"959eae5f79dcee6031d3bf0e7c153baf2b22f6f9"},"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marcoonroad%2Fsporadic","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marcoonroad%2Fsporadic/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marcoonroad%2Fsporadic/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marcoonroad%2Fsporadic/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/marcoonroad","download_url":"https://codeload.github.com/marcoonroad/sporadic/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224949750,"owners_count":17397230,"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":["async-await","channels","concurrency","coroutines","javascript","promises","reactive-programming","streams"],"created_at":"2024-08-03T13:01:06.287Z","updated_at":"2024-11-16T17:30:55.139Z","avatar_url":"https://github.com/marcoonroad.png","language":"JavaScript","funding_links":[],"categories":["Control Flow","Control Flow [🔝](#readme)","控制流"],"sub_categories":["Runner","运行器","运行器e2e测试"],"readme":"# sporadic\n\nComposable Concurrency Abstractions for JavaScript.\n\n\u003ca href=\"https://travis-ci.com/marcoonroad/sporadic\"\u003e\u003cimg src=\"https://img.shields.io/travis/com/marcoonroad/sporadic.svg?style=flat-square\u0026logo=travis\"/\u003e\u003c/a\u003e\n\u003ca href=\"https://gitlab.com/marcoonroad/sporadic/pipelines\"\u003e\u003cimg src=\"https://img.shields.io/gitlab/pipeline/marcoonroad/sporadic.svg?style=flat-square\u0026logo=gitlab\"/\u003e\u003c/a\u003e\n\u003ca href=\"https://coveralls.io/github/marcoonroad/sporadic?branch=master\"\u003e\n\u003cimg src=\"https://img.shields.io/coveralls/github/marcoonroad/sporadic.svg?style=flat-square\"/\u003e\u003c/a\u003e\n\u003ca href=\"https://www.npmjs.com/package/sporadic\"\u003e\u003cimg src=\"https://img.shields.io/npm/dw/sporadic.svg?style=flat-square\u0026logo=npm\"/\u003e\u003c/a\u003e\n\u003ca href=\"https://github.com/marcoonroad/sporadic/blob/master/LICENSE\"\u003e\u003cimg src=\"https://img.shields.io/github/license/marcoonroad/sporadic.svg?style=flat-square\u0026logo=github\"/\u003e\u003c/a\u003e\n\u003ca href=\"https://app.fossa.io/projects/git%2Bgithub.com%2Fmarcoonroad%2Fsporadic?ref=badge_shield\" alt=\"FOSSA Status\"\u003e\u003cimg src=\"https://app.fossa.io/api/projects/git%2Bgithub.com%2Fmarcoonroad%2Fsporadic.svg?type=shield\"/\u003e\u003c/a\u003e\n\u003ca href=\"https://dev.azure.com/marcoonroad/marcoonroad/_build/latest?definitionId=1\u0026branchName=master\" alt=\"Build Status\"\u003e\u003cimg src=\"https://dev.azure.com/marcoonroad/marcoonroad/_apis/build/status/marcoonroad.sporadic?branchName=master\"/\u003e\u003c/a\u003e\n\n---\n\n## Example\n\n```javascript\n#!/usr/bin/env node\n\n(async () =\u003e {\n  const sporadic = require('sporadic')\n  const channel = await sporadic.channels.open()\n\n  const wasReceivedPromise = sporadic.channels.send(channel, \"Hello, World!\")\n  const messagePromise = sporadic.channels.receive(channel)\n  const promises = [ wasReceivedPromise, messagePromise ]\n\n  const [ wasReceived, message ] = await Promise.all(promises)\n  console.log(wasReceived) // ==\u003e true\n  console.log(message) // ==\u003e Hello, World!\n})()\n```\n\n---\n\n## Installation\n\nThrough UNPKG (for browsers):\n\n```html\n\u003cscript src=\"https://unpkg.com/sporadic/dist/index.js\"\u003e\u003c/script\u003e\n```\n\nThrough NPM:\n\n```shell\n$ npm install sporadic\n```\n\n---\n\nTo install the development snapshot, use `npm link`.\nFor example, on this cloned repository:\n\n```shell\n$ npm link .\n```\n\nAnd then, on your project:\n\n```shell\n$ npm link sporadic\n```\n\nStable releases are tags in the branch `release`. The `master` branch here is\nonly to track the next releases, please don't rely too much on that branch. All\nthe hard work is made on the `development` branch.\n\n## Documentation\n\nFor every submodule within this `sporadic` library, there's an API documentation\navailable at the directory `docs/` under the filename `SUBMODULE.md`, where\n`SUBMODULE` stands for the submodule provided with this library (yes, I know the\nredundancy :joy:). Each submodule corresponds to a concurrency abstraction.\nCurrently, the following abstractions are implemented:\n\n- [sporadic.streams][1], an abstraction for reactive streams made of multiple\n  publishers and multiple subscribers. The subscription process is implicit,\n  the reference for the stream object is all that is needed.\n- [sporadic.channels][2], an abstraction for synchronous queues made of many\n  producers and consumers. This concurrent data type is a bare minimal tool for\n  pipelines of chained producers and consumers.\n- [sporadic.coroutines][3], an abstraction for suspendable subroutines. Such\n  abstraction also behaves as a task/promise whenever we wait for the final\n  coroutine result (but keep in mind that coroutines can \"loop\" forever). It's kinda\n  like the JavaScript generators, with the sole difference of being asynchronous\n  instead synchronous calls (and thus, allowing us to mix asynchronous I/O with that).\n\n  [1]: https://marcoonroad.github.io/sporadic/streams\n  [2]: https://marcoonroad.github.io/sporadic/channels\n  [3]: https://marcoonroad.github.io/sporadic/coroutines\n\n## Remarks\n\nPRs \u0026 Issues are always welcome :house:! Feel free to open one :v:!\nHappy hacking :computer:!\n\n\n## License\n[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2Fmarcoonroad%2Fsporadic.svg?type=large)](https://app.fossa.io/projects/git%2Bgithub.com%2Fmarcoonroad%2Fsporadic?ref=badge_large)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarcoonroad%2Fsporadic","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmarcoonroad%2Fsporadic","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarcoonroad%2Fsporadic/lists"}