asdfasdf-vm

Default packages for all versions in asdf


On all versions of node I use pm2, yarn, and a few others, and on PHP, I use xdebug, LDAP, and others is there a hook or file where I can define all the packages for the plugin to be installed when I install a new version of nodejs or PHP?

I would like to run asdf install nodejs 12.0.4 for example and it tries to run something like npm install -g yarn pm2 for me. Even if there's a hook file or anything that I can use, that would be amazing.

Thanks in advance.


Solution

  • You can setup default npm packages.

    asdf-nodejs can automatically install a set of default set of npm package right after installing a Node.js version. To enable this feature, provide a $HOME/.default-npm-packages file that lists one package per line, for example:

    lodash
    request
    express
    

    You can specify a non-default location of this file by setting a ASDF_NPM_DEFAULT_PACKAGES_FILE variable.

    Source: https://github.com/asdf-vm/asdf-nodejs#default-npm-packages