fynjs API
    Preparing search index...

    Type Alias CheckNewVersionOptions

    type CheckNewVersionOptions = {
        checkInterval?: number;
        checkTag?: string;
        npmConfig?: NpmConfig;
        pkg: PkgInfo;
        saveMetaDir?: string;
        checkIsNewer?(
            pkg: PkgInfo,
            distTags: Record<string, string>,
            tag?: string,
        ): CheckResult;
        fetchDistTags?(
            url: string | URL,
            authToken: string,
            pkg?: PkgInfo,
        ): Promise<Record<string, string>>;
        fetchJSON?(url: string, options?: any): Promise<any>;
        notifyNewVersion?(data: any): void;
    }
    Index
    checkInterval?: number

    milliseconds to wait before checking again

    checkTag?: string
    npmConfig?: NpmConfig

    NPM config

    Only interested these keys:

    • 'registry' or '@scope/registry'
    • '//registry.url/:_authToken'

    Default to:

    {
    "registry": "https://registry.npmjs.org/"
    }
    pkg: PkgInfo

    package info

    saveMetaDir?: string

    directory to save meta data; default os.tmpdir()

    • check if dist tags has a version that's newer than pkg

      Parameters

      • pkg: PkgInfo
      • distTags: Record<string, string>
      • Optionaltag: string

      Returns CheckResult

    • fetch dist tags for package from url

      Parameters

      • url: string | URL
      • authToken: string
      • Optionalpkg: PkgInfo

      Returns Promise<Record<string, string>>

    • Alternate to fetchDistTags - provide a callback that will fetch JSON from given url

      Parameters

      • url: string
      • Optionaloptions: any

      Returns Promise<any>

    • call this if version new version detected

      Parameters

      • data: any

      Returns void