{"id":19437758,"url":"https://github.com/architect/plugin-node-prune","last_synced_at":"2025-07-20T16:34:25.945Z","repository":{"id":57098557,"uuid":"167580161","full_name":"architect/plugin-node-prune","owner":"architect","description":"Architect plugin that cleans `node_modules` cruft from your cloud functions during deployment","archived":false,"fork":false,"pushed_at":"2022-11-05T04:04:33.000Z","size":1774,"stargazers_count":2,"open_issues_count":1,"forks_count":1,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-07-06T06:02:40.583Z","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":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/architect.png","metadata":{"files":{"readme":"readme.md","changelog":"changelog.md","contributing":".github/contributing.md","funding":null,"license":"LICENSE","code_of_conduct":".github/code_of_conduct.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-01-25T16:44:09.000Z","updated_at":"2024-09-30T00:07:56.000Z","dependencies_parsed_at":"2023-01-21T01:15:27.420Z","dependency_job_id":null,"html_url":"https://github.com/architect/plugin-node-prune","commit_stats":null,"previous_names":["arc-repos/arc-plugin-node-prune"],"tags_count":9,"template":false,"template_full_name":null,"purl":"pkg:github/architect/plugin-node-prune","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/architect%2Fplugin-node-prune","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/architect%2Fplugin-node-prune/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/architect%2Fplugin-node-prune/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/architect%2Fplugin-node-prune/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/architect","download_url":"https://codeload.github.com/architect/plugin-node-prune/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/architect%2Fplugin-node-prune/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266160832,"owners_count":23885886,"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-10T15:15:47.384Z","updated_at":"2025-07-20T16:34:25.929Z","avatar_url":"https://github.com/architect.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"[\u003cimg src=\"https://assets.arc.codes/architect-logo-500b@2x.png\" width=500\u003e](https://www.npmjs.com/package/@architect/architect)\n\n## [`@architect/plugin-node-prune`](https://www.npmjs.com/package/@architect/plugin-node-prune)\n\n\u003e Node.js-specific Architect plugin based on [`node-prune`](https://github.com/tuananh/node-prune) that cleans `node_modules` cruft from your Lambdas during deployment\n\n\n## Warning\n\nPruning your `node_modules` tree(s) has some inherent risks. While we have found it to be stable and reliable, the packages your project uses may provide different results.\n\nFor example: while unlikely, a package that includes and makes use of a file with a commonly `.npmignore`d filename may be impacted by this pruner. For a list of files and folders that are pruned, please [review the pruner script source](https://github.com/architect/plugin-node-prune/blob/main/prune.sh).\n\n\n## Installation\n\n1. Run: `npm i @architect/plugin-node-prune`\n\n2. Then add the following to your Architect project file (usually `.arc`):\n\n```\n@plugins\narchitect/plugin-node-prune\n```\n\n\u003e Note, no `@` in the plugin name!\n\n3. Deploy your project (`npx deploy`) and watch the filesizes drop 📉\n\n\n## Results\n\nIn practice, we have seen average filesize and file count reductions of about 25-30% across the board. That's a meaningful number for cloud functions!\n\n\n## Disabling the plugin\n\nIf for whatever reason you need to disable the plugin, simply comment it out in (or remove it from) your Architect project file:\n\n```\n@plugins\n# architect/plugin-node-prune\n```\n\n\n## Limitations\n\n- Architect supports shared code by selectively copying `src/shared` and `src/views` into all Functions' `node_modules` dirs by default.\n  - Because this plugin runs just prior to deployment, it must avoid Architect shared code dirs so as not to inadvertently destroy user files.\n  - As such, any `node_modules` folders within `src/shared` or `src/views` will not be pruned.\n- This plugin relies on shelling out to a bash script, so ymmv on Windows.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farchitect%2Fplugin-node-prune","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Farchitect%2Fplugin-node-prune","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farchitect%2Fplugin-node-prune/lists"}