1.2.3 • Published 1 year ago

@montagejs/check-pkg-update v1.2.3

Weekly downloads
-
License
MIT
Repository
-
Last release
1 year ago

check-pkg-update

XO code style

Background

Some open-source cli tool maybe need auto check that whether it need update the latest version when exec some commands.

Install

# recommend
pnpm i @montagejs/check-pkg-update

# or you can use npm / yarn
# npm i @montagejs/check-pkg-update

Usage

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

API

checkNeedUpdate

export declare function checkNeedUpdate(pkgName: string, currentVersion: string): Promise<boolean>;

Related

LICENSE

MIT