Migrating to Cloudsmith

Import npm

Once you have exported all your npm packages you can upload them to Cloudsmith.

First make sure you install the Cloudsmith CLI and export your token.

A folder of npm packages, in the .tgz format, can be published to Cloudsmith using the script below.
Create the bash script below and call it migrate_npm_to_cs.sh and give it execute privileges

shell
#!/bin/bash
FILES="."
for f in "$2/"*.tgz
do
  echo "Processing $f file..."
  cloudsmith push npm "$1" $f
done

Execute the migrate_npm_to_cs.sh file passing the path of <CLOUDSMITH_ORG>/<CLOUDSMITH_REPO> and <DIR_PATH_TO_DOWNLOADED_NPM_PACKAGES>

shell
./migrate_npm_to_cs.sh cloudsmith_org/cloudsmith_repo <DIR_PATH_TO_DOWNLOADED_NPM_PACKAGES>