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

vanilla-queues-js

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vanilla-queues-js - npm Package Compare versions

Comparing version 1.0.4 to 1.0.5

_config.yml

4

dist/vanilla-queues.js

@@ -16,2 +16,4 @@ var VanillaQueues = /** @class */ (function () {

VanillaQueues.prototype.runJobs = function () {
if (this._stackJobs.length <= this._queueCount)
this._queueCount = this._stackJobs.length;
this._stackJobs = this._stackJobs.reverse();

@@ -47,2 +49,2 @@ this.queueActual = this._queueCount;

}());
// export { VanillaQueues, queueCallback, IVanillaQueues };
// export { VanillaQueues, queueCallback, IVanillaQueues };

@@ -18,2 +18,4 @@ "use strict";

VanillaQueues.prototype.runJobs = function () {
if (this._stackJobs.length <= this._queueCount)
this._queueCount = this._stackJobs.length;
this._stackJobs = this._stackJobs.reverse();

@@ -50,5 +52,6 @@ this.queueActual = this._queueCount;

exports.VanillaQueues = VanillaQueues;
// let vanilaQue = new VanillaQueues<number>(1);
// for (let index = 0; index < 10; index++) {
// let vanilaQue = new VanillaQueues<number>(10);
// for (let index = 0; index < 5; index++) {
// vanilaQue.addJob((data, counter) => {
// console.log(counter,"****");
// setTimeout(() => {

@@ -55,0 +58,0 @@ // console.log(data, "------> executed ---->", counter);

@@ -55,2 +55,4 @@

public runJobs(): void {
if (this._stackJobs.length <= this._queueCount)
this._queueCount = this._stackJobs.length;
this._stackJobs = this._stackJobs.reverse();

@@ -80,4 +82,4 @@ this.queueActual = this._queueCount;

}[];
private _queueCount: number;

@@ -97,5 +99,6 @@

// let vanilaQue = new VanillaQueues<number>(1);
// for (let index = 0; index < 10; index++) {
// let vanilaQue = new VanillaQueues<number>(10);
// for (let index = 0; index < 5; index++) {
// vanilaQue.addJob((data, counter) => {
// console.log(counter,"****");
// setTimeout(() => {

@@ -102,0 +105,0 @@ // console.log(data, "------> executed ---->", counter);

{
"name": "vanilla-queues-js",
"version": "1.0.4",
"version": "1.0.5",
"description": "create jobs in queues this can be handle in node, typescript, angular, react, vue, and all js based framework",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -5,2 +5,67 @@ # vanilla-queues-js

Please see in the EXAMPLE folder inside the folder...
Please see in the [EXAMPLE / DEMO](https://umbrashia.github.io/vanilla-queues-js/example/example.html)
### In TypeScript/React/Angular/VueJs/NodeJs
```
import * as vanillaQueuesJs from "vanilla-queues-js";
// creating object
let vanilaQue = new vanillaQueuesJs.VanillaQueues<number>(5);
//set your jobs
for (let index = 0; index < 100; index++) {
//Add into stack
vanilaQue.addJob((data, counter) => {
//AJAX CAMOUFLAGE (WAIT FOR RANDOM 1 to 3 SEC)
setTimeout(() => {
console.log(data, "------> executed ---->", counter);
//------
vanilaQue.jobDone();//MARK AS SINGLE JOB IS DONE AFTER CALL "jobDone()" next job is start
//-----
}, Math.floor(Math.random() * 3000) + 1000);
}, index);
}
vanilaQue.isDone(() => {
console.log("All Jobs are done...");
});
```
### In Pure-Javascript/Browser based
```
<script src="../dist/vanilla-queues.js"></script>
<script>
let vanilaQue = new VanillaQueues<number>(5);
for (let index = 0; index < 100; index++) {
vanilaQue.addJob((data, counter) => {
console.log(counter,"****");
setTimeout(() => {
console.log(data, "------> executed ---->", counter);
vanilaQue.jobDone();
}, Math.floor(Math.random() * 3000) + 1000);//Math.floor(Math.random() * 2000) +
}, index);
}
vanilaQue.isDone(() => {
console.log("oeeeeee done...");
});
</script>
```

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