
Security News
Package Maintainers Call for Improvements to GitHub’s New npm Security Plan
Maintainers back GitHub’s npm security overhaul but raise concerns about CI/CD workflows, enterprise support, and token management.
@domain.js/cia
Advanced tools
npm i @domain.js/cia --save
专属配置名称 cia
名称 | 类型 | 必填 | 默认值 | 描述 | 样例 |
---|---|---|---|---|---|
concurrency | int | No | 10 | task exec concurrency | 10 |
storeKey | string | No | cia-store | redis storage hash key | cia-store |
模块名 | 别名 | 用到的方法 | 描述 |
---|---|---|---|
_ | None | isFunction, map | lodash |
async | None | eachSeries, queue | npm i async |
logger | None | info, error | domain.js/logger |
utils | U | tryCatchLog | utils functions |
redis | None | hset, hdel, hgetall | domain.js/redis |
regist
注册消息到系统,提前注册的好处是可以预知有那些消息,都需要什么样的订阅者
eventName
string 必填 消息名称validator
function 可选 消息数据验证函数types
[Object]
type
string 必填 订阅者类型名称timeout
integer 可选 订阅函数执行的超时限定, 单位毫秒,超时也不会中断,只是会触发一次超时函数的执行validator
function 可选,订阅函数返回值验证函数,校验失败直接抛出异常cia.regist('eventName', submitValidatorFunction, [
{
type: 'cleanCache', // 必填 订阅的名称
timeout: 1000, // 可选
}
]);
link
连接cia系统,通过waiter来接收对应的消息
eventName
string 必填 消息名称type
string 必填 接待者类型,要和 regist types里的type匹配waiter
function 必填 订阅函数cia.link('eventName', 'cleanCache', waiter);
submit
提交函数,当有消息产生的时候通过改函数提交上去
eventName
string 必填 消息名称data
any 必填 消息体数据setFn
设置超时函数和执行订阅错误接收函数, 不设置的时候默认是 logger.info 和 logger.error
type
string 必填 函数类型,timeout
或 error
function
function 必填 设置的函数checkReady
检测系统是否已准备好,返回 ture
或 false
isExiting
获取系统是否正在退出中,返回 true
或 false
isExited
获取系统是否已退出,返回 true
或 false
getUnlinks
获取未被 link 的消息任务, 排查问题的时候需要用到
FAQs
domain.js center 消息任务通用模块
We found that @domain.js/cia 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
Maintainers back GitHub’s npm security overhaul but raise concerns about CI/CD workflows, enterprise support, and token management.
Product
Socket Firewall is a free tool that blocks malicious packages at install time, giving developers proactive protection against rising supply chain attacks.
Research
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.