Skip to content

Release 1.0.0

Choose a tag to compare

@tenedev tenedev released this 10 Jul 15:36
· 15 commits to main since this release

Release - v1.0.0

Notify users of CLI updates

New Features

  • Detects popular package managers (npm, yarn, pnpm, bun) via npm_config_user_agent
  • Fetches the latest version of a CLI from npm using npm‑metadata
  • Compares with the current version and logs nothing if up-to-date
  • Displays a styled update box in terminal using:
    • boxen for framing
    • chalk for colorized output

API

notify(
  name: string,
  currentVersion: string,
  title?: string = "Update Available",
  titleAlignment?: "left" | "center" | "right",
  padding?: number = 1,
  borderColor?: string = "green",
): Promise<void>

Usage Examples

import notify from "cli-update-notifier";

await notify("react", "18.2.0");
// or
import pkg from "./package.json";
await notify(pkg.name, pkg.version);

Why Use This?

  • Lightweight and fast
  • Compatible with all major package managers
  • Stylish, clear CLI update prompts
  • Silent when no updates are available