Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

async-await-mutex-lock

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

async-await-mutex-lock - npm Package Compare versions

Comparing version 1.0.2 to 1.0.3

4

package.json
{
"name": "async-await-mutex-lock",
"version": "v1.0.2",
"description": "Mutex locks for async functions with functionality to add keys for separate locks",
"version": "v1.0.3",
"description": "Mutex locks for async functions with functionality to use keys for separate locks",
"main": "index.js",

@@ -6,0 +6,0 @@ "scripts": {

# Async Await Mutex Lock
![Tests](https://github.com/malhotra-sidharth/async-await-mutex-lock/workflows/Running%20All%20Tests%20and%20Publish%20to%20NPM/badge.svg)
![Tests](https://github.com/malhotra-sidharth/async-await-mutex-lock/workflows/Tests/badge.svg)
Mutex locks for async functions with functionality to add keys for separate locks
Mutex locks for async functions with functionality to use keys for separate locks

@@ -31,3 +31,4 @@ [![NPM](https://nodei.co/npm/async-await-mutex-lock.png)](https://nodei.co/npm/async-await-mutex-lock/)

#### With Key
All the keys will have their own separate locks and separate waiting lists;
All the keys will have their own separate locks and separate waiting lists. A key can have
any type (eg. string, number, etc. or a custom type allowed by typescript as a Map key)
```javascript

@@ -38,3 +39,3 @@ import Lock from "async-await-mutex-lock";

async function test(): Promise<void> {
async function test() {
await lock.acquire("myKey");

@@ -51,3 +52,3 @@

async function testTwo(): Promise<void> {
async function testTwo() {
await lock.acquire("myKeyTwo");

@@ -71,3 +72,3 @@

async function test(): Promise<void> {
async function test() {
await lock.acquire();

@@ -85,3 +86,3 @@

async function test(): Promise<void> {
async function test() {
await lock.acquire("myKey");

@@ -94,7 +95,7 @@

### Issues or Bugs
#### Issues or Bugs
In case of any issues or bugs, please open a pull request [here](https://github.com/malhotra-sidharth/async-await-mutex-lock/pulls)
###### Credits
#### Credits
This package has been inspired from [await-lock](https://www.npmjs.com/package/await-lock)
with an added functionality of allowing keys and checking if lock has been acquired or not
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc