Copy npm packages and all their versions from one registry to another
Based on goodeggs/npm-copy and dperuo/npm-carbon.
Use this command line tool to make a "carbon copy" of any npm package and all its published versions.
We migrated to ESM starting in v2.0.0. Please use v1 if you need CommonJS modules.
No installation needed. Use @appsweet-co/npm-carbon
directly from the command line.
npx @appsweet-co/npm-carbon -s $SRC_URL -d $DEST_URL <OPTIONS>
bunx @appsweet-co/npm-carbon -s $SRC_URL -d $DEST_URL <OPTIONS>
Run --help
for a full list of options.
npx @appsweet-co/npm-carbon --help
npx @appsweet-co/npm-carbon \
--src https://registry.npmjs.org \
--dest https://registry.npmjs.org \
--srcToken w7ikVizKsyP98uyBS6 \
--destToken JmNMqitWbnOex3py9A \
packageA [packageB...]
npx @appsweet-co/npm-carbon \
--src https://registry.npmjs.org \
--srcUser helloworld \
--srcPassword https://registry.npmjs.org \
--srcEmail helloworld@company.com \
--dest https://registry.npmjs.org \
--destUser helloworld \
--destPassword gUbcneqpbxC8 \
--destEmail helloworld@company.com \
packageA [packageB...]
By default, @appsweet-co/npm-carbon
copies all avaliable versions of the package. Use --range
to specify a subset of versions.
The --range
flag accepts any valid npm version range/
npx @appsweet-co/npm-carbon \
--range "~3.0.0 || 5.1.x" \
packageA [packageB...]
Modify the package prefix using the --srcprefix
and --destPrefix
flags.
npx @appsweet-co/npm-carbon \
--srcPrefix @company \
--destPrefix @company \
packageA [packageB...]
@foo/packageA
becomes just packageA
.
Contributions, issues and feature requests are welcome! Feel free to check issues page.
Clone this repo to your local machine and install dependencies.
git clone https://github.com/appsweet-co/npm-carbon.git
cd npm-carbon/
npm install
Use the start
command to compile TypeScript and watch for changes.
npm start
Run the local JavaScript file directly to check your changes.
node ./bin/index.js <OPTIONS>
Run the full test suite using the test
command.
npm run test
Always submit your Pull Request against main
.