{"id":726,"url":"https://github.com/sindresorhus/process-exists","last_synced_at":"2025-04-06T01:10:29.229Z","repository":{"id":34022304,"uuid":"37780325","full_name":"sindresorhus/process-exists","owner":"sindresorhus","description":"Check if a process is running","archived":false,"fork":false,"pushed_at":"2021-11-04T13:53:36.000Z","size":20,"stargazers_count":58,"open_issues_count":2,"forks_count":4,"subscribers_count":6,"default_branch":"main","last_synced_at":"2025-03-29T04:27:02.750Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/sindresorhus.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},"funding":{"github":"sindresorhus","open_collective":"sindresorhus","custom":"https://sindresorhus.com/donate"}},"created_at":"2015-06-20T18:13:25.000Z","updated_at":"2024-07-21T12:28:05.000Z","dependencies_parsed_at":"2022-07-13T11:00:34.454Z","dependency_job_id":null,"html_url":"https://github.com/sindresorhus/process-exists","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sindresorhus%2Fprocess-exists","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sindresorhus%2Fprocess-exists/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sindresorhus%2Fprocess-exists/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sindresorhus%2Fprocess-exists/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sindresorhus","download_url":"https://codeload.github.com/sindresorhus/process-exists/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246812672,"owners_count":20838000,"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":[],"created_at":"2024-01-05T20:15:29.835Z","updated_at":"2025-04-06T01:10:29.199Z","avatar_url":"https://github.com/sindresorhus.png","language":"JavaScript","readme":"# process-exists\n\n\u003e Check if a process is running\n\n## Install\n\n```sh\nnpm install process-exists\n```\n\n## Usage\n\n```js\nimport {processExists, processExistsMultiple, filterExistingProcesses} from 'process-exists';\n\nconsole.log(await processExists(process.pid));\n//=\u003e true\n\nconst exists = await processExistsMultiple([process.pid, 'foo']);\n\nconsole.log(exists.get(process.pid));\n//=\u003e true\n\nconsole.log(exists.get('foo'));\n//=\u003e false\n\nconsole.log(filterExistingProcesses(exists));\n//=\u003e [process.pid]\n```\n\n## API\n\n### processExists(input)\n\nCheck if a process exists.\n\nReturns a `Promise\u003cboolean\u003e`.\n\n#### input\n\nType: `number | string`\n\nThe process ID or name to check.\n\n### processExistsMultiple(input)\n\nCheck multiple processes if they exist.\n\nReturns a `Promise\u003cMap\u003e` with the process name/ID as key and the status as a boolean value.\n\n#### input\n\nType: `Array\u003cnumber | string\u003e`\n\nThe process IDs or names to check.\n\n### filterExistingProcesses(input)\n\nFilter processes that exist.\n\nReturns an `Array\u003cnumber | string\u003e` with the processes that exist.\n\n#### input\n\nType: `Array\u003cnumber | string\u003e`\n\nThe process IDs or names to check.\n","funding_links":["https://github.com/sponsors/sindresorhus","https://opencollective.com/sindresorhus","https://sindresorhus.com/donate"],"categories":["Libraries"],"sub_categories":["Processes"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsindresorhus%2Fprocess-exists","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsindresorhus%2Fprocess-exists","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsindresorhus%2Fprocess-exists/lists"}