Skip to content

Latest commit

 

History

History
51 lines (35 loc) · 1008 Bytes

README.md

File metadata and controls

51 lines (35 loc) · 1008 Bytes

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