Skip to content
duxt

Package managers

One command, one tab per package manager, remembered across pages.

One command shown for every package manager the site offers, with the reader's choice remembered for the whole site.

Usage

Write the command without the manager — add -D pkg, run build, dlx create-nuxt. Each manager's own spelling is substituted.

pnpm add -D @kirchdev/duxt

Verbs

Writtenpnpmnpmyarnbun
addaddinstalladdadd
installinstallinstallinstallinstall
removeremoveuninstallremoveremove
runrunrunrunrun
execexecexecexecexec
createcreatecreatecreatecreate
dlxpnpm dlxnpxyarn dlxbunx
updateupdateupdateupupdate
outdatedoutdatedoutdatedoutdated
auditauditauditnpm auditaudit
linklinklinklinklink
whywhywhywhywhy
patchpatchpatchpatch

yarn means Berry (≥ 2). Berry has no outdated and no global install, and npm has no patch in any spelling — a dash above means that manager gets no tab for that command rather than a near-equivalent doing a different job. The build warns which page asked.

A -g or --global anywhere in the command is a global install, which drops the yarn tab for the same reason.

i, rm, un, uninstall, up and upgrade are accepted as written and folded onto the row that holds them. A verb not in the table is printed as written for every manager, and the build says so — the table is always behind some manager's newest subcommand, and refusing an unknown word would be worse than showing it.

API

Props

PropTypeDefaultNotes
commandstringrequiredWithout the manager — add -D pkg
managersDuxtPackageManager[]duxt.packageManagersOverrides the site's list for one block

Notes

The choice is a cookie, not browser storage, and deliberately: storage is read after hydration, so the block would render one manager and then swap to another in front of the reader. It is first-party, identifies nobody and carries a value the reader picked — see usePackageManager().

A block may list fewer managers than the reader's choice covers; it falls back to its own first tab rather than showing nothing.

Was this page helpful?