
Research
/Security News
Toptal’s GitHub Organization Hijacked: 10 Malicious Packages Published
Threat actors hijacked Toptal’s GitHub org, publishing npm packages with malicious payloads that steal tokens and attempt to wipe victim systems.
@yhtml5/check-list
Advanced tools
## 概念 check list 是一个自动化检测工具, 补充了 eslint/单元测试 等工具之外的功能. 确保代码的质量, 它可以集成到自动化部署脚本中, 也可以配合husky, 实现代码提交前检测
check list 是一个自动化检测工具, 补充了 eslint/单元测试 等工具之外的功能. 确保代码的质量, 它可以集成到自动化部署脚本中, 也可以配合husky, 实现代码提交前检测
在一个多人协作过程的项目中, 我们会遇到许多问题
import _ from lodash
<<<<<<<
Date.now, [].includes
config => rule => ruleHandler
npm run check => check() => rule: handler[type] => handler: title/regex/require/limit => lib: checkCode/getDirSize/checkRequiredFiles => ask => console result
在项目根目录下增加config.js
$ npm i @yhtml5/check-list -g $ check ./demo/config.js
@yhtml5/check-list 提供 JavaScript 接口那样可以通过 Node.js 来使用。
$ npm i @yhtml5/check-list -D
const check = require('@yhtml5/check-list')
check(config)
配置文件是一个commonjs模块,它对外暴露一个对象,这个对象包含了一些 @yhtml5/check-list 需要的一些选项。通常,我们把这个配置文件叫做config.js,它通常位于项目的根目录
参考 @yhtml5/check-list/demo/config.js
config.checkList.rules 是一个规则数组
不检查, 输出 describe, 用作分割线
{
type: 'title',
describe: 'Check List Rules:',
}
检查关键性文件是否丢失
{
type: 'require',
describe: '检查文件完整性: 关键性文件',
paths: [__dirname]
}
检查文件大小限制
{
type: 'limit',
describe: '检查文件大小限制: dist',
paths: [__dirname],
min: 10,
max: 100
}
正则匹配文件内容, 返回 buffer, 需要考虑 [空格, 多行, 注释] 等情况
type: 'regex',
describe: '检查是否存在: 冲突代码',
paths: [__dirname],
regex: /^<<<<<|^>>>>>/gm,
FAQs
## 概念 check list 是一个自动化检测工具, 补充了 eslint/单元测试 等工具之外的功能. 确保代码的质量, 它可以集成到自动化部署脚本中, 也可以配合husky, 实现代码提交前检测
We found that @yhtml5/check-list demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 open source maintainers 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.
Research
/Security News
Threat actors hijacked Toptal’s GitHub org, publishing npm packages with malicious payloads that steal tokens and attempt to wipe victim systems.
Research
/Security News
Socket researchers investigate 4 malicious npm and PyPI packages with 56,000+ downloads that install surveillance malware.
Security News
The ongoing npm phishing campaign escalates as attackers hijack the popular 'is' package, embedding malware in multiple versions.