$ npm install -g yah
Searches for packages installed throughout the system so you don't have to download them again. It's developed to solve the "I have no internet connection so I can't download my packages" problem.
You'll be asked for a workspace directory, like
workspace (the directory where you put your node projects). If you leave it blank, only the default directory where npm put the globally installed modules will be searched. Then, the program will start searching for
node_modules directories and
package.json files to build up a list with the found modules.
Once the search is finished, the list will be stored in a file called
yah_installed_packages.json in your home directory.
Once you have the package list, run
yah search <package> and a list with the details of each copy of the package will be displayed.
$ yah search expressYAH results for express (3 found)email@example.com | /firstname.lastname@example.org | /email@example.com | /home/user/dev/oldproject
You can search for various packages in the same query.
$ yah search express mongooseYAH results for express (3 found)firstname.lastname@example.org | /email@example.com | /firstname.lastname@example.org | /home/user/dev/oldprojectYAH results for mongoose (5 found)email@example.com | /firstname.lastname@example.org | /email@example.com | /home/user/dev/realproject
Since the important part of the listing is the package's version, you can run
yah install <package>@<version> and the package with the targeted version will be copyed from the first project listed in the
$ yah install firstname.lastname@example.orgCopying email@example.com from mean.js projectSaving to your package.jsonDone!
You can list all the packages by typing
yah list. Probably a GIANT OUTPUT will be shown. You can (and I recommend) write it to a file, if you want.
$ yah firstname.lastname@example.org | /email@example.com | /firstname.lastname@example.org | /email@example.com | /firstname.lastname@example.org | /email@example.com | /firstname.lastname@example.org | /email@example.com | /home/user/dev/shouldigo[and the list goes on]
Writing output to file (or "don't mess with my terminal")
$ yah list >> ~/organized_npd_list_all.txt
Important: don't concat it to yah_installed_packages.json or else your list probably will be doomed and you'll end up having to make another one.