{"id":19873980,"url":"https://github.com/metarhia/web-locks","last_synced_at":"2025-04-13T06:22:43.209Z","repository":{"id":42383366,"uuid":"245503142","full_name":"metarhia/web-locks","owner":"metarhia","description":"Web Locks API 🔒","archived":false,"fork":false,"pushed_at":"2025-01-03T21:50:42.000Z","size":208,"stargazers_count":88,"open_issues_count":14,"forks_count":11,"subscribers_count":11,"default_branch":"master","last_synced_at":"2025-04-04T05:05:48.295Z","etag":null,"topics":["async","atomics","await","data-race","deadlock","lock","locking","locks","multithreading","mutex","nodejs","parallel","race-detection","semaphore","shared-memory","sharedarraybuffer","synchronization","synchronize","threads","web-locks"],"latest_commit_sha":null,"homepage":"https://metarhia.com","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/metarhia.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"patreon":"tshemsedinov"}},"created_at":"2020-03-06T19:42:45.000Z","updated_at":"2025-02-17T09:30:41.000Z","dependencies_parsed_at":"2024-03-20T12:27:46.304Z","dependency_job_id":"37b792df-3140-47f1-b08e-a8d56be1f43d","html_url":"https://github.com/metarhia/web-locks","commit_stats":{"total_commits":50,"total_committers":1,"mean_commits":50.0,"dds":0.0,"last_synced_commit":"621e3029015b24093e23695e4c2bf57caff7b0f0"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/metarhia%2Fweb-locks","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/metarhia%2Fweb-locks/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/metarhia%2Fweb-locks/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/metarhia%2Fweb-locks/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/metarhia","download_url":"https://codeload.github.com/metarhia/web-locks/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248665752,"owners_count":21142123,"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","atomics","await","data-race","deadlock","lock","locking","locks","multithreading","mutex","nodejs","parallel","race-detection","semaphore","shared-memory","sharedarraybuffer","synchronization","synchronize","threads","web-locks"],"created_at":"2024-11-12T16:20:53.958Z","updated_at":"2025-04-13T06:22:43.154Z","avatar_url":"https://github.com/metarhia.png","language":"JavaScript","funding_links":["https://patreon.com/tshemsedinov"],"categories":[],"sub_categories":[],"readme":"# Web Locks API [![CI Status](https://github.com/metarhia/web-locks/workflows/Testing%20CI/badge.svg)](https://github.com/metarhia/web-locks/actions?query=workflow%3A%22Testing+CI%22+branch%3Amaster) [![npm version](https://img.shields.io/npm/v/web-locks.svg?style=flat)](https://www.npmjs.com/package/web-locks) [![npm downloads/month](https://img.shields.io/npm/dm/web-locks.svg)](https://www.npmjs.com/package/web-locks) [![npm downloads](https://img.shields.io/npm/dt/web-locks.svg)](https://www.npmjs.com/package/web-locks) [![license](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/metarhia/web-locks/blob/master/LICENSE)\n\n[Web Locks API](https://developer.mozilla.org/en-US/docs/Web/API/Lock)\nimplementation for [Node.js](https://nodejs.org/en/) based on\n[`worker_threads`](https://nodejs.org/api/worker_threads.html),\n[`Atomics`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Atomics),\n[`SharedArrayBuffer`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/SharedArrayBuffer),\n[asynchronous functions](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/async_function),\nand [queue](https://en.wikipedia.org/wiki/Queue_(abstract_data_type)).\n\nSee specification: [wicg.github.io/web-locks/](https://wicg.github.io/web-locks/)\nand documentation: [developer.mozilla.org/en-US/docs/Web/API/Lock](https://developer.mozilla.org/en-US/docs/Web/API/Lock)\n\nThis implementation is a part of [Metarhia](https://github.com/metarhia/)\ntechnology stack, needed for the first pilot project of Node.js application\nserver based on parallel programming and workload micro-isolation. Web Locks\nAPI is intended to be merged into Node.js in future.\n\n## Features\n\n* Simplest parallel programming primitive to solve a problem of data races and\nrace conditions.\n* Node.js and [`worker_threads`](https://nodejs.org/api/worker_threads.html)\nsupport.\n* Different optimized implementations for certain cases: single-threaded\nasynchronous locks, multi-threaded locks with a single unifyed API.\n\n## Installation\n\n```bash\n$ npm install web-locks\n```\n\n## Usage\n\n```js\nawait locks.request('Resource name', async lock =\u003e {\n  // use named resource and release it after return\n});\n```\n\n## License\n\nThis implementation of Web Locks API is [MIT licensed](./LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmetarhia%2Fweb-locks","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmetarhia%2Fweb-locks","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmetarhia%2Fweb-locks/lists"}