Easily upgrade your dependencies inside Emacs for your NPM/YARN projects (other package managers are planned). Something similar to VSCode’s Version Lens plugin.
;; Using straight:
(use-package upver :straight (:host github :repo "isamert/upver.el"))
;; Using quelpa:
(use-package upver :quelpa (upver :fetcher github :repo "isamert/upver.el"))
- Do
M-x upver
. You’ll get possible updates right next/below to your dependencies. - Use
upver-wanted
orupver-latest
to update current dependency, or use one ofupver-all-wanted
,upver-all-latest
to upgrade all of the dependencies. - Use
upver-next
andupver-prev
to navigate between upgradable dependencies. - Do
upver-finish
to finalize the process. This just closes theupver-mode
, nothing special.
You can not edit the buffer manually while upver is active. Just use
upver-wanted
or upver-latest
to upgrade packages and when you are
done, do upver-finish
to return back to normal editing.
Please note that upver
does not upgrade packages. It simply updates
the version info definition in the dependency file. You still need to
run your installation command (i.e. yarn
, npm i
etc.) after.
When you do M-x upver
, you’ll see a helpful text at the echo area that
summarizes which keys you can press. Basically you can use the
following keys:
Key | Function | Description |
---|---|---|
# | upver-wanted | Upgrade current dependency to the wanted value. |
^ | upver-latest | Upgrade current dependency to the latest value. |
n | upver-next | Go to next upgradable dependency. |
p | upver-prev | Go to previous upgradable dependency. |
These keys belong to the upver-dependency-map
and only activated when
you are on an upgradable dependency.
Also you do M-x upver
, upver-mode
is activated. It’s a minor mode that
provides some useful but more verbose bindings. Do M-x describe-keymap upver-mode-map
to list all actions in it’s keymap or take a look at this:
Key | Function | Description |
---|---|---|
C-c # | upver-wanted | Upgrade current dependency to the wanted value. |
C-c ^ | upver-latest | Upgrade current dependency to the latest value. |
C-c C-n | upver-next | Go to next upgradable dependency. |
C-c C-p | upver-prev | Go to previous upgradable dependency. |
C-c C-# | upver-all-wanted | Upgrade all dependencies to their wanted value. |
C-c C-^ | upver-all-latest | Upgrade all dependencies to their latest value. |
C-c C-c | upver-finish | Finish the upver session. |
Check out all configuration options by doing M-x customize-group upver RET
. Important options are:
upver-auto-next
- Whether to jump to next upgradable dependency
after acting on current one. Enabled by default but you can disable
it by setting it to
nil
. upver-placement
- Place to display upver versions relative to the
dependency. It can be either
below
orright
. By default they are shown below.