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

@bradleymeck/thenables

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@bradleymeck/thenables - npm Package Compare versions

Comparing version 1.0.1 to 1.1.0

2

package.json
{
"name": "@bradleymeck/thenables",
"version": "1.0.1",
"version": "1.1.0",
"description": "some simple utilities for awaiting",

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

@@ -62,1 +62,21 @@ # thenables

```
# semaphore
## semaphore.ExclusiveSemaphore
The most general use Semaphore, it expects to stay in the same thread.
```js
const ExclusiveSemaphore = require('./semaphore').ExclusiveSemaphore;
const semaphore = new ExclusiveSemaphore(+process.argv[2] || 1);
;(async () => {
let {unlock} = await semaphore;
console.log('start: A');
await {
then: f => setTimeout(f, 1000)
}
console.log('close: A');
unlock();
})();
```
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