@bobfrankston/bobup
v0.1.11
Published
List and update globally-installed @bobfrankston/* npm packages
Maintainers
Readme
@bobfrankston/bobup
List and update all globally-installed @bobfrankston/* npm packages.
Cross-platform — runs on Windows, Linux, and macOS. The CLI uses npm to do all work, and the library spawns npm.cmd on Windows / npm elsewhere automatically.
Requirements
- Node.js ≥ 22 (uses
node:util.styleText) npmavailable inPATH- Permission to install globally (on Linux/macOS that may mean a user-level npm prefix or
sudo, depending on how npm was set up)
Install
npm install -g @bobfrankston/bobupCLI
bobup Show usage
bobup list List packages that need updating (outdated only)
bobup list all List every installed package (alias: bobup listall, bobup list -all)
bobup list -csv Comma-separated names (script-friendly; combine with `all`)
bobup list -json JSON array of package descriptors (combine with `all`)
bobup update all Update every outdated package
bobup update <selectors...> Update by index, range, comma-list, or namebobup with no arguments prints usage. bobup list is concise — only the outdated packages — so the indexes you see are exactly what update will operate on. Pass all (or -all / --all / use listall) to see everything.
Colored output is produced through @bobfrankston/themecolors, which adapts color choices to the detected terminal background — no light-on-light or dark-on-dark surprises.
Script-friendly output
bobup list -csv # @bobfrankston/foo,@bobfrankston/bar
bobup list all -csv # every installed name, comma-separated
bobup list -json # JSON array of {name, short, installed, latest, status, problems}
bobup list all -json # same, for every installed package-csv and -json are mutually exclusive. Both suppress the human-readable formatting and the broken-package advisory so output stays parseable.
Selectors
Mix and match — all are space-separated; commas are within a single selector.
| Form | Meaning |
|-------------|-----------------------------------------------------------------|
| N | 1-based index against the most recent bobup list (outdated) |
| N-M | Inclusive range (against the outdated list) |
| N,M,... | Comma list (against the outdated list) |
| name | Short or full package name (resolved against ALL installed, so you can force-reinstall a current or broken package by name) |
| all | Every outdated package — broken packages are skipped, see below |
Examples
bobup # show usage
bobup list # show only outdated
bobup list all # show everything (or: bobup listall)
bobup update 1 # update outdated item 1
bobup update 1-4 # update outdated items 1 through 4
bobup update 1,3-5 # update outdated 1, 3, 4, 5
bobup update logit npmlatest # update by name (works even if current)
bobup update 1,3-5,logit # any combination
bobup update all # update every outdated packageEach update runs npm install -g @bobfrankston/<name> and the npm output streams to your terminal so you see the install progress.
Broken installs
If npm list -g can't determine a package's installed version, bobup labels it Broken and shows a diagnostic line under the row (missing directory, missing/unreadable package.json, missing bin shim, etc.).
bobup update all and numeric/range selectors skip broken packages — npm install -g rarely recovers a broken global install on its own, and silently re-running it can leave more debris. Bobup prints the recommended uninstall/reinstall recipe at the end of the run so you can repair them by hand:
npm uninstall -g @bobfrankston/<name> && npm install -g @bobfrankston/<name>If you still want to force bobup to attempt an install on a broken package, pass it by name (e.g. bobup update brother-print).
Library API
bobup is also a normal library — useful when another tool wants to drive update logic itself.
import {
listInstalled,
getLatestVersions,
parseSelectors,
updatePackages,
listAsJson,
Package,
PackageJson,
UpdateResult
} from "@bobfrankston/bobup";
// Discover installed @bobfrankston packages
const pkgs = listInstalled();
// Fill in the .latest field via `npm outdated -g`
getLatestVersions(pkgs);
// JSON-friendly view (with computed status: "current" | "outdated" | "broken")
const json: PackageJson[] = listAsJson(pkgs);
console.log(JSON.stringify(json, null, 2));
// Resolve user input ("all", "1-3", names, etc.) against the list
const targets = parseSelectors(["1-3", "logit"], pkgs);
// Run the updates (sequential — npm global prefix is shared state)
const results: UpdateResult[] = await updatePackages(targets, {
inherit: false, // capture instead of stream
logmsg: (m) => console.log(m) // optional logger
});
for (const r of results)
console.log(r.package.name, r.success ? "OK" : r.error);API summary
listInstalled(): Package[]— globally-installed@bobfrankston/*packages, sorted. EachPackageincludes aproblems: string[]array that is non-empty when npm couldn't determine the installed version (filesystem-level diagnosis is performed automatically for broken installs).getLatestVersions(pkgs): Package[]— fillslatestfromnpm outdated -g. Mutates and returns input.listAsJson(pkgs): PackageJson[]— pure transform that returns JSON-friendly descriptors with a computedstatusfield ("current" | "outdated" | "broken"). RungetLatestVersionsfirst if you want the status to reflect outdated state.parseSelectors(selectors, pkgs): Package[]— resolves["1-3", "all", "name", ...]against the list. Throws on bad selectors.updatePackage(pkg, opts?): Promise<UpdateResult>— single update.updatePackages(pkgs, opts?): Promise<UpdateResult[]>— sequential batch.
UpdateOptions:
inherit?: boolean— iftrue, npm streams stdio directly to the parent (defaultfalse, captured).logmsg?: (msg: string) => void— optional logger; library never writes to console on its own.
Notes
- Discovery uses
npm list -g --depth=0 --json. - Latest-version lookup uses
npm outdated -g --json(a single call, not one-per-package). - Updates run sequentially because the npm global prefix isn't safe for concurrent installs.
