Keep your global NPM packages in sync between machines.
TL;DR While NVM and the likes let you keep packages in sync between multiple versions, if you develop across multiple machines, you can use this module to keep your global NPM packages in sync.
npm install -g npm-modules-sync
If you are using Yarn:
yarn global add npm-modules-sync
- On the machine you want to use as the source of your package list, run
npm-sync init -t <your-github-token>
- Note the ID of the gist returned from the previous step once it completes
- On the machine you want to sync using the the gist, run
npm-sync init -t <your-github-token> -i <gist-id>
- Run
npm-sync up
subsequently on your main machine to update the list of packages - Run
npm-sync dl
subsequently on your syned machines to download the current list of global packages
N.B Step 1 needs to be run only once on the machine that you want to use as your source of truth. Similarly, step 3 needs to be run only once on every machine you want to keep in sync.
Usage
$ npm-sync <input> [options]
Options
-t, --token Your GitHub token.
-i, --id ID of Gist that is used by this module.
-h, --help Show this help message.
-v, --version Show version information.
Examples
$ npm-sync init -t 123e4567f89
$ npm-sync i -t 123e4567f89
$ npm-sync init -t 123e4567f89 -i 123456789
$ npm-sync download
$ npm-sync dl
$ npm-sync upload
$ npm-sync up
Read the CONTRIBUTING guide for information.
Licensed under MIT. See LICENSE for more information.
Report a bug in issues.
Made with love by Riyadh Al Nur