Introduction
Guides
How to Import an npm Package
If your package already lives on npmjs.com, GitHub Packages, or another npm-compatible registry, you can import it into pckgs.io instead of re-publishing it manually.
Prerequisites
- An organization on pckgs.io with an npm registry. See Create an Organization.
- Read access to the source registry, if it requires credentials.
Import from an npm Registry
- From your organization’s Packages page, click Import Package.
- Leave the Import Source on NPM Registry:
- Enter the Registry URL. Use
registry.npmjs.orgfor the public npm registry, or the URL of your own self-hosted registry such as Verdaccio, Nexus, or Artifactory:
- Choose how to authenticate. Pick Token for a bearer or access token, or Basic for a username and password. Leave the credential empty for public registries like npmjs.com:
- Click Connect to list the packages available on the registry:
- For each package you want to bring in, click Import. Packages keep the scope they were published under:
@babel/core
@babel/core
Every version of the package is imported, so it’s ready to install right away.
Import from GitHub Packages
- Set the Import Source to Github:
- Paste a GitHub Personal Access Token (classic). It must carry the
read:packagespermission, plusread:orgif you want to list packages owned by a GitHub organization:
- Click Connect, pick the account or organization that owns the packages, and click Import on each package you want.
Packages hosted on GitHub Packages are already scoped to their owner, so @my-org/my-package is imported under exactly that name.
Notes
- Import is a one-time copy. New versions published to the source registry afterwards are not pulled in automatically re-run the import to pick them up.
- Only scoped names can be imported, because a pckgs.io npm registry only accepts
@scope/name.
Related
- npm Package Registry
- How to Publish an npm Package
- npm Package Registry Authentication
- How to Install an npm Package
Need help? Contact us here or at [email protected].