Socket
Socket
Sign inDemoInstall

async-mutex

Package Overview
Dependencies
Maintainers
1
Versions
18
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

async-mutex - npm Package Compare versions

Comparing version 0.2.1 to 0.2.2

4

CHANGELOG.md
# Changelog
## 0.2.2
* Improve compatibility with older versions of node 13, thanks to @josemiguelmelo
## 0.2.1

@@ -4,0 +8,0 @@

5

package.json
{
"name": "async-mutex",
"version": "0.2.1",
"version": "0.2.2",
"description": "A mutex for guarding async workflows",

@@ -79,3 +79,4 @@ "scripts": {

"import": "./index.mjs",
"require": "./lib/index.js"
"require": "./lib/index.js",
"default": "./lib/index.js"
},

@@ -82,0 +83,0 @@ "dependencies": {

@@ -45,3 +45,3 @@ [![Build Status](https://travis-ci.org/DirtyHairy/async-mutex.svg?branch=master)](https://travis-ci.org/DirtyHairy/async-mutex)

As long as the semaphore value is positive, locking it will return the current value
and the locking process will continue execution immediatelly; the semaphore will
and the locking process will continue execution immediately; the semaphore will
be decremented upon locking. Releasing the lock will increment the semaphore again.

@@ -72,2 +72,5 @@

**WARNING:** Node 13 versions < 13.2.0 fail to import this package correctly.
Node 12 and earlier are fine, as are newer versions of node 13.
## Importing

@@ -119,4 +122,3 @@

try {
const i = await store.get();
await store.put(i + 1);
// ...
} finally {

@@ -156,3 +158,3 @@ release();

`runExclusive` schedules the supplied callback to be run once the mutex is unlocked.
The function may return a promise. Once the promise is resolved or rejected (or immediatelly after
The function may return a promise. Once the promise is resolved or rejected (or immediately after
execution if an immediate value was returned),

@@ -234,3 +236,3 @@ the mutex is released. `runExclusive` returns a promise that adopts the state of the function result.

The callback will receive the current value of the semaphore as its argument.
The function may return a promise. Once the promise is resolved or rejected (or immediatelly after
The function may return a promise. Once the promise is resolved or rejected (or immediately after
execution if an immediate value was returned),

@@ -237,0 +239,0 @@ the semaphore is released. `runExclusive` returns a promise that adopts the state of the function result.

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