Skip to content

Latest commit

 

History

History
58 lines (48 loc) · 2.38 KB

README.md

File metadata and controls

58 lines (48 loc) · 2.38 KB

artus-cli/plugin-npmcheckupdate

A artus-cli plugin be used to display upgrade info

NPM version NPM quality NPM download Continuous Integration Test coverage Oss Insight Analytics

Install

$ npm i @artus-cli/plugin-npmcheckupdate 

Usage

// plugin.ts

export default {
  npmcheckupdate: {
    enable: true,
    package: '@artus-cli/plugin-npmcheckupdate',
  },
};

Configuration

export interface NpmCheckUpdateConfig {
  /** unpkg url, default is https://unpkg.com/ */
  unpkgUrl?: string;
  /** the file be used to cache last update info */
  cacheFile?: string;
  /** check inerval with local cache, default is 1 day */
  checkInterval?: string | number;
  /** upgrade policy, canbe major/minor/patch or dist-tags, default is latest */
  upgradePolicy?: 'major' | 'minor' | 'patch' | DistTag;
  /** whether enable CheckUpdateCommand, default is true */
  enableCommand?: boolean;
  /** whether enable intercept in all command? default is true */
  enableInterceptor?: boolean | ((cmd: typeof Command) => boolean);
  /** the position of upgrade info, default is after */
  upgradeInfoPrintPosition?: 'before' | 'after';
  /** customize your special upgrade info */
  upgradeInfoHooks?: {
    /** customize contents only */
    contents?: (upgradeInfo: UpgradeInfo, contents: string[]) => string | string[];
    /** customize all info */
    fullContents?: (upgradeInfo: UpgradeInfo, fullContents: string[]) => string | string[];
  };
}