1
0
mirror of https://github.com/jbranchaud/til synced 2026-01-03 07:08:01 +00:00

Add Interactively Browse Available Node Versions as a unix til

This commit is contained in:
jbranchaud
2020-06-27 12:33:41 -05:00
parent b71cfcdde8
commit 560b924c27
2 changed files with 28 additions and 1 deletions

View File

@@ -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)

View File

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