Security News
Node.js EOL Versions CVE Dubbed the "Worst CVE of the Year" by Security Experts
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
m-fe-cli-utils
Advanced tools
FE-CLI 以及相关的插件需要用到的 utils 方法及常量
$ npm install m-fe-cli-utils --save
举个栗子:
import { WORKSPACE, getInfo } from 'm-fe-cli-utils';
getInfo().then(userInfo => {
console.log('>> Your name: ', userInfo.name);
});
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 | |
FNPM_REGISTRY_URL | fnpm registry 地址 | string | 'http://registry.npm.cfuture.cc' |
FNPM_WEB_URL | fnpm 地址 | string | 'http://npm.cfuture.cc' |
checkUpdate(registry: string, current: string): Promise<false | string>
检查是否需要更新,如果有新版本,则返回版本号
needUpdate(registry: string, current: string): Promise<boolean>
是否有新版本,以及是否需要升级(控制台二次确认)
getInfo(): Promise<UserConfig>
获取用户信息,如果没果,则会调用设置
setInfo(isUpdate = false)
设置用户信息, isUpdate 表示强制更新
getWorkspaceConfig(): Promise<WorkspaceConfig>
获取当前工程目录的配置,包含 git 相关信息interface WorkspaceConfig extends Record<string, any> {
/** 配置类型,一般是 builder */
type: string;
/** 项目构建插件名 (fnpm 包名) */
builder: string;
/** 项目相关信息 */
projectInfo?: {
group: string;
project: string;
version: string;
gitBranch: string;
remote: string;
};
}
createHelperInfo(options)
创建 helper 字符串FAQs
FE Cli 工具方法集
We found that m-fe-cli-utils demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
Security News
cURL and Go security teams are publicly rejecting CVSS as flawed for assessing vulnerabilities and are calling for more accurate, context-aware approaches.
Security News
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.