{"id":16347451,"url":"https://github.com/privatenumber/npm-multi-publish","last_synced_at":"2025-08-03T00:07:29.138Z","repository":{"id":47359550,"uuid":"199095625","full_name":"privatenumber/npm-multi-publish","owner":"privatenumber","description":"Publish an npm package to multiple registries","archived":false,"fork":false,"pushed_at":"2022-10-07T05:29:30.000Z","size":133,"stargazers_count":25,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"develop","last_synced_at":"2025-07-21T14:24:08.896Z","etag":null,"topics":["artifactory","cli","lerna","multiple","npm","publish","registries","semantic-release"],"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/privatenumber.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":"2019-07-27T00:20:45.000Z","updated_at":"2024-10-25T08:35:33.000Z","dependencies_parsed_at":"2022-09-24T10:22:53.072Z","dependency_job_id":null,"html_url":"https://github.com/privatenumber/npm-multi-publish","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/privatenumber/npm-multi-publish","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/privatenumber%2Fnpm-multi-publish","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/privatenumber%2Fnpm-multi-publish/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/privatenumber%2Fnpm-multi-publish/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/privatenumber%2Fnpm-multi-publish/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/privatenumber","download_url":"https://codeload.github.com/privatenumber/npm-multi-publish/tar.gz/refs/heads/develop","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/privatenumber%2Fnpm-multi-publish/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":268475669,"owners_count":24256153,"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-08-02T02:00:12.353Z","response_time":74,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","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":["artifactory","cli","lerna","multiple","npm","publish","registries","semantic-release"],"created_at":"2024-10-11T00:42:34.736Z","updated_at":"2025-08-03T00:07:29.089Z","avatar_url":"https://github.com/privatenumber.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003e ⚠️ **DEPRECATED**\n\u003e \n\u003e This project does not work expectedly with npm v6, and is no longer maintained.\n\u003e Instead, I recommend using [npm-registry-sync](https://github.com/privatenumber/npm-registry-sync) to keep two registries in sync.\n\n# npm-multi-publish [![Latest version](https://badgen.net/npm/v/npm-multi-publish)](https://npm.im/npm-multi-publish) [![Monthly downloads](https://badgen.net/npm/dm/npm-multi-publish)](https://npm.im/npm-multi-publish) [![Install size](https://packagephobia.now.sh/badge?p=npm-multi-publish)](https://packagephobia.now.sh/result?p=npm-multi-publish)\n\nPublish an npm package to multiple registries\n\n### Features\n- **🙌 Streamlined** Publishes to all registries in one `npm publish`!\n- **🔥 High compatibility** Works with anything that uses `npm publish` (eg. monorepo)!\n- **⚡️ Easy setup** Just add it to your npm publish hooks!\n- **🛡 VPN conscious** Waits for you to switch VPNs if registry is unreachable!\n\n\u003csub\u003eSupport this project by ⭐️ starring and sharing it. [Follow me](https://github.com/privatenumber) to see what other cool projects I'm working on! ❤️\u003c/sub\u003e\n\n\n## 🚀 Install\n```sh\nnpm i -D npm-multi-publish\n```\n\n## 🚦 Quick Setup\n\n1. Open `package.json`\n2. Add `npm-multi-publish` to the `prepublishOnly` and `postpublish` hooks\n3. Convert `publishConfig` into an array of configs\n\n```diff\n  {\n      ...,\n\n      \"scripts\": {\n+         \"prepublishOnly\": \"npm-multi-publish\",\n+         \"postpublish\": \"npm-multi-publish\"\n      },\n\n      \"publishConfig\": [\n+         {\n+             \"registry\": \"Registry URL 1\"\n+         },\n+         {\n+             \"registry\": \"Registry URL 2\"\n+         },\n+         ...\n      ],\n\n      ...\n  }\n```\n\nIf using [Lerna](https://lerna.js.org/), add this configuration to the respective `package.json` of each package in the monorepo (not necessary in the root `package.json`).\n\n\nThat's it! Next time you run `npm publish` or `yarn publish` it will automatically publish to all registries configured in your `package.json` `publishConfig` array.\n\nIf the registries require authentication, make sure you authenticate with them all using a single `.npmrc` file (toggling via [`npmrc`](https://www.npmjs.com/package/npmrc) will not work).\n\n\n## 💁‍♀️ FAQ\n\n### Is it possible to authenticate to multiple npm registries with one `.npmrc` file?\n\n[Yes](https://docs.npmjs.com/logging-in-to-an-npm-enterprise-registry-from-the-command-line#logging-in-with-a-scope-configured-to-point-to-an-npm-enterprise-registry). This is actually the preferred way because `npm publish` loads the `.npmrc` file at the beginning, so toggling `.npmrc` files via [`npmrc`](https://www.npmjs.com/package/npmrc) during publish (even in npm-multi-publish) does not take effect.\n\nTo login to an enterprise/custom registry:\n\n```sh\n$ npm login --registry=https://registry.company-name.npme.io\n```\n\nTo verify authentication on a specific registry:\n\n```sh\n$ npm whoami --registry=https://registry.company-name.npme.io\n```\n\n\nA `.npmrc` file authenticated with multiple registries should include something like this:\n```\n//registry-a-url/:_authToken=... # Registry A authentication token\n//registry-b-url/:_authToken=... # Registry B authentication token\n```\n\nIf you have certs for the respective registries, you can [add multiple certs to your `.npmrc` file](https://docs.npmjs.com/misc/config#ca).\n\n### How can I test publishing to a registry?\nUse [`verdaccio`](https://github.com/verdaccio/verdaccio) to create a local mock npm registry.\n\nInstall and start the verdaccio server:\n\n```sh\n$ npm i -g verdaccio\n$ verdaccio # Start server\n```\n\nIn a separate terminal window, configure npm to use your verdaccio server. I recommend using [`npmrc`](https://www.npmjs.com/package/npmrc) to create a new npmrc for the \"verdaccio\" profile so your default npmrc isn't polluted and so you can switch to it easily in the future:\n\n```sh\n$ npmrc -c verdaccio # (Optional) Create a new .npmrc not to pollute existing ones\n$ npm set registry http://localhost:4873 # Set default registry\n$ npm adduser --registry http://localhost:4873 # Login to registry\n```\n\nNow you can test publishing.\n\nAfter your package is test-published to verdaccio, you can confirm the contents via their Web UI at http://localhost:4873 (or any other port it's listening on).\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprivatenumber%2Fnpm-multi-publish","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fprivatenumber%2Fnpm-multi-publish","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprivatenumber%2Fnpm-multi-publish/lists"}