npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

pneumatic-tubes

v2.9.0

Published

migrate packages between registries (using npm publish)

Downloads

16

Readme

pneumatic-tubes

Migrate from kappa, npm Enterprise Legacy, and npm Orgs, to npm Enterprise SaaS.

Installation

npm i -g pneumatic-tubes

Preparation

  • Node.js 8+
  • npm 5 - 5.6 (5.7+ are incompatible with npmE)
  • run npm install
  • login to your target registry if needed: npm --registry=<target-registry-url> login

Importing From Kappa

You need to point the import script at the CouchDB instance associated with your kappa proxy. The kappa proxy itself doesn't foward the _changes feed, so direct couch access is necessary.

Run:

pneumatic-tubes couch-import --source-couch-db=[couch-db-url]/_changes --target-registry=[target-registry-url]

Importing From Legacy npm Enterprise

Fetch Secret used between services from your npm Enterprise console.

Run:

pneumatic-tubes couch-import --source-couch-db=[couch-db-url]/_changes --target-registry=[target-registry-url] --shared-fetch-secret=[password-from-console]

You may pass a --scopes=@example parameter to limit the import to one (or more, if specified multiple times) scopes.

You may also skip specific semver ranges of specific packages by creating a text file and passing its path with --exceptions=exceptions.txt. Each line in this file must be the name of a package, followed by a space, followed by a semver range. For example:

@myorg/mypackage < 1.0.0
@myorg/packageidontwant *

Would cause pneumatic-tubes to skip any version of @myorg/mypackage before version 1.0.0 and all versions of @myorg/packageidontwant.

Importing From npm Orgs

1. Create an authorization token

To migrate from npm Orgs, you need an authorization token from the public registry.

  1. visit https://www.npmjs.com.
  2. in the account drop down in the upper right, choose the option "Tokens".
  3. click "Create New Token", and copy this somewhere safe for later.

2. Create a text file containing the packages you wish to migrate

Note: you can only publish scoped modules to your private registry.

The text file should look something like this:

@babel/runtime
@babel/core
@babel/template

3. Login to your npm Enterprise Instance

npm config set registry https://registry.my-instance.npme.io
npm login

4. Create matching organization in npm Enterprise

You should create an organization in npm Enterprise that matches the name of the organization that you wish to migrate from in npm Orgs.

As an example, if you want to migrate from your organization @babel on the public registry, create an organization named babel in npm Enterprise.

5. Run the migration tool

It's now time to run the migration tool, using the token and text file that you generated.

Note: this will migrate all versions of your module.

pneumatic-tubes orgs-import --source-token=[redacted] --target-registry=https://registry..npme.io --migrate-file=migrate-file.txt

If the option --target-token is provided, upstream documents will be fetched and the tool will skip publishing duplicate packages.

Development

If you are making changes to pneumatic-tubes, you can test using a local kappa.

Run kappa in the foreground:

docker-compose up

OR

Run kappa in the background:

docker-compose up -d

When backgrounded, you can tail its logs thus (includes 20 lines of context):

docker logs --follow --tail 20 pneumatictubes_kappa_1