{"id":26282934,"url":"https://github.com/cgi-js/cgi-js","last_synced_at":"2025-05-07T09:43:35.934Z","repository":{"id":41802069,"uuid":"247416280","full_name":"cgi-js/cgi-js","owner":"cgi-js","description":"Run cgi / interpreted script files that supports command line execution, or connect to cgi / other server proxies : npm install cgijs --save","archived":false,"fork":false,"pushed_at":"2025-05-01T14:29:01.000Z","size":4195,"stargazers_count":18,"open_issues_count":4,"forks_count":3,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-05-01T15:33:56.053Z","etag":null,"topics":["apache-httpd","apache-tomcat","aspx","cgi","cgi-js","cgi-server","cgijs","desktop-app","desktop-cgi","electron","embedded-server","interpreted-languages","jsp","mongoose","nginx","php","proxy-server","python","ruby"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/cgijs","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cgi-js.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":"FUNDING.yml","license":"LICENSE","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},"funding":{"github":"ganeshkbhat"}},"created_at":"2020-03-15T06:48:55.000Z","updated_at":"2025-05-01T14:29:04.000Z","dependencies_parsed_at":"2024-11-15T04:12:06.613Z","dependency_job_id":null,"html_url":"https://github.com/cgi-js/cgi-js","commit_stats":null,"previous_names":["ganeshkbhat/cgi-js"],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cgi-js%2Fcgi-js","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cgi-js%2Fcgi-js/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cgi-js%2Fcgi-js/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cgi-js%2Fcgi-js/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cgi-js","download_url":"https://codeload.github.com/cgi-js/cgi-js/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252852809,"owners_count":21814415,"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":["apache-httpd","apache-tomcat","aspx","cgi","cgi-js","cgi-server","cgijs","desktop-app","desktop-cgi","electron","embedded-server","interpreted-languages","jsp","mongoose","nginx","php","proxy-server","python","ruby"],"created_at":"2025-03-14T17:16:03.910Z","updated_at":"2025-05-07T09:43:35.916Z","avatar_url":"https://github.com/cgi-js.png","language":"JavaScript","readme":"# cgijs\n    \n\n*`CGIJS` is a all featured library to run any `CGI` mode / `Interpreted language script` files, or connect to any web application server proxies, or manage processes in the system.*\n\n\n\n`CGIJS` library:\n\n- Supports running any `CGI` / `Interpreted Language scripts` using the nodejs process module in `any OS` that runs `node.js`. Needs the language interpretor to be installed in the system\n- [TODO] Supports running any `CGI` / `Interpreted Language scripts` using interpreters library module in `any OS` that runs `node.js`. Do not need the language interpretor to be installed in the system\n- Supports both `CGI` executables as well as `proxy` to `localhost`/ `remote` /`embedded servers` using proxying of multiple protocols (`http`, `websockets`, `tcp`, `udp`, `socks`, `ssh`, `ftp`).\n- Supports managing processes like `embedded` `server` executables, embedded `database` executables, or `any other` embedded/ non-embedded executables \n- Supports working with `shell`, `json`, `ini`, `csv`, `yaml`, and `xml` internally\n\n\n`[Funding Invited]`\n\n\n*General Note: The library is production ready. However, please be cautious of processes/executables permissions/security in your project using CGIJS*\n\n\n# History\n\nCGIJS was created with a motivation to allow creation of a `Desktop executable/ application` using `Electron` that can run any `CGI` / `Interpreted language scripted files/ applications` under the hood. \n\n\n[![Desktop CGI](./desktop-cgi.jpeg)](https://github.com/desktop-cgi/desktop-cgi)\n\n\n# Installation\n\n```\nnpm install cgijs --save\n```\n\n\nIf you wish to run interpreted languages like `php`, `perl`, `python`, `micropython`, `cpython`, `ruby`, `julia`, `cpp`, `golang`, `ocaml`, `lua`, `napi`, `wasm-run`, `r-lang`, `openssl` with `wasm files` without having the language's binary present/ installed in your system then use the following package.\n\n\n\n```\nnpm install bridge-wasm --save\n```\n\n\n\n# Features\n\n*Light weight, Flexible, Generic implementation. CGIJS is Nodejs `Framework Independent / agnostic` for application development.*\n\n\nThere are three main modules inside CGIJS - `file` for CGI file execution, `proxy` for running proxies, and `process` for managing processes.\n\n\n\n#### **SECURITY NOTE**:\n\n\n- The process shell module is security agnostic and is dependant on your code.\n    - The package accesses the shell to run script executables using the node.js process module. Please consider your `security risks based on your executable's/ script's security risks`.\n- The proxy module is security agnostic and is dependant on your code and proxy's security.\n    - The `package has a LAN or WAN network proxy module AND does not create any proxies` by its own - unless specified by you. Please consider your custom created proxy's security risks.\n- The `package does not use Telemetry, nor Collect data Remotely, nor has Telemetry/Remote based Error collection` on its own.\n    - The package propogates errors for you to handle or collect errors/ data.\n\n\n# Library Features\n\n\n##### Node CGI Embedded - run interpreted scripts that support cgi using nodejs\n\n* [x] CGI file execution\n    - [x] Run any scripts that support CGI based serving/execution\n    - [x] Run multiple CGI executables/ Interpreters in one or multiple applications\n    - [x] Embed your own CGI/ Interpreted Language executables\n    - [x] Runs scripts with language interpretor binary (like php, python, ruby, etc) in your system\n    - [x] Runs scripts without language interpretor binary (like php, python, ruby, etc) in your system using their wasm packages\n\n\n##### Node Web Proxy - run web proxies\n\n* [x] Running Proxies\n    - [x] Run any host that serves a web app, using proxy \n    - [x] Run proxies for Application (Local / Remote)\n    - [x] Supports websocket implementation in web proxies\n    - [x] Run multiple protocol proxies (HTTP, UDP, TCP, Websockets, Socks) and multiple instances in one or multiple applications\n\n\n##### Node Processes - Manage web servers, database processes, or other system processes or services\n\n* [x] Manage Processes or Services\n    - [x] Allows running and closing process Executables\n    - [x] Allows managing Embedding Web Servers, which can run web applications through proxies \u003csub\u003e[Todo] Testing for some embeddable servers\u003c/sub\u003e\n    - [x] Allows managing Embedded Database servers \u003csub\u003e[Todo] Testing for some embeddable servers\u003c/sub\u003e\n    - [x] Should run smoothly with Unsupported proxy servers/ processes/ services (not widely tested)\n* [x] Embedding\n    - [x] Multiple web servers in one or multiple applications\n    - [x] Multiple databases in one or multiple applications\n\n\n# Functionality Details\n\n##### The script should support piping all files of below interpreted languages:\n\n* [x] Python (2.x, 3.x) - `py` (for Python .py extension files. Needed for *nix systems)\n* [x] Perl (Version Independent) - `plc`, `pld`, `pl` (for Perl .pl, .plc, .pld extension files)\n* [x] PHP (Version Independent) - `php` (for .php extension files)\n* [x] Ruby (Version Independent) - `rb` (for Ruby .rb extension files)\n* [x] Node.js (Version Independent) - `js` (for Node.js .js extension files)\n* [x] CGI - `cgi` (for CGI .cgi extension files) [\u003csub\u003eTodo Testing\u003c/sub\u003e]\n\n##### The script should support piping all proxies of above languages and following:\n\n* [x] Jsp (With Tomcat, or any webserver as proxy) \n* [x] Aspx (With IIS, Apache, or any webserver as proxy)\n* [] Jsp (With Tomcat embedded) \u003csub\u003e[Todo]\u003c/sub\u003e\n* [] Aspx (With Nginx and Apache embedded) \u003csub\u003e[Todo]\u003c/sub\u003e\n\n##### The script currently allows working with (starting, stopping, restarting using bash, bat scripts) following web servers:\n\n* [x] IIS \u003csub\u003e[Done]\u003c/sub\u003e\n* [x] Nginx \u003csub\u003e[Done]\u003c/sub\u003e\n* [x] Apache HTTPD \u003csub\u003e[Done]\u003c/sub\u003e\n* [x] Apache TomCat \u003csub\u003e[Done]\u003c/sub\u003e\n* [x] Nginx (Allows Embed) \u003csub\u003e[Done]\u003c/sub\u003e\n* [x] Apache HTTPD (Allows Embed) \u003csub\u003e[Done]\u003c/sub\u003e\n* [x] Apache TomCat (Allows Embed) [\u003csub\u003eTodo - Testing\u003c/sub\u003e], \u003csub\u003eshould work based on current testing of other proxies\u003c/sub\u003e\n* [x] Mongoose [\u003csub\u003eTodo - Testing\u003c/sub\u003e], \u003csub\u003eshould work based on current testing of other proxies\u003c/sub\u003e\n* [x] Jetty [\u003csub\u003eTodo - Testing\u003c/sub\u003e], \u003csub\u003eshould work based on current testing of other proxies\u003c/sub\u003e\n* [x] Putty [\u003csub\u003eTodo - Testing\u003c/sub\u003e], \u003csub\u003eshould work based on current testing of other proxies\u003c/sub\u003e\n* [] Mongoose (Allows Embed) [\u003csub\u003eTodo - Testing\u003c/sub\u003e]\n* [] Jetty (Allows Embed) [\u003csub\u003eTodo - Testing\u003c/sub\u003e]\n* [x] Putty (Allows Embed) [\u003csub\u003eTodo - Testing\u003c/sub\u003e]\n* [x] PHP development server using `php -S` \u003c!-- php -S localhost:8000  --\u003e\n* [x] Ruby development server using `rails server` [\u003csub\u003eTodo - Testing\u003c/sub\u003e] \u003c!-- bin/rails server --\u003e\n* [x] Python development server using `py -m http.server` \u003c!-- If Python version returned above is 3.X. On Windows, try \"py -m http.server\" or \"py -3 -m http.server\". If Python version returned above is 2.X use SimpleHTTPServer. python3 -m http.server OR python -m SimpleHTTPServer --\u003e\n* [] Other Proxy-able local/remote servers [\u003csub\u003eInProgress\u003c/sub\u003e]\n\n##### The script currently allows working with (starting, stopping, restarting proxies) following web servers:\n\n* [x] IIS \u003csub\u003e[Done]\u003c/sub\u003e\n* [x] Nginx \u003csub\u003e[Done]\u003c/sub\u003e\n* [x] Apache HTTPD \u003csub\u003e[Done]\u003c/sub\u003e\n* [x] Apache TomCat \u003csub\u003e[Done]\u003c/sub\u003e\n* [x] Nginx (Allows Embed) \u003csub\u003e[Done]\u003c/sub\u003e\n* [x] Apache HTTPD (Allows Embed) \u003csub\u003e[Done]\u003c/sub\u003e\n* [x] Apache TomCat (Allows Embed) [\u003csub\u003eTodo - Testing\u003c/sub\u003e], \u003csub\u003eshould work based on current testing of other proxies\u003c/sub\u003e\n* [x] Mongoose [\u003csub\u003eTodo - Testing\u003c/sub\u003e], \u003csub\u003eshould work based on current testing of other proxies\u003c/sub\u003e\n* [x] Jetty [\u003csub\u003eTodo - Testing\u003c/sub\u003e], \u003csub\u003eshould work based on current testing of other proxies\u003c/sub\u003e\n* [x] Putty [\u003csub\u003eTodo - Testing\u003c/sub\u003e], \u003csub\u003eshould work based on current testing of other proxies\u003c/sub\u003e\n* [] Mongoose (Allows Embed) [\u003csub\u003eTodo - Testing\u003c/sub\u003e]\n* [] Jetty (Allows Embed) [\u003csub\u003eTodo - Testing\u003c/sub\u003e]\n* [x] Putty (Allows Embed) [\u003csub\u003eTodo - Testing\u003c/sub\u003e]\n* [x] PHP development server using `php -S` \u003c!-- php -S localhost:8000  --\u003e\n* [x] Ruby development server using `rails server` [\u003csub\u003eTodo - Testing\u003c/sub\u003e] \u003c!-- bin/rails server --\u003e\n* [x] Python development server using `py -m http.server` \u003c!-- If Python version returned above is 3.X. On Windows, try \"py -m http.server\" or \"py -3 -m http.server\". If Python version returned above is 2.X use SimpleHTTPServer. python3 -m http.server OR python -m SimpleHTTPServer --\u003e\n* [] Other Proxy-able local/remote servers [\u003csub\u003eInProgress\u003c/sub\u003e]\n\n##### The script currently allows working with (starting, stopping, restarting) following web servers:\n\n* [x] IIS \u003csub\u003e[Done]\u003c/sub\u003e\n* [x] Nginx \u003csub\u003e[Done]\u003c/sub\u003e\n* [x] Apache HTTPD \u003csub\u003e[Done]\u003c/sub\u003e\n* [x] Apache TomCat \u003csub\u003e[Done]\u003c/sub\u003e\n* [x] Nginx \u003csub\u003e[Done]\u003c/sub\u003e\n* [x] Apache HTTPD \u003csub\u003e[Done]\u003c/sub\u003e\n* [x] Apache TomCat [\u003csub\u003eTodo - Testing\u003c/sub\u003e], \u003csub\u003eshould work based on current testing of other proxies\u003c/sub\u003e\n* [x] Mongoose [\u003csub\u003eTodo - Testing\u003c/sub\u003e], \u003csub\u003eshould work based on current testing of other proxies\u003c/sub\u003e\n* [x] Jetty [\u003csub\u003eTodo - Testing\u003c/sub\u003e], \u003csub\u003eshould work based on current testing of other proxies\u003c/sub\u003e\n* [x] Putty [\u003csub\u003eTodo - Testing\u003c/sub\u003e], \u003csub\u003eshould work based on current testing of other proxies\u003c/sub\u003e\n* [] Mongoose (Allows Embed) [\u003csub\u003eTodo - Testing\u003c/sub\u003e]\n* [] Jetty (Allows Embed) [\u003csub\u003eTodo - Testing\u003c/sub\u003e]\n* [x] Putty (Allows Embed) [\u003csub\u003eTodo - Testing\u003c/sub\u003e]\n* [x] PHP development server using `php -S` \u003c!-- php -S localhost:8000  --\u003e\n* [x] Ruby development server using `rails server` [\u003csub\u003eTodo - Testing\u003c/sub\u003e] \u003c!-- bin/rails server --\u003e\n* [x] Python development server using `py -m http.server` \u003c!-- If Python version returned above is 3.X. On Windows, try \"py -m http.server\" or \"py -3 -m http.server\". If Python version returned above is 2.X use SimpleHTTPServer. python3 -m http.server OR python -m SimpleHTTPServer --\u003e\n* [] Other Proxy-able local/remote servers [\u003csub\u003eInProgress\u003c/sub\u003e]\n\n\n##### The script currently allows working with (starting, stopping, restarting) following databases and processes:\n\n* [x] Mysql \u003csub\u003e[Done]\u003c/sub\u003e\n* [x] MongoDB \u003csub\u003e[Done]\u003c/sub\u003e\n* [] PgSQL \u003csub\u003e[Todo]\u003c/sub\u003e\n* [] Redis \u003csub\u003e[Todo]\u003c/sub\u003e\n* [x] bash, bat, ps scripts \u003csub\u003e[Done]\u003c/sub\u003e\n* [x] Other Processes for your application support\n\n\n##### Note:\n\n*This library is in active development. Issues, and feedbacks as github ticket are welcome.*\n\n\n##### Package Dependencies:\n\n* Environment and Library dependencies:\n    - Nodejs: (\u003e 8.x),\n    - [http-proxy](https://www.npmjs.com/package/http-proxy) for http-proxy support,\n    - [socks](https://www.npmjs.com/package/socks) for socks support,\n    - [udp-proxy](https://www.npmjs.com/package/udp-proxy) for udp support,\n    - [ssh2](https://www.npmjs.com/package/ssh2) for ssh2, ssh, ftp, sftp support,\n    - [socket-proxy](https://www.npmjs.com/package/socket-proxy) for socket proxy,\n    - [http-proxy-to-socks](https://www.npmjs.com/package/http-proxy-to-socks) for http to socks proxy,\n    - [csv](https://www.npmjs.com/package/csv) for file parser,\n    - [xml-js](https://www.npmjs.com/package/xml-js) for xml file parser,\n    - [yaml](https://www.npmjs.com/package/yaml) for yaml file parser,\n    - [ini](https://www.npmjs.com/package/ini) for ini file parser,\n    - [dotenv](https://www.npmjs.com/package/dotenv) for dotenv file parser,\n    - [shelljs](https://www.npmjs.com/package/shelljs) for support with shell\n    - [concurrency.js](https://www.npmjs.com/package/concurrency.js) for concurrency and parallelization support for threads and processes\n\n* Extra needed dependencies to use language interpretors and libraries for `php`, `perl`, `python`, `micropython`, `cpython`, `ruby`, `julia`, `cpp`, `golang`, `ocaml`, `lua`, `napi`, `wasm-run`, `r-lang`, `openssl` with `wasm files` without having to install (or have) binaries in your system\n    - [bridge-wasm](https://www.npmjs.com/package/bridge-wasm) for running interpreted languages with wasm without having the binary in your system (installed/ present). \n\n* Application Dependencies:\n    - Your app, you decide\n    - Example/Demo has \"express\": \"^4.17.1\"\n    - Alternatively, Use any other Nodejs framework you want to use for your app\n\n\n##### Usage Demo:\n\nThis project contains example that demonstrates working with ExpressJS.\n\n- The demos for runing CGI/Interpreted scripts with node.js and express applications can be found in the folder [demo app](https://github.com/cgi-js/cgi-js/tree/main/demo/demo-app).\n- The demos for individual implementation of file, process, proxy, and utils modules can be found in the folder [demo usage [todo]](https://github.com/cgi-js/cgi-js/tree/main/demo)\n\n\n##### Use case:\n\n[cgijs](https://www.npmjs.com/package/cgijs) library has been created to address following use cases:\n    \n- working with CGI / interpreted languages from `any` Node.js app framework\n- using any CGI / interpreted languages apps with electron as demonstrated in functioning [desktop-cgi](https://github.com/desktop-cgi/desktop-cgi) app\n\n\n\n\n# Technical Specifications\n\n...  * Wiki links to be added\n\n\n### Wiki\n\n* Getting started\n    - Quick demo - CGI mode executable files\n    - Quick demo - proxying to proxies/servers\n    - Quick demo - proxying to proxy's websocket\n    - Quick demo - proxying to udp, socks, http to socks proxy's websocket\n* Run CGI files using process module and binaries in the system\n    - PHP (.php)\n    - Perl (Perl any versions - .plc, .pld, .pl)\n    - Python (Python2, Python3 - .py)\n    - Ruby (.rb)\n    - Node.js (.js)\n* Run CGI files using cgi-js` `wasm` module\n    - PHP (.php)\n    - Perl (Perl any versions - .plc, .pld, .pl)\n    - Python (Python2, Python3 - .py)\n    - Ruby (.rb)\n    - Lua (.)\n    - Rust (.)\n    - GoLang (.go)\n    - CPython (.py)\n    - Julia (.)\n    - R-Lang (.)\n* Run Proxy servers to connect to:\n    - Any Local http/https/websocket Servers\n    - Any Remote http/https/websocket Servers\n    - Embedded Apache httpd, Apache tomcat, Nginx (http/https/websocket)\n    - Embedded Mongoose http server (http/https)\n* Manage Embedded Servers (for desktop-cgi use case):\n    - Embedded Apache httpd (http/https/websocket)\n    - Embedded Apache tomcat (http/https/websocket)\n    - Embedded Mongoose http server (http/https)\n    - Embedded Nginx (http/https/websocket)\n    - PHP inbuilt web development servers\n    - Ruby inbuilt web development servers\n    - Python inbuilt web development servers\n* Manage Embedded Database Servers (for desktop-cgi use case):\n    - Embedded Mysql\n    - Embedded MongoDB\n    - Embedded PgSQL\n    - Working with SQLite\n* Manage Processes (for desktop-cgi use case):\n    - Other Processes or executable workings\n* Run and Manage embedded or non-embedded executables / processes on need for application\n* Working with config.json file for simpler implementation in apps\n\n\n# Current Status\n\n* In development [Testing for Desktop-CGI use case]\n* In development [Testing for language based development server]\n\n\n# Todo\n\nCheck [.todo](https://github.com/cgi-js/cgi-js/blob/main/.todo) file for latest TODO list\n\n\u003c!-- # References --\u003e\n\n\n# License\n\nThe MIT License (MIT) - See [LICENSE](https://github.com/cgi-js/cgi-js/blob/main/LICENSE) for further details\n\n\nCopyright © 2019 - till library works:\n    Ganesh B \u003cdesktopcgi@gmail.com\u003e\n\n\n#### Please support the development in github repository through \n    - feature needs reporting,\n    - testing,\n    - issue reporting,\n    - contribution\n    \nPlease use these [styles](https://github.com/cgi-js/cgi-js/issues/13) for contributions\n\n","funding_links":["https://github.com/sponsors/ganeshkbhat"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcgi-js%2Fcgi-js","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcgi-js%2Fcgi-js","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcgi-js%2Fcgi-js/lists"}