{"id":19644324,"url":"https://github.com/ampproject/npw","last_synced_at":"2025-07-24T00:38:18.636Z","repository":{"id":47037084,"uuid":"405180906","full_name":"ampproject/npw","owner":"ampproject","description":"A workspace-aware npm wrapper to aid with developing in monorepos","archived":false,"fork":false,"pushed_at":"2025-06-29T08:00:07.000Z","size":12,"stargazers_count":3,"open_issues_count":4,"forks_count":3,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-06-29T09:18:25.050Z","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":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ampproject.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2021-09-10T18:42:41.000Z","updated_at":"2023-08-14T20:08:37.000Z","dependencies_parsed_at":"2023-11-13T09:41:43.087Z","dependency_job_id":"522f5fb9-9442-4ef0-a3db-716dc347fd47","html_url":"https://github.com/ampproject/npw","commit_stats":{"total_commits":9,"total_committers":4,"mean_commits":2.25,"dds":0.5555555555555556,"last_synced_commit":"73e584a44f762d08b1c3066dead8ab4ba50c6117"},"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/ampproject/npw","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ampproject%2Fnpw","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ampproject%2Fnpw/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ampproject%2Fnpw/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ampproject%2Fnpw/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ampproject","download_url":"https://codeload.github.com/ampproject/npw/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ampproject%2Fnpw/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266774802,"owners_count":23982247,"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-07-23T02:00:09.312Z","response_time":66,"last_error":null,"robots_txt_status":null,"robots_txt_updated_at":null,"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":[],"created_at":"2024-11-11T14:26:44.305Z","updated_at":"2025-07-24T00:38:18.609Z","avatar_url":"https://github.com/ampproject.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# @ampproject/npw\n\n\u003e A workspace-aware npm wrapper to aid with developing in monorepos\n\n`npw` aids when developing a sub-package inside a [npm workspace][workspaces]\nmonorepo. It allows you to cd into your sub-package and perform\nworkspace-aware operations without you having to cd back into the\nmonorepo root to perform the operation.\n\nImagine you have the following workspace setup:\n\n```\nmonorepo/\n  packages/\n    project-1/\n      package.json\n    project-2/\n      package.json   // { \"dependencies\": { \"project-1\": * } }\n  package.json       // { \"workspaces\": [ \"./packages/*\" ] }\n```\n\nIf you `cd monorepo` and run `npm install`, everything will work fine.\nBut if you `cd packages/project-2` and try running `npm install` again,\nyou'll get a failure that `project-1` cannot be resolved. This is\nbecause npm isn't aware you're working in a workspace's sub-package, so\nit doesn't know that `project-1` is in the parent directory.\n\n`npw` fixes this. When you run `npw install`, it will figure out where\nthe monorepo root is and perform the correct `npm install -w packages/project-2`\nso that npm is aware of the workspace.\n\n## Installation\n\n```bash\n$ npm install -g @ampproject/npw\n```\n\n## Usage\n\n`npw` is a simple wrapper around npm, and can be invoked with any\ncommand that npm supports.\n\n\n```bash\n$ npw install --save-dev prettier\n\n$ npw start\n```\n\n[workspaces]: https://docs.npmjs.com/cli/v7/using-npm/workspaces\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fampproject%2Fnpw","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fampproject%2Fnpw","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fampproject%2Fnpw/lists"}