
Security News
/Research
Popular node-ipc npm Package Infected with Credential Stealer
Socket detected malicious node-ipc versions with obfuscated stealer/backdoor behavior in a developing npm supply chain attack.
@hanfy/plugin-fontsize
Advanced tools
字体大小插件
$ yarn add @hanfy/plugin-fontsize
添加到引擎
import Engine, { EngineInterface } from '@hanfy/engine';
import Fontsize from '@hanfy/plugin-fontsize';
new Engine(...,{ plugins:[Fontsize] })
支持过滤不符合自定义的字体大小
/**
* @param fontSize 当前字体大小
* @returns 返回 string 修改当前值,false 移除,true 保留
* */
filter?: (fontSize: string) => string | boolean
//配置
new Engine(...,{
config:{
[Fontsize.pluginName]: {
//配置粘贴后需要过滤的字体大小
filter: (fontSize: string) => {
return ["12px","13px","14px","15px","16px","19px","22px","24px","29px","32px","40px","48px"].indexOf(fontSize) > -1
}
}
}
}
defaultSize?:string //默认为14px
默认无快捷键
//快捷键,key 组合键,args,执行参数,[size,defaultSize?] , size 必须,defaultSize 可选
hotkey?:{key:string,args:Array<string>};//默认无
//使用配置
new Engine(...,{
config:{
"fontsize":{
//修改快捷键
hotkey:{
key:"mod+b",
args:["12px","14px"]
}
}
}
})
//size:更改的字体大小,defaultSize:保持的默认字体大小,在没有传入 defaultSize 或者 size 与 defaultSize 值不同时执行前景色修改
engine.command.execute('fontsize', size, defaultSize);
//使用 command 执行查询当前状态,返回 Array<string> | undefined,当前光标所在处字体大小值集合
engine.command.queryState('fontsize');
FAQs
The npm package @hanfy/plugin-fontsize receives a total of 7 weekly downloads. As such, @hanfy/plugin-fontsize popularity was classified as not popular.
We found that @hanfy/plugin-fontsize 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
/Research
Socket detected malicious node-ipc versions with obfuscated stealer/backdoor behavior in a developing npm supply chain attack.

Security News
TeamPCP and BreachForums are promoting a Shai-Hulud supply chain attack contest with a $1,000 prize for the biggest package compromise.

Security News
Packagist urges PHP projects to update Composer after a GitHub token format change exposed some GitHub Actions tokens in CI logs.