check-cli-update
TypeScript icon, indicating that this package has built-in type declarations

1.0.2 • Public • Published

check-cli-update

npm version npm downloads

for CLI developer, you can add this function to remind user to update the command in time.

Install

npm i check-cli-update

Usage

import { checkUpdate } from "check-cli-update"
checkUpdate({
  cwd: "your cli folder location",
})

take @homy/gito-core for example, if the version you use is 0.0.1,you will see a message like

The latest version of @homy/gito-core is 1.0.0 and you have 0.0.1. Update it now: npm i -g @homy/gito-core

also you can custom the tips by customTips callback and cwd by cwd option

import { checkUpdate } from "check-cli-update"
checkUpdate({
  customTips({
      latestVersion: string
      curVersion: string
      pkgName: string
    }) {},

  cwd:'xxx'
})

Readme

Keywords

none

Package Sidebar

Install

npm i check-cli-update

Weekly Downloads

0

Version

1.0.2

License

MIT

Unpacked Size

9.34 kB

Total Files

7

Last publish

Collaborators

  • homy