
Company News
Socket Named Top Sales Organization by RepVue
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.
@koph-npm/browser-locker
Advanced tools
> Mutex simples entre abas do navegador usando `localStorage` + `StorageEvent`.
Mutex simples entre abas do navegador usando
localStorage+StorageEvent.
Este utilitário permite coordenar o acesso a recursos compartilhados entre diferentes abas abertas de uma mesma aplicação. Ideal para evitar execuções concorrentes de operações como refresh token, jobs programados, etc.
npm install @koph-npm/browser-locker
import { Locker } from '@koph-npm/browser-locker';
const tokenLocker = Locker("token-locked");
await tokenLocker.block(5000); // tenta adquirir o lock por 5s
try {
// seção crítica - apenas uma aba entra aqui
const data = await fetch("/api/refresh-token").then(r => r.json());
localStorage.setItem("api_token", data.token);
} finally {
tokenLocker.release();
}
Locker(key: string)Retorna um objeto com duas funções:
await block(timeoutMs?: number): Promise<number>0 se conseguiu imediatamente1 se aguardou outra aba liberar2 se expirou o tempo de esperarelease(): voidlocalStorage para persistir o lock entre abas.MIT
Koph kophmail@gmail.com
FAQs
> Mutex simples entre abas do navegador usando `localStorage` + `StorageEvent`.
We found that @koph-npm/browser-locker demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Company News
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.

Security News
NIST will stop enriching most CVEs under a new risk-based model, narrowing the NVD's scope as vulnerability submissions continue to surge.

Company News
/Security News
Socket is an initial recipient of OpenAI's Cybersecurity Grant Program, which commits $10M in API credits to defenders securing open source software.