{"id":22411662,"url":"https://github.com/jashepp/require-worker","last_synced_at":"2026-04-25T08:35:57.700Z","repository":{"id":65489130,"uuid":"62439831","full_name":"Jashepp/require-worker","owner":"Jashepp","description":"⛔️ DEPRECATED - Load a module in a new process, then use promises to interact with it.","archived":false,"fork":false,"pushed_at":"2021-10-20T19:10:11.000Z","size":216,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-27T03:12:28.669Z","etag":null,"topics":["childprocess","cluster","concurrent","deprecated","experimental","javascript","javascript-proxy","nodejs","nodejs-cluster","nodejs-modules","nodejs-require","parallel","processes","promises","require","worker"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/require-worker","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Jashepp.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-07-02T07:37:22.000Z","updated_at":"2021-10-20T19:10:56.000Z","dependencies_parsed_at":"2023-01-25T16:55:13.598Z","dependency_job_id":null,"html_url":"https://github.com/Jashepp/require-worker","commit_stats":null,"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"purl":"pkg:github/Jashepp/require-worker","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Jashepp%2Frequire-worker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Jashepp%2Frequire-worker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Jashepp%2Frequire-worker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Jashepp%2Frequire-worker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Jashepp","download_url":"https://codeload.github.com/Jashepp/require-worker/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Jashepp%2Frequire-worker/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262647526,"owners_count":23342667,"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","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":["childprocess","cluster","concurrent","deprecated","experimental","javascript","javascript-proxy","nodejs","nodejs-cluster","nodejs-modules","nodejs-require","parallel","processes","promises","require","worker"],"created_at":"2024-12-05T13:14:41.618Z","updated_at":"2026-04-25T08:35:57.673Z","avatar_url":"https://github.com/Jashepp.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ⛔️ DEPRECATED\n\nThis repository is no longer being maintained. It was simply a proof-of-concept / experiment which required too much work to make decently usuable.\n\nPlease consider using [Comlink](https://github.com/GoogleChromeLabs/comlink) instead.\n\n# require-worker - Nodejs Module\n\n[![NPM Version][npm-image]][npm-url]\n[![Downloads Stats][npm-downloads]][npm-url]\n[![Travis CI][travis-image]][travis-url]\n\nLoad a module in a new process, then use promises to interact with it.\n\n## What is this?\n\nThis module is meant to require other Nodejs modules, but in a new process instead of the same process.\n\nThis is very new, experimental and features are still getting implemented.\n\nThere are many cases where this will not work with existing modules which accept data types, or return data types that are not yet implemented. Though this is being worked on. [See the API][api-url].\n\n## Why use this?\n\nLet's say you want to require a module, but the tasks it performs are synchronous and long, or simply does a lot of number crunching. That module would effect the performance and responsiveness of your application.\n\nWhen using _require-worker_, that module would instead run in a different process, allowing your application to respond to incoming connections and do it's own number crunching at the same time, while still talking with that module in a similar way it used to.\n\nI decided to create this module because simply creating a forked process and changing how you talk to the other code in the other process, can be cumbersome if your application is already quite complicated. Importing a module is easy. Most Nodejs applications require them to expand their functionality. Even modules themselves require other modules. So this module simply makes use of that ideology.\n\n## Installation\n\nNodejs 6.0 or greater is required. This project is written with ES6 features\n\nWarning: This is currently not production-ready. Not all planned features are implemented yet.\n\nInstall the module via [NPM][npm-url]\n```\nnpm install require-worker --save\n```\nOr [download the latest release][github-releases], or git clone the [repository on GitHub][github-branch].\n\n## How to use\n\n[See the API][api-url] for more information.\n\n```js\n// Require require-worker\nconst requireWorker = require('require-worker');\n\n// Example Using Async Await\n(async ()=\u003e{\n\t// Require native nodejs OS module (return proxy)\n\tconst os = requireWorker.require('os');\n\t// Proxy call userInfo()\n\tvar { value:userInfo } = await os.userInfo();\n\t// Output result\n\tconsole.log(userInfo);\n\t// Stop require-worker\n\tawait os.constructor.client.destroy();\n})();\n```\n\n## Tests\n\nView results on [Travis-CI][travis-url], or run tests manually:\n\nInstall development dependencies for this module: `npm install`\n\nThen run the test npm script: `npm test`\n\nSince this module spawns child processors, some test results may take a while to complete.\n\nTests are written with ES6 features just like this module.\n\n## Contributors\n\nCreate issues or pull requests on the GitHub project.\n\nAll the help is appreciated.\n\n## License\n\nMIT License\n\nCopyright (c) 2018 Jason Sheppard @ https://github.com/Jashepp\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n\n## Links\n\nGithub Repository: [https://github.com/Jashepp/require-worker][github-url]\n\nNPM Package: [https://npmjs.org/package/require-worker][npm-url]\n\n[api-url]: API.md\n[github-url]: https://github.com/Jashepp/require-worker\n[github-branch]: https://github.com/Jashepp/require-worker/tree/master\n[github-releases]: https://github.com/Jashepp/require-worker/releases\n[github-tags]: https://github.com/Jashepp/require-worker/tags\n[npm-image]: https://img.shields.io/npm/v/require-worker.svg?style=flat-square\n[npm-url]: https://npmjs.org/package/require-worker\n[npm-downloads]: https://img.shields.io/npm/dm/require-worker.svg?style=flat-square\n[travis-image]: https://travis-ci.org/Jashepp/require-worker.svg?branch=master\n[travis-url]: https://travis-ci.org/Jashepp/require-worker\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjashepp%2Frequire-worker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjashepp%2Frequire-worker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjashepp%2Frequire-worker/lists"}