{"id":19472007,"url":"https://github.com/7c/tcp-mutex","last_synced_at":"2026-01-15T22:11:19.282Z","repository":{"id":129721236,"uuid":"118134914","full_name":"7c/tcp-mutex","owner":"7c","description":"very naive implementation of mutex nodejs applications over 'locking' a tcp port","archived":false,"fork":false,"pushed_at":"2024-09-23T21:31:46.000Z","size":83,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-10-28T03:51:29.892Z","etag":null,"topics":["mutex-lock","nodejs","tcp"],"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/7c.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":"2018-01-19T14:28:04.000Z","updated_at":"2024-09-23T21:31:48.000Z","dependencies_parsed_at":"2024-10-10T21:01:12.117Z","dependency_job_id":"db943551-8802-44d4-b2f0-f52bf0f40fe7","html_url":"https://github.com/7c/tcp-mutex","commit_stats":{"total_commits":8,"total_committers":2,"mean_commits":4.0,"dds":0.5,"last_synced_commit":"99565cfd515397d21781cf90d8c04be769b2eb93"},"previous_names":["taskinosman/tcp-mutex"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/7c/tcp-mutex","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/7c%2Ftcp-mutex","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/7c%2Ftcp-mutex/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/7c%2Ftcp-mutex/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/7c%2Ftcp-mutex/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/7c","download_url":"https://codeload.github.com/7c/tcp-mutex/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/7c%2Ftcp-mutex/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28472624,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-15T20:50:13.584Z","status":"ssl_error","status_checked_at":"2026-01-15T20:49:17.379Z","response_time":62,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5: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":["mutex-lock","nodejs","tcp"],"created_at":"2024-11-10T19:11:42.916Z","updated_at":"2026-01-15T22:11:19.265Z","avatar_url":"https://github.com/7c.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# tcp-mutex\nThis small library is there to acquire a tcp based lock by opening a tcp-server. Since ports cannot be listened from more than 1 process we can use this behaviour to acquire a kind of lock based on tcp-port.\n\n## Installation\n```bash\nnpm i --save https://github.com/7c/tcp-mutex \n```\n\n## Typescript\n```typescript\nimport { tryLock } from '@7c/tcp-mutex';\n\n// somewhere in your main code entry\nawait tryLock(1337)\n```\n\n## CommonJS\n```javascript\nconst { tryLock } = require('@7c/tcp-mutex');\n\ntryLock(1337).then(()=\u003e{\n    console.log(\"locked successfully\");\n    // we can start our application here\n}).catch(err=\u003e{\n    console.log(\"This application already started\");\n    process.exit(0);\n});\n```\n\n## Demo\n![Demonstration](https://github.com/7c/tcp-mutex/blob/master/tcpmutex.gif?raw=true \"Demonstration\")\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F7c%2Ftcp-mutex","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F7c%2Ftcp-mutex","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F7c%2Ftcp-mutex/lists"}