whatisgithub

What is idb-mutex?

robertknight/idb-mutex — explained in plain English

Analysis updated 2026-07-17 · repo last pushed 2022-04-26

9TypeScriptAudience · developerComplexity · 2/5DormantSetup · easy

In one sentence

A TypeScript library that uses IndexedDB to create a cross-tab mutex, so only one browser tab performs a critical action at a time.

Mindmap

mindmap
  root((idb-mutex))
    What it does
      Cross tab locking
      Atomic check and update
      Auto expiring locks
    Tech stack
      TypeScript
      IndexedDB
      Browser
    Use cases
      Prevent duplicate sync to server
      Coordinate shared resource access
      Handle crashed tab cleanup
    Audience
      Web developers
    Alternative
      Native Web Locks API
      Legacy browser support

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

What do people build with it?

USE CASE 1

Ensure only one open browser tab syncs local data to the server at a time.

USE CASE 2

Give multiple tabs exclusive turn-based access to a shared resource like a local database write.

USE CASE 3

Set an auto-expiring lock so a crashed or closed tab doesn't leave the resource permanently locked.

USE CASE 4

Support cross-tab locking in older browsers that lack the native Web Locks API.

What is it built with?

TypeScriptIndexedDB

How does it compare?

robertknight/idb-mutexmaximseshuk/payload-plugin-openapiobaidqatan/liquid-glass-component-library
Stars999
LanguageTypeScriptTypeScriptTypeScript
Last pushed2022-04-26
MaintenanceDormant
Setup difficultyeasyeasyeasy
Complexity2/52/52/5
Audiencedeveloperdevelopervibe coder

Figures from each repo's GitHub metadata at analysis time.

How do you get it running?

Difficulty · easy Time to first run · 5min

Native Web Locks API is preferred on modern browsers, this is mainly for legacy browser support.

Copy-paste prompts

Prompt 1
Show me how to use idb-mutex to make sure only one browser tab syncs data to my server at a time.
Prompt 2
Write example code using idb-mutex to create a named lock with a 30 second expiry for a shared resource.
Prompt 3
Explain why idb-mutex uses IndexedDB instead of localStorage for cross-tab locking.
Prompt 4
Should I use idb-mutex or the native Web Locks API for my app, and how do I migrate between them?

Frequently asked questions

What is idb-mutex?

A TypeScript library that uses IndexedDB to create a cross-tab mutex, so only one browser tab performs a critical action at a time.

What language is idb-mutex written in?

Mainly TypeScript. The stack also includes TypeScript, IndexedDB.

Is idb-mutex actively maintained?

Dormant — no commits in 2+ years (last push 2022-04-26).

How hard is idb-mutex to set up?

Setup difficulty is rated easy, with roughly 5min to a first successful run.

Who is idb-mutex for?

Mainly developer.

Open on GitHub → Ask about another repo

This repo across BitVibe Labs

Verify against the repo before relying on details.