bun.lock 文件的项目中运行命令:
terminal
过滤选项
--audit-level=<low|moderate|high|critical> - 只显示该严重等级及以上的漏洞:
terminal
--prod - 只审计生产依赖(排除 devDependencies):
terminal
--ignore <CVE> - 忽略指定的 CVE(可多次使用):
terminal
--json
使用 --json 参数打印来自注册表的原始 JSON 响应,而非格式化报告:
terminal
退出码
如果未发现漏洞,bun audit 会以代码 0 退出;如果报告中存在任何漏洞,则以代码 1 退出。即使使用了 --json 参数,此行为依然有效。