1.0.0 • Published 5 years ago

easy-mutex v1.0.0

Weekly downloads
5
License
ISC
Repository
github
Last release
5 years ago

easy-mutex

This package is the mutex tool for nodejs

Getting Started

npm i easy-mutex

var mutex = require("easy-mutex")

Examples

example 1:

await mutex.lock('key1',function (key) {
    // ...
    await mutex.unlock(key);
})

example 2:

await mutex.lock('key2')

if(mutex.locked('key2')) {
    // ...
}

if(await mutex.locked('key2')) {
    // ...
}

await mutex.unlock('key2')
1.0.0

5 years ago