{"id":17749548,"url":"https://github.com/oresoftware/package-sha","last_synced_at":"2025-06-21T13:35:33.329Z","repository":{"id":95712947,"uuid":"184504236","full_name":"ORESoftware/package-sha","owner":"ORESoftware","description":"This probably does not work as intended. Looking for other solutions.","archived":false,"fork":false,"pushed_at":"2019-05-02T19:05:34.000Z","size":16,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-05-18T16:54:45.366Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Shell","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/ORESoftware.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":"license.md","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":"2019-05-02T01:24:05.000Z","updated_at":"2019-05-02T23:33:41.000Z","dependencies_parsed_at":"2023-05-21T17:45:09.221Z","dependency_job_id":null,"html_url":"https://github.com/ORESoftware/package-sha","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ORESoftware/package-sha","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ORESoftware%2Fpackage-sha","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ORESoftware%2Fpackage-sha/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ORESoftware%2Fpackage-sha/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ORESoftware%2Fpackage-sha/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ORESoftware","download_url":"https://codeload.github.com/ORESoftware/package-sha/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ORESoftware%2Fpackage-sha/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261129729,"owners_count":23113886,"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-10-26T11:23:44.798Z","updated_at":"2025-06-21T13:35:28.316Z","avatar_url":"https://github.com/ORESoftware.png","language":"Shell","readme":"\n\n### Use this in Dockerfiles to determine if NPM install needs to re-occur\n\n\nnormally we can just use git caching like so:\n\n\n```Dockerfile\nCOPY package.json .\nRUN npm install     # if the package.json file has not changed, then this line's image will be re-used\nCOPY . .\n```\n\nBut what if we pull new code via git in the image instead of outside the image? So we do:\n\n\n```Dockerfile\n\nRUN CACHEBUST 1\nRUN git pull  # always re-occurs\nRUN package_sha --check || ( npm install \u0026\u0026 package_sha --installed )\n\n```\n\nThe nice thing about this technique is that the sha of the whole package.json file is not used,\nonly the dependencies objects in package.json are compared for equality. so if you bump the version in package.json,\nbut the dependencies are the same, then they won't get reinstalled.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foresoftware%2Fpackage-sha","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Foresoftware%2Fpackage-sha","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foresoftware%2Fpackage-sha/lists"}