{"id":23116075,"url":"https://github.com/douglasjunior/ignore-dependency-scripts","last_synced_at":"2025-08-16T21:32:21.347Z","repository":{"id":65524117,"uuid":"565901851","full_name":"douglasjunior/ignore-dependency-scripts","owner":"douglasjunior","description":"Script to prevent dependencies to execute post/pre install scripts when installed directly from git.","archived":false,"fork":false,"pushed_at":"2022-12-21T18:12:40.000Z","size":26,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-08-11T23:55:05.837Z","etag":null,"topics":["dependency","git","npm","postinstall","yarn"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/ignore-dependency-scripts","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/douglasjunior.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"github":"douglasjunior","patreon":"douglasjunior","custom":"paypal.me/douglasnassif"}},"created_at":"2022-11-14T15:08:29.000Z","updated_at":"2024-03-20T23:40:30.000Z","dependencies_parsed_at":"2023-01-30T04:31:00.166Z","dependency_job_id":null,"html_url":"https://github.com/douglasjunior/ignore-dependency-scripts","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/douglasjunior/ignore-dependency-scripts","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/douglasjunior%2Fignore-dependency-scripts","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/douglasjunior%2Fignore-dependency-scripts/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/douglasjunior%2Fignore-dependency-scripts/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/douglasjunior%2Fignore-dependency-scripts/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/douglasjunior","download_url":"https://codeload.github.com/douglasjunior/ignore-dependency-scripts/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/douglasjunior%2Fignore-dependency-scripts/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":270134987,"owners_count":24533192,"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","status":"online","status_checked_at":"2025-08-12T02:00:09.011Z","response_time":80,"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":["dependency","git","npm","postinstall","yarn"],"created_at":"2024-12-17T04:10:54.392Z","updated_at":"2025-08-16T21:32:21.041Z","avatar_url":"https://github.com/douglasjunior.png","language":"JavaScript","funding_links":["https://github.com/sponsors/douglasjunior","https://patreon.com/douglasjunior","paypal.me/douglasnassif","https://www.patreon.com/douglasjunior","https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick\u0026hosted_button_id=E32BUP77SVBA2"],"categories":[],"sub_categories":[],"readme":"# Ignore dependency post/pre install scripts\n\n[![License MIT](https://img.shields.io/badge/licence-MIT-blue.svg)](https://github.com/douglasjunior/ignore-dependency-scripts/blob/master/LICENSE)\n[![npm version](https://img.shields.io/npm/v/ignore-dependency-scripts.svg)](https://www.npmjs.com/package/ignore-dependency-scripts)\n[![npm downloads](https://img.shields.io/npm/dt/ignore-dependency-scripts.svg)](#usage)\n\nScript to prevent dependencies to execute post/pre install scripts when installed directly from git.\n\n*Alternative to [typicode/pinst](https://github.com/typicode/pinst) and [bahmutov/am-i-a-dependency](https://github.com/bahmutov/am-i-a-dependency).*\n\n## Why?\n\nSometimes when working with private projects, we have the need to reuse some parts of our code in many projects. But, we know that maintaining a private `npm registry` is a pain and requires a lot of attention.\n\nSo, the easiest way, is to install our private repo as a dependency directly from git. But, this comes with some caveats like the inability to use `.npmignore` and the **lack of an option to \"prevent pre/post scripts\" when installed as a dependency.**\n\nSome examples of scripts that we might want to prevent from running when installed as a dependency is:\n\n- husky install\n- npx pod-install\n\nIt's a solution for:\n\n- https://stackoverflow.com/q/72092997/2826279\n- https://stackoverflow.com/q/54212147/2826279\n- https://stackoverflow.com/q/23505318/2826279\n- https://stackoverflow.com/q/44749524/2826279\n- https://stackoverflow.com/q/41015620/2826279\n\n## Usage\n\nReplace this:\n\n```json\n  // package.json\n\n  \"name\": \"my-library\",\n  \"scripts:\" { \n    // \"start\", \"test\", \"build\", etc\n    \"postinstall/preinstall/prepare/etc\": \"your \u0026\u0026 scripts \u0026\u0026 here\"\n  },\n```\n\nWith this:\n\n```json\n  // package.json\n\n  \"name\": \"my-library\",\n  \"scripts:\" { \n    // \"start\", \"test\", \"build\", etc\n    \"postinstall/preinstall/prepare/etc\": \"npx --yes ignore-dependency-scripts \\\"your \u0026\u0026 scripts \u0026\u0026 here\\\"\"\n  },\n```\n\n\u003e Replace `your \u0026\u0026 scripts \u0026\u0026 here` by any post/pre install script that you want, like `husky install`, `npx pod-install` or both.\n\nNow, when you run `yarn install` or `npm install` in `./my-library` the `your \u0026\u0026 scripts \u0026\u0026 here` will run normally. \n\nBut, when you install `my-library` as a dependency (aka `yarn add url/to/my-library.git`) in another repository, the `your \u0026\u0026 scripts \u0026\u0026 here` will be ignored.\n\n## How it works\n\nConsider the [usage](#usage) example above.\n\nWhen `npx --yes ignore-dependency-scripts` is executed, it will check if there is a `.git` folder inside the root directory. (thanks to https://stackoverflow.com/a/68915638/2826279)\n\nIf the `.git` folder exists, then you are installing the dependencies of `./my-library` directly.\n\nIf the `.git` folder DOES NOT exist, then you are installing `my-library` as a dependency in another repository.\n\n\u003e I think that in future we can extend this package to use other strategies too. PRs will be welcome.\n\n## Contribute\n\nNew features, bug fixes and improvements are welcome! For questions and suggestions, use the [issues](https://github.com/douglasjunior/ignore-dependency-scripts/issues).\n\n\u003ca href=\"https://www.patreon.com/douglasjunior\"\u003e\u003cimg src=\"http://i.imgur.com/xEO164Z.png\" alt=\"Become a Patron!\" width=\"200\" /\u003e\u003c/a\u003e\n[![Donate](https://www.paypalobjects.com/en_US/i/btn/btn_donateCC_LG.gif)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick\u0026hosted_button_id=E32BUP77SVBA2)\n\n## License\n\n```\nThe MIT License (MIT)\n\nCopyright (c) 2022 Douglas Nassif Roma Junior\n```\n\nSee the full [license file](https://github.com/douglasjunior/ignore-dependency-scripts/blob/master/LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdouglasjunior%2Fignore-dependency-scripts","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdouglasjunior%2Fignore-dependency-scripts","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdouglasjunior%2Fignore-dependency-scripts/lists"}