k-cli-utils
TypeScript icon, indicating that this package has built-in type declarations

0.1.6 • Public • Published

k-cli-utils

K-CLI 以及相关的插件需要用到的 utils 方法及常量

Getting Started

  • $ npm install k-cli-utils --save

API

consts 静态常量

name desc type value
WORKSPACE 当前的执行目录,即 process.cwd() string
CONFIG_PATH 全局配置根目录 ~/.feconfig string
PLUGIN_PATH 全局插件根目录 ~/.feconfig/lib/node_modules string
USER_PROFILE 用户信息配置文件 ~/.feconfig/profile.json string
NPM_REGISTRY_URL npm registry 地址 string 'https://registry.npmjs.org'

version 版本号相关方法

  1. checkUpdate(registry: string, current: string): Promise<false | string> 检查是否需要更新,如果有新版本,则返回版本号

  2. needUpdate(registry: string, current: string): Promise<boolean> 是否有新版本,以及是否需要升级(控制台二次确认)

userinfo 用户信息相关方法

  1. getInfo(): Promise<UserConfig> 获取用户信息,如果没果,则会调用设置

  2. setInfo(isUpdate = false) 设置用户信息, isUpdate 表示强制更新

Package Sidebar

Install

npm i k-cli-utils

Weekly Downloads

12

Version

0.1.6

License

BSD-3-Clause

Unpacked Size

26.4 kB

Total Files

23

Last publish

Collaborators

  • kinghoo