New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

queue-up

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

queue-up - npm Package Compare versions

Comparing version 1.1.1 to 1.2.0

10

index.js

@@ -0,1 +1,3 @@

'use strict';
var Queue = module.exports = function (interval, P) {

@@ -7,3 +9,3 @@ this.interval = (interval > 0) ? interval : 1000;

Queue.prototype.up = Queue.prototype.enqueue = function () {
Queue.prototype.up = Queue.prototype.enqueue = function (value) {
var now = Date.now();

@@ -20,4 +22,8 @@

return new this.Promise(function (resolve) {
setTimeout(resolve, remains);
var asyncSetTimer = remains || typeof setImmediate === 'undefined' ? setTimeout : setImmediate;
asyncSetTimer(function () {
resolve(value);
}, remains);
});
};

2

package.json
{
"name": "queue-up",
"version": "1.1.1",
"version": "1.2.0",
"description": "Simple promise-based function queue",

@@ -5,0 +5,0 @@ "license": "MIT",

@@ -25,3 +25,3 @@ # queue-up [![Build Status](https://travis-ci.org/dsblv/queue-up.svg?branch=master)](https://travis-ci.org/dsblv/queue-up)

[
const users = [
'dsblv',

@@ -31,9 +31,13 @@ 'strikeentco',

'octocat'
].forEach(user => {
queue.up()
.then(ghGot('users/' + user, {token: 'koten'}))
];
for (var i in users) {
queue.up(users[i])
.then(user => {
return ghGot('users/' + user, {token: 'koten'});
})
.then(data => {
console.log(data.body.name + ' is in ' + data.body.location);
});
});
}

@@ -45,5 +49,5 @@ ```

### `queue = new Queue([interval], [promiseModule])`
### new Queue([interval], [promiseModule])
Create new instance of Queue. Or several instances if you need different queues.
Creates new instance of Queue.

@@ -62,3 +66,3 @@ #### interval

### `queue.up()` → `promise`
### queue.up([value]) → `promise`

@@ -69,5 +73,13 @@ Alias: `queue.enqueue()`

#### value
Value to be passed to `resolve` handler function:
```js
queue.up('hello').then(console.log);
//=> hello
```
## License
MIT © [Dimzel Sobolev](http://vk.com/sobo13v)
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