Skip to content

usePackageManager

jsxhook

Hook: returns commands for the detected package manager (stable across renders)

Installation

$ bunx termuijs add use-package-manager

Copies the source into src/components/use-package-manager/ and installs @termuijs/jsx.

Usage

ts
import { usePackageManager } from '@termuijs/jsx'
ts
const { value, set, reset } = usePackageManager({
  initial: undefined,
})

API Reference

usePackageManager

PropTypeDefaultDescription
initialT | undefinedInitial value
persistbooleanfalsePersist to storage
keystringStorage key
#hook#use-package-manager