Skip to content

bigbigDreamer/check-pkg-update

Repository files navigation

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