{"id":15728576,"url":"https://github.com/luftywiranda13/remove-lockfiles","last_synced_at":"2025-03-13T03:30:38.815Z","repository":{"id":57353314,"uuid":"99702136","full_name":"luftywiranda13/remove-lockfiles","owner":"luftywiranda13","description":"Prevent committing lockfiles","archived":false,"fork":false,"pushed_at":"2020-06-03T09:20:12.000Z","size":349,"stargazers_count":5,"open_issues_count":9,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-26T18:23:48.988Z","etag":null,"topics":["cli","cli-app","commit","cross-platform","git","git-hooks","hooks","lockfile","npm","pre-commit","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/luftywiranda13.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":"2017-08-08T14:30:11.000Z","updated_at":"2025-02-22T04:02:35.000Z","dependencies_parsed_at":"2022-08-29T10:11:28.118Z","dependency_job_id":null,"html_url":"https://github.com/luftywiranda13/remove-lockfiles","commit_stats":null,"previous_names":[],"tags_count":21,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luftywiranda13%2Fremove-lockfiles","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luftywiranda13%2Fremove-lockfiles/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luftywiranda13%2Fremove-lockfiles/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luftywiranda13%2Fremove-lockfiles/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/luftywiranda13","download_url":"https://codeload.github.com/luftywiranda13/remove-lockfiles/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243335029,"owners_count":20274895,"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":["cli","cli-app","commit","cross-platform","git","git-hooks","hooks","lockfile","npm","pre-commit","yarn"],"created_at":"2024-10-03T23:03:55.046Z","updated_at":"2025-03-13T03:30:38.580Z","avatar_url":"https://github.com/luftywiranda13.png","language":"JavaScript","readme":"# remove-lockfiles\n\n\u003e Prevent committing lockfiles\n\n[![Package Version](https://img.shields.io/npm/v/remove-lockfiles.svg?style=flat-square)](https://www.npmjs.com/package/remove-lockfiles)\n[![Downloads Status](https://img.shields.io/npm/dm/remove-lockfiles.svg?style=flat-square)](https://npm-stat.com/charts.html?package=remove-lockfiles\u0026from=2016-04-01)\n[![Build Status: Linux](https://img.shields.io/travis/luftywiranda13/remove-lockfiles/master.svg?style=flat-square)](https://travis-ci.org/luftywiranda13/remove-lockfiles)\n[![Build Status: Windows](https://img.shields.io/appveyor/ci/luftywiranda13/remove-lockfiles/master.svg?style=flat-square\u0026logo=appveyor)](https://ci.appveyor.com/project/luftywiranda13/remove-lockfiles/branch/master)\n[![Coverage Status](https://img.shields.io/codecov/c/github/luftywiranda13/remove-lockfiles/master.svg?style=flat-square)](https://codecov.io/gh/luftywiranda13/remove-lockfiles)\n\n## Why\n\n* [Lockfiles are for apps, not for libraries/packages](https://github.com/sindresorhus/ama/issues/479#issuecomment-310661514)\n* [Listing lockfiles in .gitignore is considered a bad approach](https://github.com/facebookincubator/create-react-app/pull/2014#issuecomment-300811661)\n* _[Unstaging only](https://github.com/facebookincubator/create-react-app/pull/2700)_ will introduce new problems\n* Uses [force-del](https://github.com/luftywiranda13/force-del) to get rid of lockfiles\n* No need to force contributors to use `npm` or `yarn`\n* No need to use 2 extra dot files (`.npmrc` and `.yarnrc`) to avoid generating lockfiles\n* Works on macOS, Linux, and Windows\n\n## Installation\n\n```sh\nnpm install --save-dev remove-lockfiles\n```\n\n## Usage\n\n### Pre-commit hook\n\nInstall [husky](https://github.com/typicode/husky):\n\n```sh\nnpm install husky --save-dev\n```\n\nEdit `package.json` to include this configuration:\n\n```js\n{\n  \"scripts\": {\n    \"precommit\": \"remove-lockfiles\"\n  }\n}\n```\n\nLooking for alternative to `husky`? We can also use `remove-lockfiles` with [pre-commit](https://github.com/observing/pre-commit).\n\n### CLI\n\nInstall `remove-lockfiles` globally:\n\n```sh\nnpm install --global remove-lockfiles\n```\n\nRun the script:\n\n```\n$ remove-lockfiles --help\n\n  Usage\n    $ remove-lockfiles [path|options]\n\n  Options\n    --shrinkwrap  Remove `npm-shrinkwrap.json` if found\n\n  Examples\n    $ remove-lockfiles\n    $ remove-lockfiles ../foo\n    $ remove-lockfiles --shrinkwrap\n    $ remove-lockfiles --shrinkwrap ../foo\n```\n\n### API\n\n#### removeLockfiles([options])\n\nReturns `Promise\u003cArray\u003e` of deleted lockfiles.\n\n##### options\n\nType: `Object`\n\n###### cwd\n\nType: `string`\u003cbr /\u003e\nDefault: `process.cwd()`\n\nCurrent working directory.\n\n###### shrinkwrap\n\nType: `boolean`\u003cbr /\u003e\nDefault: `false`\n\nSet to `true` to remove `npm-shrinkwrap.json`.\n\n## Related\n\n* [del-nm-cli](https://github.com/luftywiranda13/del-nm-cli) － Delete `node_modules` and lockfiles\n* [force-del](https://github.com/luftywiranda13/force-del) － Force delete files or folders using glob patterns\n* [has-lockfile](https://github.com/luftywiranda13/has-lockfile) － Detect lockfiles in the working directory\n\n## License\n\nMIT \u0026copy; [Lufty Wiranda](https://www.luftywiranda.com)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fluftywiranda13%2Fremove-lockfiles","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fluftywiranda13%2Fremove-lockfiles","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fluftywiranda13%2Fremove-lockfiles/lists"}