{"id":21531938,"url":"https://github.com/matrixai/js-exec","last_synced_at":"2025-03-17T19:28:22.188Z","repository":{"id":222788575,"uuid":"758316500","full_name":"MatrixAI/js-exec","owner":"MatrixAI","description":"Execute child process while replacing process-memory for TypeScript \u0026 JavaScript","archived":false,"fork":false,"pushed_at":"2024-03-18T04:04:44.000Z","size":587,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"staging","last_synced_at":"2024-05-29T00:33:10.197Z","etag":null,"topics":["exec","execvp","execvpe"],"latest_commit_sha":null,"homepage":"https://polykey.com","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/MatrixAI.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"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}},"created_at":"2024-02-16T03:45:05.000Z","updated_at":"2024-02-21T20:15:04.000Z","dependencies_parsed_at":"2024-02-21T06:31:47.261Z","dependency_job_id":"323804e4-3da0-4ebf-b092-84277b4ef8fa","html_url":"https://github.com/MatrixAI/js-exec","commit_stats":null,"previous_names":["matrixai/js-exec"],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MatrixAI%2Fjs-exec","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MatrixAI%2Fjs-exec/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MatrixAI%2Fjs-exec/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MatrixAI%2Fjs-exec/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MatrixAI","download_url":"https://codeload.github.com/MatrixAI/js-exec/tar.gz/refs/heads/staging","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244096075,"owners_count":20397333,"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":["exec","execvp","execvpe"],"created_at":"2024-11-24T02:18:13.047Z","updated_at":"2025-03-17T19:28:22.180Z","avatar_url":"https://github.com/MatrixAI.png","language":"JavaScript","readme":"# js-exec\n\nThis exposes `execvp` to Node.js. This allows running a child process that replaces the parent process image. This is not possible on Windows, if you run this on Windows, expect an exception!\n\n## Installation\n\n```sh\nnpm install --save @matrixai/exec\n```\n\n## Usage\n\nexec can be used in the following way.\n\n```ts\nimport { exec } from '@matrixai/exec';\n// This should output the current enviroment while adding `test_env` to it.\nexec.execvp(\n  'node',\n  [\n    '-e',\n    'console.log(process.env)',\n  ],\n  {\n    test_env: 'this value'\n  },\n);\n```\n\nNote that only linux and mac platforms are supported.\n\n## Development\n\nRun `nix develop`, and once you're inside, you can use:\n\n```sh\n# install (or reinstall packages from package.json)\nnpm install\n# build the native objects\nnpm run prebuild\n# build the dist and native objects\nnpm run build\n# run the repl (this allows you to import from ./src)\nnpm run ts-node\n# run the tests\nnpm run test\n# lint the source code\nnpm run lint\n# automatically fix the source\nnpm run lintfix\n```\n\n### Cargo/Rust targets\n\nCargo is a cross-compiler. The target structure looks like this:\n\n```\n\u003carch\u003e\u003csub\u003e-\u003cvendor\u003e-\u003csys\u003e-\u003cabi\u003e\n```\n\nFor example:\n\n```\nx86_64-unknown-linux-gnu\nx86_64-pc-windows-msvc\naarch64-apple-darwin\nx86_64-apple-darwin\n```\n\nThe available target list is in `rustc --print target-list`.\n\n### Docs Generation\n\n```sh\nnpm run docs\n```\n\nSee the docs at: https://matrixai.github.io/js-exec/\n\n### Publishing\n\nPublishing is handled automatically by the staging pipeline.\n\nPrerelease:\n\n```sh\n# npm login\nnpm version prepatch --preid alpha # premajor/preminor/prepatch\ngit push --follow-tags\n```\n\nRelease:\n\n```sh\n# npm login\nnpm version patch # major/minor/patch\ngit push --follow-tags\n```\n\nManually:\n\n```sh\n# npm login\nnpm version patch # major/minor/patch\nnpm run build\nnpm publish --access public\ngit push\ngit push --tags\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmatrixai%2Fjs-exec","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmatrixai%2Fjs-exec","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmatrixai%2Fjs-exec/lists"}