{"id":17743119,"url":"https://github.com/julien-r44/verrou","last_synced_at":"2025-08-21T15:31:55.387Z","repository":{"id":215683750,"uuid":"736442796","full_name":"Julien-R44/verrou","owner":"Julien-R44","description":"🔒 Verrou is a library for managing Locks in Node.js. Support multiple drivers","archived":false,"fork":false,"pushed_at":"2024-05-03T06:46:29.000Z","size":2354,"stargazers_count":148,"open_issues_count":0,"forks_count":3,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-05-03T12:20:42.718Z","etag":null,"topics":["lock","mutex","mysql","nodejs","postgres","redis"],"latest_commit_sha":null,"homepage":"https://verrou.dev","language":"TypeScript","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/Julien-R44.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","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},"funding":{"github":["julien-r44"],"polar":"Julien-R44"}},"created_at":"2023-12-27T23:28:21.000Z","updated_at":"2024-05-03T06:46:32.000Z","dependencies_parsed_at":"2024-03-19T17:26:51.996Z","dependency_job_id":"b007fafc-fe74-4990-94ff-83d5643118ab","html_url":"https://github.com/Julien-R44/verrou","commit_stats":null,"previous_names":["julien-r44/verrou"],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Julien-R44%2Fverrou","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Julien-R44%2Fverrou/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Julien-R44%2Fverrou/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Julien-R44%2Fverrou/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Julien-R44","download_url":"https://codeload.github.com/Julien-R44/verrou/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":230520390,"owners_count":18238948,"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":["lock","mutex","mysql","nodejs","postgres","redis"],"created_at":"2024-10-26T05:42:41.108Z","updated_at":"2024-12-20T01:15:07.108Z","avatar_url":"https://github.com/Julien-R44.png","language":"TypeScript","funding_links":["https://github.com/sponsors/julien-r44","https://polar.sh/Julien-R44","https://github.com/sponsors/Julien-R44/"],"categories":[],"sub_categories":[],"readme":"![banner](./assets/banner.png)\n\n\u003cp align=\"center\"\u003e\n  \u003cbr/\u003e\n  \u003ca href=\"https://verrou.dev/\"\u003eVerrou 🔐\u003c/a\u003e is a locking library for Node.js applications\n  \u003cbr/\u003e\n\u003c/p\u003e\n\n## Features\n\n- 🔒 Easy usage\n- 🔄 Multiple drivers (Redis, Postgres, MySQL, Sqlite, In-Memory and others)\n- 📦 Multiple database adapters ( Knex, Kysely ... )\n- 🔑 Customizable named locks\n- 🌐 Consistent API across all drivers\n- 🧪 Easy testing by switching to an in-memory driver\n- 🔨 Easily extensible with your own drivers\n\nSee documentation at [verrou.dev](https://verrou.dev/docs/introduction)\n\n## Why Verrou ? \n\nMain advantage of Verrou is that it provides a consistent API across all drivers. This means that you can switch from one driver to another without having to change your code. It also means you can switch to an in-memory in your test environment, making tests faster and easier to setup (no infrastructure or anything fancy to setup).\n\nHaving a consistent API also means that you don't have to learn a new API when switching from one driver to another. Today, in the node ecosystem, we have different npm packages to manage locks, but they all have differents APIs and behaviors.\n\nBut having a consistent API doesn't mean having a less powerful API. Verrou provides every features you would expect from a locking library, and even more.\n\n## Basic usage\n\n```ts\nimport { Verrou } from '@verrou/core'\nimport { redisStore } from '@verrou/core/drivers/redis'\nimport { memoryStore } from '@verrou/core/drivers/memory'\n\nconst verrou = new Verrou({\n  default: 'redis',\n  stores: {\n    redis: { driver: redisStore() },\n    memory: { driver: memoryStore() }\n  }\n})\n\n// Lock a resource and run a function\nawait verrou.createLock('my-resource').run(async () =\u003e {\n  await doSomething()\n}) // Lock is automatically released\n```\n\n## Sponsors\n\nIf you like this project, [please consider supporting it by sponsoring it](https://github.com/sponsors/Julien-R44/). It will help a lot to maintain and improve it. Thanks a lot !\n\n![](https://github.com/julien-r44/static/blob/main/sponsorkit/sponsors.png?raw=true)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjulien-r44%2Fverrou","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjulien-r44%2Fverrou","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjulien-r44%2Fverrou/lists"}