Join our webinar on Wednesday, June 26, at 1pm EDTHow Chia Mitigates Risk in the Crypto Industry.Register
Socket
Socket
Sign inDemoInstall

pjobs

Package Overview
Dependencies
0
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.0.0 to 1.0.1

dist/asap.d.ts

5

dist/index.js

@@ -1,1 +0,4 @@

var g=Object.defineProperty;var y=n=>g(n,"__esModule",{value:!0});var w=(n,o)=>{y(n);for(var t in o)g(n,t,{get:o[t],enumerable:!0})};w(exports,{defer:()=>b,queuePromises:()=>P,sleep:()=>v});function v(n){return new Promise(o=>{setTimeout(o,n)})}function b(){let n,o;return{promise:new Promise((e,s)=>{n=e,o=s}),resolve(e){n&&n(e)},reject(e){o&&o(e)}}}function P({concurrency:n,onProgress:o}){let t=[],e=0,s=!0,a=Date.now(),i=0,c=0,f=0,m={total(){return e},pending(){return t.length},done(){return e-t.length},percent(){return(e-t.length)/e},rate(){let r=Date.now();return r>c?"-":(e-t.length)/(r-a)},timeRemaining(){let r=Date.now();if(r>c)return"-";let T=(r-a)/1e3,x=(e-t.length)/T,u=(e-t.length)/x;if(u<50)return u.toFixed(0)+" seconds";if(u<120)return"one minute";let l=u/60;if(l<60)return l.toFixed(0)+" minutes";let d=l/60;return d<120?"one hour":d.toFixed(0)+" hours"}};return{state(){return s?"idle":m},enqueue(r){t.push(r),e++,c=Date.now()+1e3,p()}};function p(){s&&(a=Date.now(),s=!1);let r=Date.now();r>f&&(f=r+1e3,setTimeout(()=>{o(m)},1)),t.length?i<n&&setTimeout(h,1):i<1&&(e=0,s=!0)}async function h(){if(t.length<1)return;let r=t.shift();i++;try{await r()}finally{i--,p()}}}
export * from './sleep';
export * from './defer';
export * from './queue';
//# sourceMappingURL=index.js.map

26

package.json
{
"name": "pjobs",
"description": "Efficient promise queue job manager",
"version": "1.0.0",
"index": "dist/index.js"
"description": "A simple and efficient queue job executor using promises. And some promise's utilities.",
"version": "1.0.1",
"private": false,
"main": "dist/index.js",
"types": "dist/index.d.ts",
"devDependencies": {
"@types/jest": "^27.0.2",
"@types/source-map-support": "^0.5.4",
"dts-bundle-generator": "^5.9.0",
"esbuild": "^0.13.9",
"esbuild-jest": "^0.5.0",
"jest": "^27.3.1",
"source-map-support": "^0.5.20",
"ts-jest": "^27.0.7",
"typescript": "^4.4.4"
},
"scripts": {
"buildDTS": "dts-bundle-generator --project ./tsconfig.build.json --verbose",
"buildWithTSC": "tsc -p ./tsconfig.build.json",
"prepublish2": "yarn test && yarn buildWithTSC",
"test": "jest --config ../jest.config.js .",
"clean": "monoclean clean"
}
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc