Files
dotfiles/.config/television/cable/pkgs-npm.toml
2026-03-25 16:31:17 +01:00

29 lines
853 B
TOML
Raw Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
[metadata]
name = "pkgs-npm"
description = "List globally installed npm packages"
requirements = ["npm"]
[source]
command = [
"npm outdated -g --depth=0 --json | njs -p '$.stdin.json()' 'Object.entries' 'e=> e.map(([p,i])=> `${p} @${i.current} → ${i.wanted} (${i.latest})`).join(\"\\n\")'",
"npm list -g --depth=0 --json | njs -p '$.stdin.json().dependencies' 'Object.entries' 'e=> e.map(([p,i])=> p).join(\"\\n\")'",
]
output = "{split: :0}"
[preview]
command = "npm info '{split: :0}' 2>/dev/null | head -30"
[keybindings]
ctrl-u = "actions:update"
ctrl-d = "actions:uninstall"
[actions.uninstall]
description = "Uninstall the selected global package"
command = "npm uninstall -g '{split: :0}'"
mode = "execute"
[actions.update]
description = "Update the selected global package"
command = "npm update -g '{split: :0}'"
mode = "execute"