{"id":22128949,"url":"https://github.com/ddmitov/executable-harness","last_synced_at":"2026-05-09T15:32:00.097Z","repository":{"id":71087269,"uuid":"147505782","full_name":"ddmitov/executable-harness","owner":"ddmitov","description":"Node.js - Electron - NW.js asynchronous controller for binary executables or scripts","archived":false,"fork":false,"pushed_at":"2021-09-26T16:56:42.000Z","size":14,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-09-06T00:33:25.020Z","etag":null,"topics":["electron","node-js","node-module","nwjs"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/executable-harness","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/ddmitov.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","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":"2018-09-05T11:13:39.000Z","updated_at":"2024-12-25T15:16:21.000Z","dependencies_parsed_at":null,"dependency_job_id":"badc1d4e-df79-4057-a63e-bae7d4d431fe","html_url":"https://github.com/ddmitov/executable-harness","commit_stats":{"total_commits":14,"total_committers":2,"mean_commits":7.0,"dds":0.3571428571428571,"last_synced_commit":"9b07b893026b7485ef7324eff14f91122a5c8aa9"},"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/ddmitov/executable-harness","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ddmitov%2Fexecutable-harness","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ddmitov%2Fexecutable-harness/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ddmitov%2Fexecutable-harness/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ddmitov%2Fexecutable-harness/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ddmitov","download_url":"https://codeload.github.com/ddmitov/executable-harness/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ddmitov%2Fexecutable-harness/sbom","scorecard":{"id":330285,"data":{"date":"2025-08-11","repo":{"name":"github.com/ddmitov/executable-harness","commit":"9b07b893026b7485ef7324eff14f91122a5c8aa9"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3,"checks":[{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Code-Review","score":0,"reason":"Found 0/14 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE.md:0","Info: FSF or OSI recognized license: MIT License: LICENSE.md:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}}]},"last_synced_at":"2025-08-18T03:23:58.223Z","repository_id":71087269,"created_at":"2025-08-18T03:23:58.223Z","updated_at":"2025-08-18T03:23:58.223Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32824326,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-08T08:22:46.396Z","status":"online","status_checked_at":"2026-05-09T02:00:06.633Z","response_time":123,"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":["electron","node-js","node-module","nwjs"],"created_at":"2024-12-01T17:57:23.958Z","updated_at":"2026-05-09T15:32:00.078Z","avatar_url":"https://github.com/ddmitov.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# executable-harness\n\n[![Known Vulnerabilities](https://snyk.io/test/github/ddmitov/executable-harness/badge.svg?targetFile=package.json)](https://snyk.io/test/github/ddmitov/executable-harness?targetFile=package.json)\n[![Maintainability](https://api.codeclimate.com/v1/badges/8022196887baf15d2ef9/maintainability)](https://codeclimate.com/github/ddmitov/executable-harness/maintainability)  \n\n[Node.js](http://nodejs.org/) - [Electron](http://electron.atom.io/) - [NW.js](http://nwjs.io/) asynchronous controller for binary executables or scripts  \n\n## Quick Start\n\n``npm install executable-harness``  \n\n```javascript\nconst executableHarness = require(\"executable-harness\");\n\nlet test = {};\ntest.executable = \"/test/executable\";\n\ntest.stdoutFunction = function (stdout) {\n  console.log(stdout);\n};\n\nexecutableHarness.startExecutable(test);\n```\n\n## Single Dependency\n\n``child_process``\n\n## API\n\nAll settings of an executable or script executed by executable-harness are stored in a JavaScript object with an arbitrary name and the following object properties:  \n\n* **executable**  \n  ``String`` for the filename of a binary executable or script:  \n  either filename on PATH or full pathname  \n  *This object property is mandatory.*  \n\n  ```javascript\n  test.executable = \"/full/path/to/executable\";\n  ```\n\n  or\n\n  ```javascript\n  test.executable = \"executable-on-path\";\n  ```\n\n  There are two possible configurations when a script has to be started:  \n\n  * The ``executable`` object property points to the appropriate script interpreter and the ``executableArguments`` object property holds the script full pathname. In this case, the script is executed by the selected script interpreter regardless of the operating system.  \n\n  * The ``executable`` object property holds the script full pathname and the script is executed by the default interpreter of the operating system, if any.\n\n* **stdoutFunction**  \n  will be executed every time data is available on STDOUT  \n  The only parameter passed to the ``stdoutFunction`` is the STDOUT ``String``.  \n\n  ```javascript\n  test.stdoutFunction = function (stdout) {\n    document.getElementById(\"DOM-element-id\").textContent = stdout;\n  };\n  ```\n\n* **stderrFunction**  \n  will be executed every time data is available on STDERR  \n  The only parameter passed to the ``stderrFunction`` is the STDERR ``String``.  \n\n  ```javascript\n  test.stderrFunction = function (stderr) {\n    console.log(\"STDERR:\\n\");\n    console.log(stderr);\n  };\n  ```\n\n* **errorFunction**  \n  will be executed on executable error  \n  The only parameter passed to the ``errorFunction`` is the error ``Object``.  \n\n  The ``errorFunction`` can generate a message when executable is not found:  \n\n  ```javascript\n  test.errorFunction = function (error) {\n    if (error.code === \"ENOENT\") {\n      console.log(\"Executable was not found.\");\n    }\n  };\n  ```\n\n* **exitFunction**  \n  will be executed when executable has ended  \n  The only parameter passed to the ``exitFunction`` is the exit code ``String``.  \n\n  The ``exitFunction`` can generate a message when executable is not found:  \n\n  ```javascript\n  test.exitFunction = function (exitCode) {\n    if (exitCode === 2) {\n      console.log(\"Executable was not found.\");\n    }\n  };\n  ```\n\n* **executableArguments**  \n  ``Array`` for command-line arguments  \n\n  ```javascript\n  test.executableArguments = [];\n  test.executableArguments.push(\"argument-one\");\n  test.executableArguments.push(\"argument-two\");\n  ```\n\n* **options**  \n  ``Object`` for executable options passed to the ``child_process`` core module.  \n  Click [here](https://nodejs.org/api/child_process.html#child_process_child_process_spawn_command_args_options) for a full list of all available ``child_process`` options.\n\n* **options.cwd**  \n  ``String`` for a new current working directory of the selected executable  \n\n  ```javascript\n  test.options = {};\n  test.options.cwd = \"/full/path/to/current-working-directory\";;\n  ```\n\n* **options.env**  \n  ``Object`` for a new environment of the selected executable  \n\n  Executable environment with an inherited PATH and a new variable:  \n\n  ```javascript\n  test.options = {};\n  test.options.env = {};\n  test.options.env.PATH = process.env.PATH;\n  test.options.env.TEST = \"test\";\n  ```\n\n* **options.detached**  \n  ``Boolean`` option for starting detached processes like servers  \n\n  ``options.detached`` must be set to ``true`` and  \n  ``options.stdio`` must be set to ``\"ignore\"`` to  \n  start a detached process without receiving anything from it.  \n  A process detached with the above options can run even after its parent has ended.  \n\n  Example settings for a server application:  \n\n  ```javascript\n  let server = {};\n  server.executable = \"/path/to/server-application\";\n\n  server.options = {};\n  server.options.detached = true;\n  server.options.stdio = \"ignore\";\n\n  const executableHarness = require(\"executable-harness\");\n  executableHarness.startExecutable(server);\n\n  server.executableHandler.unref();\n  ```\n\n* **inputData**  \n  ``String`` or ``Function`` supplying user data as its return value.  \n  ``inputData`` is written on executable STDIN.  \n\n  ``inputData`` function with no dependencies:  \n\n  ```javascript\n  test.inputData = function () {\n    let data = document.getElementById(\"data-input\").value;\n    return data;\n  }\n  ```\n\n## Interactive Executables or Scripts\n\nexecutable-harness can also start and communicate with interactive executables or scripts having their own event loops and capable of repeatedly receiving STDIN input. Use the following code to send data to an interactive executable or script waiting for input on STDIN:\n\n```javascript\nlet data = document.getElementById(\"data-input\").value;\ntest.executableHandler.stdin.write(data);\n```\n\n## [Credits](./CREDITS.md)\n\n## [License](./LICENSE.md)\n\nMIT 2018  \nDimitar D. Mitov  \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fddmitov%2Fexecutable-harness","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fddmitov%2Fexecutable-harness","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fddmitov%2Fexecutable-harness/lists"}