yah

'You Already Have' package manager for node.js

yah - "You Already Have" package manager for node.js

$ 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.

@TODO: finish the 'how it works' section

__You just have to execute yah__:

$ yah

You'll be asked for a workspace directory, like dev or workspace (the directory where you put your node projects). If you leave it blank, only the default directory where yah put the globally installed modules will be looked up. 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. I choose not to use an in-memory database because it would be overkill. The program just needs to look for a small list and a single file works just fine.

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.

Example:

$ yah search express
YAH Results
express@4.13.0 | mean.js | /home/user/dev/meanjs
express@4.13.0 | my new project | /home/user/dev/newproject
express@3.1.666 | my old project | /home/user/dev/oldproject

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_installed_packages.json file.

Example:

$ yah install express@4.13.0
Copying express@4.13.0 from mean.js project
Saving to your package.json
Done!

You can list all the packages by typing yah list all. Probably a GIANT OUTPUT will be shown. You can (and I recommend) write it to a file, if you want.

Example:

$ yah list all
express@4.13.0 | mean.js | /home/user/dev/meanjs
express@4.13.0 | my new project | /home/user/dev/newproject
express@3.1.666 | my old project | /home/user/dev/oldproject
grunt@0.4.5 | i am grunt | /home/user/dev/iamgrunt
mocha@2.2.5 | wow much test | /home/user/dev/stabledoge
q@1.4.1 | ive made a promise | /home/user/dev/mypromise
shelljs@0.5.1 | my new project | /home/user/dev/newproject
should@7.0.1 | should i stay | /home/user/dev/shouldigo
[and the list goes on]

Writing output to file (or "don't mess with my terminal")

$ yah list all >> ~/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.

MIT