{"id":22709482,"url":"https://github.com/mstephen19/tiny-mutex","last_synced_at":"2026-02-25T21:05:28.543Z","repository":{"id":65332081,"uuid":"589800541","full_name":"mstephen19/tiny-mutex","owner":"mstephen19","description":"Lightweight and simple mutexes in Node.js.","archived":false,"fork":false,"pushed_at":"2024-12-29T02:37:17.000Z","size":5,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-09-01T09:55:24.971Z","etag":null,"topics":["concurrency","mutex","node","nodejs","syncrhonization","typescript"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/tiny-mutex","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/mstephen19.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,"zenodo":null}},"created_at":"2023-01-17T00:51:12.000Z","updated_at":"2024-12-29T02:37:20.000Z","dependencies_parsed_at":"2025-04-12T12:16:39.564Z","dependency_job_id":null,"html_url":"https://github.com/mstephen19/tiny-mutex","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/mstephen19/tiny-mutex","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mstephen19%2Ftiny-mutex","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mstephen19%2Ftiny-mutex/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mstephen19%2Ftiny-mutex/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mstephen19%2Ftiny-mutex/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mstephen19","download_url":"https://codeload.github.com/mstephen19/tiny-mutex/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mstephen19%2Ftiny-mutex/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29839976,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-25T20:42:33.054Z","status":"ssl_error","status_checked_at":"2026-02-25T20:42:21.322Z","response_time":61,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["concurrency","mutex","node","nodejs","syncrhonization","typescript"],"created_at":"2024-12-10T11:09:56.258Z","updated_at":"2026-02-25T21:05:28.525Z","avatar_url":"https://github.com/mstephen19.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Tiny Mutex\n\n[![TypeScript](https://badgen.net/badge/-/TypeScript/blue?icon=typescript\u0026label)](https://www.typescriptlang.org/) [![Install size](https://packagephobia.com/badge?p=speedwalk@latest)](https://packagephobia.com/result?p=tiny-mutex@latest)\n\nLightweight and simple mutexes.\n\n## Features\n\n- Zero dependencies. Small bundle size.\n- Written in TypeScript.\n- CommonJS \u0026 ESModules support.\n- Thread-safe. Works with worker threads and multithreading libraries like [Piscina](https://www.npmjs.com/package/piscina).\n- Simple to use. Modeled after Golang's [`sync.Mutex`](https://go.dev/tour/concurrency/9)\n\n## Usage\n\n```TypeScript\nimport { createMutex, lock, unlock } from 'tiny-mutex'\n\n// Create a mutex, usable in a cross-thread context\nconst mutex = createMutex();\n\nasync function doWorkflow(shared: Uint8Array) {\n    // Wait until the mutex is unlocked, then lock it.\n    await lock(mutex);\n\n    // Modify a resource normally without worrying about\n    // other threads modifying it at the same time.\n    shared.set([1, 2, 3])\n\n    // Unlock the mutex once finished with modifying the\n    // resource, unblocking other agents.\n    unlock(mutex);\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmstephen19%2Ftiny-mutex","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmstephen19%2Ftiny-mutex","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmstephen19%2Ftiny-mutex/lists"}