diff --git a/README.md b/README.md index 0e30f56..8889e60 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ and pairing with smart people at Hashrocket. For a steady stream of TILs, [sign up for my newsletter](https://tinyletter.com/jbranchaud). -_927 TILs and counting..._ +_928 TILs and counting..._ --- @@ -851,6 +851,7 @@ _927 TILs and counting..._ - [Grep For Files With Multiple Matches](unix/grep-for-files-with-multiple-matches.md) - [Grep For Multiple Patterns](unix/grep-for-multiple-patterns.md) - [Hexdump A Compiled File](unix/hexdump-a-compiled-file.md) +- [Interactively Browse Available Node Versions](unix/interactively-browse-availabile-node-versions.md) - [Jump To The Ends Of Your Shell History](unix/jump-to-the-ends-of-your-shell-history.md) - [Kill Everything Running On A Certain Port](unix/kill-everything-running-on-a-certain-port.md) - [Killing A Frozen SSH Session](unix/killing-a-frozen-ssh-session.md) diff --git a/unix/interactively-browse-availabile-node-versions.md b/unix/interactively-browse-availabile-node-versions.md new file mode 100644 index 0000000..e7275d2 --- /dev/null +++ b/unix/interactively-browse-availabile-node-versions.md @@ -0,0 +1,26 @@ +# Interactively Browse Available Node Versions + +There are a variety of ways to install and manage your version(s) of Node. My +tool of choice is [`asdf`](https://github.com/asdf-vm/asdf). + +Once I have the [Node.js asdf plugin](https://github.com/asdf-vm/asdf-nodejs) +installed, I can view the versions of Node that are available to install. + +```bash +$ asdf list-all nodejs +``` + +This is a massive list. Normally my next step would be to `grep` against the +output. We can take it a step further by making the results interactively +browsable with [`FZF`](https://github.com/junegunn/fzf). + +```bash +$ asdf list-all nodejs | fzf +``` + +I can type into the FZF prompt which will fuzzily narrow down the results. I +can even add a splash of regex to anchor agains the major version. + +For instance, `10` will show `10.x.x` as well as pre-1.0 results that contain +`10`. If, however, I prompt FZF with `^10`, then the `10` is anchored to the +front of the string which is the major version -- so `10.x.x` results.