{"id":23382231,"url":"https://github.com/sidoshi/run-by","last_synced_at":"2026-05-06T22:02:30.028Z","repository":{"id":66110917,"uuid":"122737073","full_name":"sidoshi/run-by","owner":"sidoshi","description":"Figure out if the script is run by npm or yarn","archived":false,"fork":false,"pushed_at":"2018-02-24T12:06:53.000Z","size":57,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-01T14:21:14.362Z","etag":null,"topics":["npm","npm-scripts","script","yarn"],"latest_commit_sha":null,"homepage":"","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/sidoshi.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"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-02-24T12:05:54.000Z","updated_at":"2023-03-10T09:31:10.000Z","dependencies_parsed_at":null,"dependency_job_id":"fc77fabb-ef9a-4025-b15f-b0b89bb18045","html_url":"https://github.com/sidoshi/run-by","commit_stats":null,"previous_names":["doshisid/run-by"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sidoshi%2Frun-by","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sidoshi%2Frun-by/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sidoshi%2Frun-by/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sidoshi%2Frun-by/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sidoshi","download_url":"https://codeload.github.com/sidoshi/run-by/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247808216,"owners_count":20999677,"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":["npm","npm-scripts","script","yarn"],"created_at":"2024-12-21T21:19:02.478Z","updated_at":"2026-05-06T22:02:24.991Z","avatar_url":"https://github.com/sidoshi.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# run-by\n\n[![Build Status](https://travis-ci.org/doshisid/run-by.svg?branch=master)](https://travis-ci.org/doshisid/run-by) [![contributions welcome](https://img.shields.io/badge/contributions-welcome-brightgreen.svg?style=flat)](https://github.com/doshisid/run-by/issues) [![HitCount](http://hits.dwyl.io/doshisid/run-by.svg)](http://hits.dwyl.io/doshisid/run-by) [![npm](https://img.shields.io/npm/v/run-by.svg)](https://www.npmjs.com/package/run-by) [![npm](https://img.shields.io/npm/l/run-by.svg)](https://www.npmjs.com/package/run-by)\n\n\u003e Figure out script is run by npm or yarn\n\n## Install\n\n```bash\nnpm install --save run-by\n```\n\n## Usage\n\n```js\nimport runBy from 'run-by'\n```\n\n## API\n\n### isYarn: boolean\n\nTrue if the script is started with `yarn`\n\n### isNpm: boolean\n\nTrue if script is started with `npm`\n\n### runner: ?string\n\nIt's value will be one of `npm`, `yarn` or null depending on how the\nscript has started. If the script is started with `node`, `runner` will be\n`null`.\n\n### runBy(execPath: string): RunBy\n\nIt takes the exec_path env, by default is `process.env.npm_execpath`.\nReturns `isYarn`, `isNpm` and `runner` depending on the `execpath`.\n\n## License\n\nMIT © [Siddharth Doshi](https://sid.sh)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsidoshi%2Frun-by","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsidoshi%2Frun-by","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsidoshi%2Frun-by/lists"}