{"_id":"task-easy","_rev":"6-7957c1696679ca7e751756d1b625de0c","name":"task-easy","dist-tags":{"latest":"1.0.1"},"versions":{"0.1.0":{"name":"task-easy","version":"0.1.0","description":"A simple, customizable, and lightweight priority queue for promise based tasks.","main":"./micro-queue/index.js","scripts":{"test":"npm run lint && jest && npm run test:coverage && cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js","test:local":"npm run lint && jest && npm run test:coverage","test:watch":"jest --watch","test:coverage":"jest --coverage","test:detailed":"jest --verbose","test:update":"jest -u","lint":"eslint . --ext .js","lint:fix":"npm run lint -- --fix"},"keywords":["queue","task","worker","job","in-memory","priority","manager","utility","promise","Async"],"author":{"name":"Canaan Seaton"},"license":"MIT","devDependencies":{"coveralls":"^3.0.0","eslint":"^4.19.1","eslint-plugin-jest":"^21.15.0","jest":"^22.4.3"},"gitHead":"24ee29ff3fe572d4b5af2b22e1206e743b8a8479","_id":"task-easy@0.1.0","_npmVersion":"5.6.0","_nodeVersion":"9.9.0","_npmUser":{"name":"cmseaton42","email":"cmseaton42@gmail.com"},"dist":{"integrity":"sha512-Ne9RRpaoW41gx4O8PVtnp4HAj02gRR+RwF+EwWGCvSET3e0nNuJNz5PJ9u35wg/JmUJ/dJAz+ucpCuWV7LG1ZQ==","shasum":"af1568806ca365529d4c4267a002ebef00652de7","tarball":"https://registry.npmjs.org/task-easy/-/task-easy-0.1.0.tgz","fileCount":7,"unpackedSize":12988,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDNVczX0zTNDKD6koDpj054u/95y1M0h65u4wNsDy2oUwIhAMgFUw3Vg1mbusIlsXytw3Z/FonayXtYLajMs8u7RGGD"}]},"maintainers":[{"name":"cmseaton42","email":"cmseaton42@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/task-easy_0.1.0_1521828151038_0.582269471523259"},"_hasShrinkwrap":false},"0.2.0":{"name":"task-easy","version":"0.2.0","description":"A simple, customizable, and lightweight priority queue for promise based tasks.","main":"./src/index.js","scripts":{"test":"npm run lint && jest && npm run test:coverage && cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js","test:local":"npm run lint && jest && npm run test:coverage","test:watch":"jest --watch","test:coverage":"jest --coverage","test:detailed":"jest --verbose","test:update":"jest -u","lint":"eslint . --ext .js","lint:fix":"npm run lint -- --fix"},"keywords":["queue","task","worker","job","in-memory","priority","manager","utility","promise","Async"],"author":{"name":"Canaan Seaton"},"license":"MIT","devDependencies":{"coveralls":"^3.0.0","eslint":"^4.19.1","eslint-plugin-jest":"^21.15.0","jest":"^22.4.3"},"gitHead":"f4432518906a99a3323b333a4a64883ec79899ee","_id":"task-easy@0.2.0","_npmVersion":"5.6.0","_nodeVersion":"9.9.0","_npmUser":{"name":"cmseaton42","email":"cmseaton42@gmail.com"},"dist":{"integrity":"sha512-vjxMnoxo1zAQSguriduZXt5kOejTcGnmNuWbK2yyJtxO6KzaxR4JU8gXfZTXD6uBCnh2RWZdUcHzvHkQ5e04Ow==","shasum":"af3e4637b09d1da26705717934c0c6321c7810a7","tarball":"https://registry.npmjs.org/task-easy/-/task-easy-0.2.0.tgz","fileCount":7,"unpackedSize":13569,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEfJHEy535XtEmramHV1Kvqf7Nz8BRVNzNJ2+G8PkF1cAiAWEPcCGlpT6u6VDnit93Gp2+7+yf63nUf23fTRN+BExA=="}]},"maintainers":[{"name":"cmseaton42","email":"cmseaton42@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/task-easy_0.2.0_1522760409081_0.3549472326986809"},"_hasShrinkwrap":false},"0.2.1":{"name":"task-easy","version":"0.2.1","description":"A simple, customizable, and lightweight priority queue for promise based tasks.","main":"./src/index.js","types":"./src/index.d.ts","scripts":{"test":"npm run lint && jest && npm run test:coverage && cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js","test:local":"npm run lint && jest && npm run test:coverage","test:watch":"jest --watch","test:coverage":"jest --coverage","test:detailed":"jest --verbose","test:update":"jest -u","lint":"eslint . --ext .js","lint:fix":"npm run lint -- --fix"},"keywords":["queue","task","worker","job","in-memory","priority","manager","utility","promise","Async"],"author":{"name":"Canaan Seaton"},"license":"MIT","devDependencies":{"coveralls":"^3.0.9","eslint":"^6.8.0","eslint-plugin-jest":"^23.4.0","jest":"^24.9.0"},"gitHead":"568450e32e84a700b1407bf5637a775e1800b067","_id":"task-easy@0.2.1","_nodeVersion":"12.14.1","_npmVersion":"6.13.4","dist":{"integrity":"sha512-VMYezcVhfyaTkc3cWf4sSQG6YgYBdiNCAg4iXuUWRGB7tp7A/rZA9Nter0ZIG5chSoidLS0VWf87koFD9XHwDg==","shasum":"9c71f6f2221f04525dd29f698db6239d10b869a0","tarball":"https://registry.npmjs.org/task-easy/-/task-easy-0.2.1.tgz","fileCount":8,"unpackedSize":15731,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeG7pPCRA9TVsSAnZWagAAkUQQAIzaOSm6ei5Q+WDsSNN9\naxoFL+xeVSQ/d3iGqZ0LwWWzbVDF/FgdyustpaHJ4CYfyNdDiN2cYbiik3lF\nFFhOzCG5lRPBcrIq2jOwZwAhdVdqgxk0XO9kW/8rQLthr910OTvCHR51xp14\nbgr5Qpk4RBHrtVS24WSGFfLE5xc4klhgCwbUq/kHBWZ64xm6PlgdvBwPxQ0J\nAOrrJlHyIKtBSOu6lpGNDpMwee8QEJ6NxT/4rFIDqs9VGldg/t2CcSvzzwNF\nzpp2N5nA4RLRTN0MP0mRXYauZDixOGIOkN+X7ACxGb/qKCiAvc6ph5k7goed\nQbX8QqQo/9mCK8M/m0k2Gs5DMe9tFkifckpPeLBLglkbSe2nLwruNRJ4J4b3\nkm5u0deJ/meNGRQHPYuZFYARfxLK5dPjG34Tp4ncmr5ExC7qOk4gGJMVYqss\nTG4HQs90rTQxrAA9NdJM1EUTY9gKGnDPvtaeI67u92t4w1zwfQxHDJNup6Ch\nf2wJOL6toBq2/Q5quKqQQ7kYoju7Goizyk79QoMq71N4qFa6F81O+it3j+qi\nXVT2pHMzrTBnPqndccnia4FnB1QeYu523o+gNeOsnqHYVwhBYpOR9NBH539R\nlEb+ckXNFrb2s6HCe+KFDK/dQG5jMcuM+XY2aO60NPNWBv21eZ1ADbAOhx6R\nItCJ\r\n=Vnid\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCBArP7KPfD+CSzcVvJGFXR9zPdD3ExlSNAGzH3azpJuwIgCvTs9RCe6dEFF6Rwf/sJ0xskjgQmr4ypXfkblbCb/eE="}]},"maintainers":[{"name":"cmseaton42","email":"cmseaton42@gmail.com"}],"_npmUser":{"name":"cmseaton42","email":"cmseaton42@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/task-easy_0.2.1_1578875470653_0.16247344013803233"},"_hasShrinkwrap":false},"1.0.0":{"name":"task-easy","version":"1.0.0","description":"A simple, customizable, and lightweight priority queue for promise based tasks.","main":"./src/index.js","types":"./src/index.d.ts","scripts":{"test":"npm run lint && jest && npm run test:coverage && cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js","test:local":"npm run lint && jest && npm run test:coverage","test:watch":"jest --watch","test:coverage":"jest --coverage","test:detailed":"jest --verbose","test:update":"jest -u","lint":"eslint . --ext .js","lint:fix":"npm run lint -- --fix"},"keywords":["queue","task","worker","job","in-memory","priority","manager","utility","promise","Async"],"author":{"name":"Canaan Seaton"},"license":"MIT","devDependencies":{"coveralls":"^3.0.9","eslint":"^6.8.0","eslint-plugin-jest":"^23.4.0","jest":"^24.9.0"},"gitHead":"e12620ffd9611a8795019feec716aa0e177ee0a0","_id":"task-easy@1.0.0","_nodeVersion":"12.14.1","_npmVersion":"6.13.4","dist":{"integrity":"sha512-m9spbth/WygtoYRmb/1DlRar75ZujMyvq2fda6OE09EOFoDQPE72zJZzOtmTxaKEm4kuBGK0K/aDv8GZBOlsYA==","shasum":"b7c3e1b3f71172c08824b23c0044dc6d98fb167a","tarball":"https://registry.npmjs.org/task-easy/-/task-easy-1.0.0.tgz","fileCount":8,"unpackedSize":15583,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeHMQ7CRA9TVsSAnZWagAA4YwP/35YELU1aAekGK9yO4uB\neE9yum80UYr8fyvoUeyzmjxdopBHwSJBvWc93N4XQho59zGx/oBBZK/4n9Vh\n7E/jUrqzbObS/vcfYJh2mpySkUsKJc0VKvwCcWeNorX79bk82U2D46gPSaq4\nkFRTpD/erSdOF0iXiLFDbFxTBI07gCBIRGRnwL3rtoBjWTo75DTUXYwhQRfU\nqmcdBtZ4QVxgt5ET7iqvdju/XJvMhEhlA8jupE0jEwcroOf3KXLbpeHZsgoY\nLLehEu2FYKg+KqV3eutMrNtf0h3Li43UVbwp8g3RbTk7x30GB/lgTWt9MvvD\n0CE9JzDvPUKITR5XdvAkCaAJkxI8UDqCHAzhJ7JdyE1G9r3gLYk8yZqb6a7r\nUVPbmqijnFnCBuS41WWoTF0yjVGpNgr6rOdEDRfBRsbtllTuQTi3xNdqg2wM\nHOYGstamMIHKJATptfAiPbbcK3wCY7xGDITiptf/vWCweu6uRsw405F84SQi\nvsQLu+FD2H3iZg2ERfnc9U4YAVImwq07PXxtD/nOki/TsdWyLFlMUTkB/ehK\nI4i/sBoTyeUhRSlQJiRFuYo4b8//us+KMenOhiE1/UjowuVVkOiaQ7V2DAY5\nB8KnD90ISN1ZS6eg+ZR2su3khxkKikODbGljY0hJPEBmf3aGOfYrfLQRJ5kv\nn9WA\r\n=Bjr4\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHoaLNGvhqqgFxMQVVHckSruRYkX1+IQGJKaCFIMs38RAiBpNCkokoVqw4iqbbCFtfe95PepY8C7Pjs8jqYKEM4weA=="}]},"maintainers":[{"name":"cmseaton42","email":"cmseaton42@gmail.com"}],"_npmUser":{"name":"cmseaton42","email":"cmseaton42@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/task-easy_1.0.0_1578943546667_0.474149399183867"},"_hasShrinkwrap":false},"1.0.1":{"name":"task-easy","version":"1.0.1","description":"A simple, customizable, and lightweight priority queue for promise based tasks.","main":"./src/index.js","types":"./src/index.d.ts","scripts":{"test":"npm run lint && jest && npm run test:coverage && cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js","test:local":"npm run lint && jest && npm run test:coverage","test:watch":"jest --watch","test:coverage":"jest --coverage","test:detailed":"jest --verbose","test:update":"jest -u","lint":"eslint . --ext .js","lint:fix":"npm run lint -- --fix"},"keywords":["queue","task","worker","job","in-memory","priority","manager","utility","promise","Async"],"repository":{"type":"git","url":"git+https://github.com/cmseaton42/task-easy.git"},"author":{"name":"Canaan Seaton"},"license":"MIT","devDependencies":{"coveralls":"^3.0.9","eslint":"^6.8.0","eslint-plugin-jest":"^23.4.0","jest":"^24.9.0"},"gitHead":"b960a6f105356dfe5cd96f36edd636a6ed872c65","bugs":{"url":"https://github.com/cmseaton42/task-easy/issues"},"homepage":"https://github.com/cmseaton42/task-easy#readme","_id":"task-easy@1.0.1","_nodeVersion":"12.14.1","_npmVersion":"6.13.4","dist":{"integrity":"sha512-3WIgb6s9fR1zGgdxOnfLwT3bARk5HlKQDAAtow8igg+r08oa6EIZM+Ovof8ZNjkK/E6T5kA3rDcqApz9DdSJDQ==","shasum":"edfb7ccc3a3dfe4731ed909a4a756c9a4962bb4b","tarball":"https://registry.npmjs.org/task-easy/-/task-easy-1.0.1.tgz","fileCount":8,"unpackedSize":15690,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeHMUiCRA9TVsSAnZWagAAz6QP+wd8lxSKs88TRQl8Hn83\nqSaZW+yh4XD3LkgUwSYRkO2jtxVCQv/SW+1qztHh0sU7iN9aMwzF0aRtkkk1\nipRL8gz9AYhscqK8ExZxMXBZih17l8ZemAq0A5ZtuCKSMvYIdMiynm1oh5iV\njbPuLMHtYmEaGVQ/Ra1ZQyNFM7iuWprxvPoEwoae3T8QzPf2m3hmj1FiXO+L\n6eF7OJTV1oyFvmIIGcpSlVzT18KM9Gunf0gERUPpZveU8A1/8yGiUaIhjFvl\ngulUe2L9gcI3dnxx3KQlhkPSaCu+Q++DjbR0REL0CnepPo4klWfQljJnBaJ+\nah7gdm+ada0Ey70/PWzXqZH9ltb9PUDBZPjyayG3wd6vKQKmx2sMLyCVOUwH\nfyn3mkPgiZXt53H8f4xTcksdajtQa34RiFcfJwt1Aj7sWYhsS9kRen3Gi3v7\nq/xiPiKX9hD1/78uORLJK+F81Jd3cVYZJXy2URQwcje3HUEf9wO2KDKNoblE\nk7UnmPtZ+w6uS/EIjuSOLtk+0Q+Ne0VhJfVfOgiG8htqP0ZQ2iwHLU47Q+qL\nx/byCMuJVynAgIczs2SLOuLGfqBTbW9Ji25nsSgD4Pd2i8Rx1c4JBUTP7FE0\nOGT82XBUjBkg+fOSCEyHFw41qOZv5iR+CS4MpNBNj0Mi6uyF2NeuwrKBL+iX\nU4UT\r\n=RLNG\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICf/FGp9Ku1bqsTi998Ai8dbpql2kOqtOBjhI40jLI1XAiAJtY33/32PMes6mSwHtK2vlUQprmQIk/KdYnKNLhWCYw=="}]},"maintainers":[{"name":"cmseaton42","email":"cmseaton42@gmail.com"}],"_npmUser":{"name":"cmseaton42","email":"cmseaton42@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/task-easy_1.0.1_1578943777651_0.05777425753184762"},"_hasShrinkwrap":false}},"time":{"created":"2018-03-23T18:02:31.038Z","0.1.0":"2018-03-23T18:02:31.136Z","modified":"2022-05-19T10:18:13.693Z","0.2.0":"2018-04-03T13:00:09.218Z","0.2.1":"2020-01-13T00:31:10.860Z","1.0.0":"2020-01-13T19:25:46.794Z","1.0.1":"2020-01-13T19:29:37.740Z"},"maintainers":[{"name":"cmseaton42","email":"cmseaton42@gmail.com"}],"description":"A simple, customizable, and lightweight priority queue for promise based tasks.","keywords":["queue","task","worker","job","in-memory","priority","manager","utility","promise","Async"],"author":{"name":"Canaan Seaton"},"license":"MIT","readme":"<p align=\"center\"><img width=\"280\" src=\"https://i.imgur.com/VwF0DyE.png\" alt=\"Task Easy Logo\"></p>\n\n<div align=\"center\">\n  <p><a href=\"https://www.npmjs.com/package/task-easy\"><img src=\"https://img.shields.io/npm/v/task-easy.svg?style=flat-square\" alt=\"npm\" /></a>\n  <a href=\"https://github.com/cmseaton42/task-easy/blob/master/LICENSE\"><img src=\"https://img.shields.io/github/license/cmseaton42/task-easy.svg?style=flat-square\" alt=\"license\" /></a>\n  <img src=\"https://img.shields.io/travis/cmseaton42/task-easy.svg?style=flat-square\" alt=\"Travis\" />\n  <img src=\"https://img.shields.io/coveralls/github/cmseaton42/task-easy.svg?style=flat-square\" alt=\"Coveralls github\" />\n  <a href=\"https://github.com/cmseaton42/task-easy\"><img src=\"https://img.shields.io/github/stars/cmseaton42/task-easy.svg?&amp;style=social&amp;logo=github&amp;label=Stars\" alt=\"GitHub stars\" /></a>\n</p>\n</div>\n\n# Task Easy - Promise Queue Made Easy ✅\n\nA simple, customizable, and lightweight priority queue for promise based tasks.\n\n> Now with types!!! Big thanks to [Emiliano Heyns](https://github.com/retorquere) :beers:\n>\n> -   See below example for typescript version\n\n## Getting Started\n\nInstall with npm\n\n```\nnpm install task-easy --save\n```\n\n## How it Works\n\n**TaskEasy** is built as an extension of a simple heap data structure. Tasks are queued by simply passing a task (function) to the `.schedule` method along with an array of arguments to be called as well as an object to describe the task's relative priority. The caller is returned a promise which will resolve once the scheduled task has ran. Priority determination is left up to the user via a function that accepts task priority object and returns a judgement.\n\n### Usage\n\nThe usage of **TaskEasy** is best given by example so that is the route we will take.\n\nIn this example, we will be passing priority objects to the scheduler that will be marked by the following signature.\n\n```js\n{\n    // An integer representing priority,\n    // the higher the number the higher the priority\n    priority: Number,\n\n    // A timestamp to illustrate when the task\n    // was scheduled, used as a 'tie-breaker' for\n    // tasks of the same priority\n    timestamp: Date\n}\n```\n\n> **NOTE**\n>\n> The priority object's signature that you want to queue your items with is 100% up to you. 😄\n\nNow, let's create a function that will receive our priority objects and output a priority judgment so that _TaskEasy_ knows how to handle queued tasks. Our function will be passed two arguments (the priority objects of two scheduled tasks) and return a judgement indicating which task is of _higher_ priority. If we return `true`, then we are communicating to _TaskEasy_ that the first task is higher priority than the second task or vice versa\n\n```js\n// This function is passed to the TaskEasy contructor and will be used internally to determine tasks order.\nconst prioritize = (obj1, obj2) => {\n    return obj1.priority === obj2.priority\n        ? obj1.timestamp.getTime() < obj2.timestamp.getTime() // Return true if task 1 is older than task 2\n        : obj1.priority > obj2.priority; // return true if task 1 is higher priority than task 2\n};\n```\n\nNow, we can initialize a new _TaskEasy_ instance.\n\n```js\nconst { TaskEasy } = require(\"task-easy\");\n\nconst max_tasks = 200; // How many tasks will we allow to be queued at a time (defaults to 100)\nconst queue = new TaskEasy(prioritize, max_tasks);\n```\n\nNow, lets build an async function to demo the scheduler.\n\n```js\nconst delay = ms => new Promise(resolve => setTimeout(resolve, ms));\n```\n\n> **NOTE**\n>\n> Scheduled tasks _MUST_ be functions that return _promises_. This works well with async functions or with ES2017 `ASYNC/AWAIT` functions.\n\nNow, that we have a task to schedule, let's schedule some tasks. The `.schedule` method takes three arguments, the task to call, an array of arguments, and a priority object that is associated with the scheduled task. It will return a promise that will resolve or reject once the task has been ran.\n\n```js\n// .schedule accepts the task signature,\n// an array or arguments, and a priority object\nconst task1 = queue\n    .schedule(delay, [100], { priority: 1, timestamp: new Date() })\n    .then(() => console.log(\"Task 1 ran...\"));\n\nconst task2 = queue\n    .schedule(delay, [100], { priority: 1, timestamp: new Date() })\n    .then(() => console.log(\"Task 2 ran...\"));\n\nconst task3 = queue\n    .schedule(delay, [100], { priority: 2, timestamp: new Date() })\n    .then(() => console.log(\"Task 3 ran...\"));\n\nconst task4 = queue\n    .schedule(delay, [100], { priority: 1, timestamp: new Date() })\n    .then(() => console.log(\"Task 4 ran...\"));\n\nconst task5 = queue\n    .schedule(delay, [100], { priority: 3, timestamp: new Date() })\n    .then(() => console.log(\"Task 5 ran...\"));\n\n// OUTPUT\n// Task 1 ran...\n// Task 5 ran...\n// Task 3 ran...\n// Task 2 ran...\n// Task 4 ran...\n```\n\n> **NOTE**\n>\n> In the above example, `task1` resolved first as it once put onto the queue first and was immediately called as it was the only task on the queue at that time.\n\n## Now with _Typescript_\n\n```typescript\nimport { TaskEasy } from \"task-easy\";\n\n// Define interface for priority\n//  objects to be used in the\n//  TaskEasy instance\ninterface IPriority {\n    priority: number;\n    timestamp: Date;\n}\n\n// Define delay function type\n// -> Must extend  Task<T>: (...args) => Promise<T>\ntype delayFn = (ms: number) => Promise<undefined>;\n\n// Define delay function of type 'delayFn' defined above\nconst delay: delayFn = ms => new Promise(resolve => setTimeout(resolve, ms));\n\n// Define priority function\n// -> Must extend (obj1: T, obj2: T) =>\nconst prioritize = (obj1: IPriority, obj2: IPriority) => {\n    return obj1.priority === obj2.priority\n        ? obj1.timestamp.getTime() < obj2.timestamp.getTime() // Return true if task 1 is older than task 2\n        : obj1.priority > obj2.priority; // return true if task 1 is higher priority than task 2\n};\n\n// Initialize new queue\nconst queue = new TaskEasy(prioritize); // equivalent of TaskEasy<IPriority>(prioritize) via type inference\n\n// .schedule accepts the task signature,\n// an array or arguments, and a priority object\n// -> with type inference\nconst task1 = queue\n    .schedule(delay, [100], { priority: 1, timestamp: new Date() })\n    .then(() => console.log(\"Task 1 ran...\"));\n\nconst task2 = queue\n    .schedule(delay, [100], { priority: 1, timestamp: new Date() })\n    .then(() => console.log(\"Task 2 ran...\"));\n\n// Definitely typed\nconst task3 = queue\n    .schedule<undefined, delayFn>(delay, [100], { priority: 2, timestamp: new Date() })\n    .then(() => console.log(\"Task 3 ran...\"));\n\nconst task4 = queue\n    .schedule<undefined, delayFn>(delay, [100], { priority: 1, timestamp: new Date() })\n    .then(() => console.log(\"Task 4 ran...\"));\n\nconst task5 = queue\n    .schedule<undefined, delayFn>(delay, [100], { priority: 3, timestamp: new Date() })\n    .then(() => console.log(\"Task 5 ran...\"));\n\n// OUTPUT\n// Task 1 ran...\n// Task 5 ran...\n// Task 3 ran...\n// Task 2 ran...\n// Task 4 ran...\n```\n\n## Built With\n\n-   [NodeJS](https://nodejs.org/en/) - The Engine\n-   [javascript - ES2017](https://www.ecma-international.org/publications/files/ECMA-ST/Ecma-262.pdf) - The Language\n\n## Contributers\n\n-   **Canaan Seaton** - _Owner_ - [GitHub Profile](https://github.com/cmseaton42) - [Personal Website](http://www.canaanseaton.com/)\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENCE](https://github.com/cmseaton42/task-easy/blob/master/LICENSE) file for details\n","readmeFilename":"README.md","homepage":"https://github.com/cmseaton42/task-easy#readme","repository":{"type":"git","url":"git+https://github.com/cmseaton42/task-easy.git"},"bugs":{"url":"https://github.com/cmseaton42/task-easy/issues"}}