Background
Some open-source
cli tool
maybe need auto check that whether it need update the latest version whenexec
some commands.
# recommend
pnpm i @montagejs/check-pkg-update
# or you can use npm / yarn
# npm i @montagejs/check-pkg-update
import { checkNeedUpdate } from '@montagejs/check-pkg-update'
checkNeedUpdate('create-react-app', '1.0.0')
.then(res => {
console.log(res, "pkg need update");
})
shell output
# true need update
checkNeedUpdate
export declare function checkNeedUpdate(pkgName: string, currentVersion: string): Promise<boolean>;