{"id":28795677,"url":"https://github.com/bakerface/csp","last_synced_at":"2025-09-09T22:46:11.810Z","repository":{"id":38218850,"uuid":"258811676","full_name":"bakerface/csp","owner":"bakerface","description":"Communicating Sequential Processes in TypeScript","archived":false,"fork":false,"pushed_at":"2023-01-07T04:40:10.000Z","size":566,"stargazers_count":0,"open_issues_count":7,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-18T03:09:53.255Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","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/bakerface.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}},"created_at":"2020-04-25T15:38:51.000Z","updated_at":"2021-03-27T12:18:33.000Z","dependencies_parsed_at":"2023-02-06T12:01:35.292Z","dependency_job_id":null,"html_url":"https://github.com/bakerface/csp","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/bakerface/csp","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bakerface%2Fcsp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bakerface%2Fcsp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bakerface%2Fcsp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bakerface%2Fcsp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bakerface","download_url":"https://codeload.github.com/bakerface/csp/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bakerface%2Fcsp/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265849011,"owners_count":23838195,"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":"2025-06-18T03:09:53.211Z","updated_at":"2025-07-18T23:06:33.449Z","avatar_url":"https://github.com/bakerface.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# CSP\n**Communicating Sequential Processes in TypeScript**\n\n\n## Example\n\n``` typescript\nimport * as csp from \"@bakerface/csp\";\n\nconst sleep = (ms: number) =\u003e\n  new Promise\u003cvoid\u003e((resolve) =\u003e setTimeout(resolve, ms));\n\nasync function producer(\n  ch: csp.OutputChannel\u003cstring\u003e,\n  id: string,\n  idle: number\n) {\n  for (;;) {\n    await sleep(idle);\n    await csp.put(ch, id);\n  }\n}\n\nasync function consumer(ch: csp.InputChannel\u003cstring\u003e) {\n  for (;;) {\n    const id = await csp.take(ch);\n    console.log(id);\n  }\n}\n\nasync function main() {\n  const ch = csp.chan\u003cstring\u003e();\n\n  await Promise.all([\n    producer(ch, \"250ms\", 250),\n    producer(ch, \"1s\", 1000),\n    consumer(ch),\n  ]);\n}\n\nmain().catch((err) =\u003e {\n  console.error(err);\n  process.exit(1);\n});\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbakerface%2Fcsp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbakerface%2Fcsp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbakerface%2Fcsp/lists"}