{"id":19621350,"url":"https://github.com/commenthol/package-lock","last_synced_at":"2025-04-28T03:32:17.542Z","repository":{"id":57317690,"uuid":"100303604","full_name":"commenthol/package-lock","owner":"commenthol","description":"(Re-)Build package-lock.json or npm-shrinkwrap.json file from node_modules folder","archived":false,"fork":false,"pushed_at":"2020-10-18T19:22:45.000Z","size":18,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-21T15:09:52.046Z","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":"unlicense","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/commenthol.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}},"created_at":"2017-08-14T19:44:54.000Z","updated_at":"2021-01-21T22:37:42.000Z","dependencies_parsed_at":"2022-08-25T20:41:10.344Z","dependency_job_id":null,"html_url":"https://github.com/commenthol/package-lock","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/commenthol%2Fpackage-lock","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/commenthol%2Fpackage-lock/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/commenthol%2Fpackage-lock/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/commenthol%2Fpackage-lock/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/commenthol","download_url":"https://codeload.github.com/commenthol/package-lock/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251246258,"owners_count":21558761,"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-11-11T11:22:27.483Z","updated_at":"2025-04-28T03:32:17.057Z","avatar_url":"https://github.com/commenthol.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# package-lock\n\n\u003e (Re-)Build package-lock.json or npm-shrinkwrap.json file from node_modules folder\n\n## `npm@5` Creating `package-lock.json`\n\nCopying `node_modules` folders and trying to install additional packages leads to\na complete removal of all copied packages with `npm@\u003e=5.0`.\n\nA `package.json` file would solve this issue but nonetheless you would need to\ncreate one with all it's dependencies.\n\nRunning `package-lock` on the folder which contains `node_modules` creates the\nmissing `package-lock.json` file and in case the `package.json` is missing, it\nwill be created as well. With this you are now save to install additional\npackages with `npm i ...`\n\n## `npm@4`, `npm@3` Creating `npm-shrinkwrap.json`\n\nFor `npm@\u003c=4.x` you can also use this package to create a `npm-shrinkwrap.json`\nfile for fixing you dependencies. For me running `npm shrink` is mostly a mess\nas there is always an `extraneous` dependency showing up (especially after a dedup).\n\n1. Make a fresh install with    \n   ```\n   rimraf node_modules npm-shrinkwrap.json\n   npm i --production\n   ```\n2. Now create the `npm-shrinkwrap.json` file with\n   ```\n   package-lock -s\n   ```\n\n## Installation\n\nRequires [nodejs](http://nodejs.org/).\n\n```sh\n$ npm install -g package-lock\n```\n\n## Usage\n\n```sh\n$ package-lock\n```\n```\nUsage: package-lock [options]\n\nOptions:\n\n  -p, --package           force appending found packages to `optionalDependencies` in package.json\n  -r, --resolve \u003cstring\u003e  replace resolved repository\n  -s, --shrink            write `npm-shrinkwrap.json` instead of `package-lock.json`\n  -h, --help              output usage information\n```\n\n\n\n## Tests\n\n```sh\n$ npm test\n```\n\n## License\n\nUnlicense http://unlicense.org\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcommenthol%2Fpackage-lock","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcommenthol%2Fpackage-lock","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcommenthol%2Fpackage-lock/lists"}