{"id":16324222,"url":"https://github.com/mekwall/is-install-needed","last_synced_at":"2025-07-06T00:09:10.212Z","repository":{"id":56240859,"uuid":"152779008","full_name":"mekwall/is-install-needed","owner":"mekwall","description":"A simple devtool that tells you if you need to run install or not","archived":false,"fork":false,"pushed_at":"2020-11-18T22:16:06.000Z","size":1925,"stargazers_count":4,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-07-05T04:49:38.389Z","etag":null,"topics":["devtools","npm","pnpm","yarn","yarnpkg"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"isc","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mekwall.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}},"created_at":"2018-10-12T16:29:16.000Z","updated_at":"2023-10-17T15:21:59.000Z","dependencies_parsed_at":"2022-08-15T15:20:12.461Z","dependency_job_id":null,"html_url":"https://github.com/mekwall/is-install-needed","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/mekwall/is-install-needed","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mekwall%2Fis-install-needed","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mekwall%2Fis-install-needed/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mekwall%2Fis-install-needed/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mekwall%2Fis-install-needed/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mekwall","download_url":"https://codeload.github.com/mekwall/is-install-needed/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mekwall%2Fis-install-needed/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263828726,"owners_count":23516791,"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":["devtools","npm","pnpm","yarn","yarnpkg"],"created_at":"2024-10-10T22:57:02.510Z","updated_at":"2025-07-06T00:09:10.188Z","avatar_url":"https://github.com/mekwall.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# is-install-needed\n\n[![license](https://img.shields.io/badge/license-ISC-blue.svg?style=flat-square)](https://github.com/mekwall/is-install-needed/blob/master/LICENSE)\n[![npm](https://img.shields.io/npm/v/is-install-needed.svg?style=flat-square\u0026logo=npm)](https://www.npmjs.com/package/is-install-needed)\n[![dependencies](https://img.shields.io/librariesio/github/mekwall/is-install-needed.svg?style=flat-square)](https://github.com/mekwall/is-install-needed)\n![types](https://img.shields.io/npm/types/is-install-needed.svg?style=flat-square\u0026logo=typescript)\n[![build](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Fmekwall%2Fis-install-needed%2Fbadge%3Fref%3Dmaster\u0026label=build\u0026style=flat-square)](https://actions-badge.atrox.dev/mekwall/is-install-needed/goto?ref=master)\n[![coverage](https://img.shields.io/codecov/c/github/mekwall/is-install-needed?style=flat-square)](https://codecov.io/github/mekwall/is-install-needed?branch=master)\n[![quality](https://img.shields.io/lgtm/grade/javascript/github/mekwall/is-install-needed?style=flat-square)](https://lgtm.com/projects/g/mekwall/is-install-needed/?mode=list)\n\nA simple devtool that tells you if you need to run install or not. It does so by checking if the lock file of your preferred package manager has changed. Supports the most popular package managers out there: [npm](https://www.npmjs.com/), [yarn](https://yarnpkg.com/) (v1 and v2) and [pnpm](https://pnpm.js.org/).\n\n## Installation\n\nInstall the `is-install-needed` package with your preferred package manager.\n\nAdd `is-install-needed --postinstall` to your postscript to automatically write a check file after install.\n\n## Usage\n\n### CLI\n\n```bash\n$ is-install-needed\n```\n\nIt will automatically look for yarn.lock, package-lock.json and pnpm-lock.yaml when no preferred package manager is provided.\n\n| Flag            | Available options | Description               |\n| --------------- | ----------------- | ------------------------- |\n| `--prefer`      | npm, yarn or pnpm | Preferred package manager |\n| `--cwd`         | \\\u003cpath\u003e           | Current working directory |\n| `--postinstall` |                   | Postinstall script        |\n\n### Programmatic API\n\n#### Check if install is needed\n\n```javascript\nimport { isInstallNeeded } from \"is-install-needed\";\n\nasync () =\u003e {\n  const isNeeded = await isInstallNeeded();\n  if (result) {\n    console.error(\"You need to run install\");\n    process.exit(1);\n  }\n};\n```\n\n#### Find closest lock file\n\n```javascript\nimport { findClosestLockfile } from \"is-install-needed\";\n\nasync () =\u003e {\n  const lockfile = await findClosestLockfile();\n  console.log(lockfile); // \u003e /path/to/package/.yarn.lock\n};\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmekwall%2Fis-install-needed","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmekwall%2Fis-install-needed","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmekwall%2Fis-install-needed/lists"}