{"id":20668841,"url":"https://github.com/roy7077/process-scheduling-algorithms","last_synced_at":"2026-04-18T08:31:56.065Z","repository":{"id":253291279,"uuid":"842808781","full_name":"roy7077/Process-Scheduling-Algorithms","owner":"roy7077","description":"processschedulingalgo is a comprehensive npm package that provides implementations of essential process scheduling algorithms, including FCFS, Priority Scheduling, and SJF, in both preemptive and non-preemptive forms. Ideal for optimizing process management in applications or learning operating system concepts.","archived":false,"fork":false,"pushed_at":"2024-08-15T17:46:09.000Z","size":13,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-10T15:18:51.202Z","etag":null,"topics":["fcfs-scheduling","high-priority","npm-package","preemptive-multitasking","processs-scheduling","round-robin-scheduler","shortest-job-first"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/roy7077.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-08-15T06:09:30.000Z","updated_at":"2024-08-16T06:06:56.000Z","dependencies_parsed_at":"2024-08-15T19:54:16.348Z","dependency_job_id":"417af1f8-485d-43c3-b30c-5fb66220ef56","html_url":"https://github.com/roy7077/Process-Scheduling-Algorithms","commit_stats":null,"previous_names":["roy7077/process-scheduling-algorithms"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/roy7077/Process-Scheduling-Algorithms","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/roy7077%2FProcess-Scheduling-Algorithms","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/roy7077%2FProcess-Scheduling-Algorithms/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/roy7077%2FProcess-Scheduling-Algorithms/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/roy7077%2FProcess-Scheduling-Algorithms/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/roy7077","download_url":"https://codeload.github.com/roy7077/Process-Scheduling-Algorithms/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/roy7077%2FProcess-Scheduling-Algorithms/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":27563838,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-12-07T02:00:07.896Z","response_time":53,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["fcfs-scheduling","high-priority","npm-package","preemptive-multitasking","processs-scheduling","round-robin-scheduler","shortest-job-first"],"created_at":"2024-11-16T20:11:56.781Z","updated_at":"2025-12-07T08:03:00.113Z","avatar_url":"https://github.com/roy7077.png","language":"JavaScript","readme":"# Process Scheduling Algorithms\n\nThis package provides implementations of various process scheduling algorithms. It includes both preemptive and non-preemptive versions of the following algorithms:\n\n- First Come First Serve (FCFS)\n- Priority-Based Scheduling\n- Shortest Job First (SJF)\n\n## Installation\n\nYou can install this package via npm. Make sure you have Node.js and npm installed on your machine.\n\n```bash\nnpm install processSchedulingAlgo\n\nReplace your-package-name with the actual name of your package.\n\nUsage\n-----\n\n### Importing the Algorithms\n\nYou can import the algorithms into your project using ES module syntax. Here's how you can do it:\nimport { FCFSPreemptive, FCFSNonPreemptive, PriorityPreemptive, PriorityNonPreemptive, SJFPreemptive, SJFNonPreemptive } from 'your-package-name';\n```\n\n### Example Usage\n\nHere's a brief example of how to use each scheduling algorithm.\n\n#### 1\\. **First Come First Serve (FCFS)**\n\n**Preemptive Version**\n```\nimport { FCFSPreemptive } from 'your-package-name';\n\nlet readyQueue1 = [\n    { id: 1, AT: 0, BT: 10 },\n    { id: 2, AT: 0, BT: 5 },\n    { id: 3, AT: 0, BT: 8 }\n];\n\nlet fcfsPreemptive = new FCFSPreemptive(readyQueue1);\nconsole.log('Average Turnaround Time:', fcfsPreemptive.getAverageTurnaroundTime());\nconsole.log('Average Waiting Time:', fcfsPreemptive.getAverageWaitingTime());\nconsole.log('Average Response Time:', fcfsPreemptive.getAverageResponseTime());\n```\n**Non-Preemptive Version**\n\n```\nimport { FCFSNonPreemptive } from 'your-package-name';\n\nlet readyQueue2 = [\n    { id: 1, AT: 0, BT: 10 },\n    { id: 2, AT: 0, BT: 5 },\n    { id: 3, AT: 0, BT: 8 }\n];\n\nlet fcfsNonPreemptive = new FCFSNonPreemptive(readyQueue2);\nconsole.log('Average Turnaround Time:', fcfsNonPreemptive.getAverageTurnaroundTime());\nconsole.log('Average Waiting Time:', fcfsNonPreemptive.getAverageWaitingTime());\nconsole.log('Average Response Time:', fcfsNonPreemptive.getAverageResponseTime());\n```\n\n#### 2\\. **Priority-Based Scheduling**\n\n**Preemptive Version**\n```\nimport { PriorityPreemptive } from 'your-package-name';\n\nlet readyQueue3 = [\n    { id: 1, AT: 0, BT: 10, priority: 2 },\n    { id: 2, AT: 0, BT: 5, priority: 1 },\n    { id: 3, AT: 0, BT: 8, priority: 3 }\n];\n\nlet priorityPreemptive = new PriorityPreemptive(readyQueue3);\nconsole.log('Average Turnaround Time:', priorityPreemptive.getAverageTurnaroundTime());\nconsole.log('Average Waiting Time:', priorityPreemptive.getAverageWaitingTime());\nconsole.log('Average Response Time:', priorityPreemptive.getAverageResponseTime());\n```\n**Non-Preemptive Version**\n```\nimport { PriorityNonPreemptive } from 'your-package-name';\n\nlet readyQueue4 = [\n    { id: 1, AT: 0, BT: 10, priority: 2 },\n    { id: 2, AT: 0, BT: 5, priority: 1 },\n    { id: 3, AT: 0, BT: 8, priority: 3 }\n];\n\nlet priorityNonPreemptive = new PriorityNonPreemptive(readyQueue4);\nconsole.log('Average Turnaround Time:', priorityNonPreemptive.getAverageTurnaroundTime());\nconsole.log('Average Waiting Time:', priorityNonPreemptive.getAverageWaitingTime());\nconsole.log('Average Response Time:', priorityNonPreemptive.getAverageResponseTime());\n```\n#### 3\\. **Shortest Job First (SJF)**\n\n**Preemptive Version**\n\n```\nimport { SJFPreemptive } from 'your-package-name';\n\nlet readyQueue5 = [\n    { id: 1, AT: 0, BT: 10 },\n    { id: 2, AT: 0, BT: 5 },\n    { id: 3, AT: 0, BT: 8 }\n];\n\nlet sjfPreemptive = new SJFPreemptive(readyQueue5, 4); // Time quantum set to 4 for example\nconsole.log('Average Turnaround Time:', sjfPreemptive.getAverageTurnaroundTime());\nconsole.log('Average Waiting Time:', sjfPreemptive.getAverageWaitingTime());\nconsole.log('Average Response Time:', sjfPreemptive.getAverageResponseTime());\n```\n**Non-Preemptive Version**\n\n```\nimport { SJFNonPreemptive } from 'your-package-name';\n\nlet readyQueue6 = [\n    { id: 1, AT: 0, BT: 10 },\n    { id: 2, AT: 0, BT: 5 },\n    { id: 3, AT: 0, BT: 8 }\n];\n\nlet sjfNonPreemptive = new SJFNonPreemptive(readyQueue6);\nconsole.log('Average Turnaround Time:', sjfNonPreemptive.getAverageTurnaroundTime());\nconsole.log('Average Waiting Time:', sjfNonPreemptive.getAverageWaitingTime());\nconsole.log('Average Response Time:', sjfNonPreemptive.getAverageResponseTime());\n```\nContributing\n------------\n\nFeel free to contribute to this project by submitting issues or pull requests. Please ensure that your code adheres to the existing style and is well-tested.\n\nLicense\n-------\n\nThis project is licensed under the MIT License. See the LICENSE file for details.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Froy7077%2Fprocess-scheduling-algorithms","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Froy7077%2Fprocess-scheduling-algorithms","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Froy7077%2Fprocess-scheduling-algorithms/lists"}