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

semaphore

Package Overview
Dependencies
Maintainers
2
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

semaphore - npm Package Compare versions

Comparing version 1.0.5 to 1.1.0

18

lib/semaphore.js

@@ -5,2 +5,8 @@ ;(function(global) {

var nextTick = function (fn) { setTimeout(fn, 0); }
if (typeof process != 'undefined' && process && typeof process.nextTick == 'function') {
// node.js and the like
nextTick = process.nextTick;
}
function semaphore(capacity) {

@@ -72,8 +78,8 @@ var semaphore = {

if (typeof process != 'undefined' && process && typeof process.nextTick == 'function') {
// node.js and the like
process.nextTick(item.task);
} else {
setTimeout(item.task,0);
}
nextTick(item.task);
},
available: function(n) {
n = n || 1;
return(semaphore.current + n <= semaphore.capacity);
}

@@ -80,0 +86,0 @@ };

{
"name": "semaphore",
"version": "1.0.5",
"version": "1.1.0",
"description": "semaphore for node",

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

@@ -21,2 +21,5 @@ semaphore.js

sem.leave([n])
// Available
sem.available([n])
```

@@ -23,0 +26,0 @@

Sorry, the diff of this file is not supported yet

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