
Security News
Crates.io Users Targeted by Phishing Emails
The Rust Security Response WG is warning of phishing emails from rustfoundation.dev targeting crates.io users.
cli-update-notifier
Advanced tools
Notify users of CLI updates
npm install cli-update-notifier
# or
yarn add cli-update-notifier
import notify from "cli-update-notifier";
await notify("react", "18.2.0");
package.json
import notify from "cli-update-notifier";
import pkg from "./package.json";
await notify(pkg.name, pkg.version);
notify(
name: string,
currentVersion: string,
title?: string = "Update Available",
titleAlignment?: "left" | "center" | "right",
padding?: number = 1,
borderColor?: string = "green",
): Promise<void>
Name | Type | Default | Description |
---|---|---|---|
name | string | — | (required) NPM package name. |
currentVersion | string | — | (required) Your version. |
title | string | "Update Available" | Box header. |
titleAlignment | "left" | "center" | "right" | "center" | Title text alignment. |
padding | number | 1 | Inner box padding. |
borderColor | string | "green" | Boxen border color. |
npm_config_user_agent
.latest
version using npm-metadata
.currentVersion
. If identical, does nothing.boxen
and chalk
.import notify from "cli-update-notifier";
import { name, version } from "./package.json";
await notify(name, version);
When an update is found, users see:
Package manager is auto‑detected:
npm
: npm i -g <name>
yarn
: yarn global add <name>
pnpm
: pnpm add -g <name>
bun
: bun add -g <name>
Contributions welcome! Please:
git checkout -b feature/...
)MIT License
FAQs
Notify users of CLI updates
We found that cli-update-notifier demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
The Rust Security Response WG is warning of phishing emails from rustfoundation.dev targeting crates.io users.
Product
Socket now lets you customize pull request alert headers, helping security teams share clear guidance right in PRs to speed reviews and reduce back-and-forth.
Product
Socket's Rust support is moving to Beta: all users can scan Cargo projects and generate SBOMs, including Cargo.toml-only crates, with Rust-aware supply chain checks.