Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
[![MIT License][license-image]][license-url] [license-image]: http://img.shields.io/badge/license-MIT-blue.svg?style=flat [license-url]: LICENSE
~ npm install cldoc -g
仓库必须包含以下两个目录:
- documents //存放文档
- common // 类目目录,可以自己新建文件夹
- README.md //目录的根页面,会被渲染为index.html,比如common/README.md,会生成common/index.html
- example.md // -> common/example.md.html
- example.ignore.md //注意:如果字符中包含了ignore,那么这个文件/文件夹将会再导航中被忽略
- README.md // -> index.html 生成最外层的根页面
- models // 存放数据模型和模板
- example.json
- comment.pug //使用了pug模板
~ cldoc <outputDir> #输出文件夹
\`\`\`config
{
"baseUrl": "//cdn.withme.cn/a/cldoc/0.2.7/",
//foundation.css, gruvbox-light.css, school-book.css
"styleName": "atelier-estuary-light.css"
}
\`\`\`
这段代码不会被渲染到文档中,但是它会成为一个数据到模板渲染的默认数据的
config
中
在最外层的documents/README.md
中的config
块中,会影响到布局模板的资源路径和样式名,比如上述配置会产生这样的结果:
<link rel="stylesheet" href="//cdn.withme.cn/a/cldoc/0.2.7/cldoc-atelier-estuary-light.css">
代码样式,使用了highlightjs
(highlightjs可用样式):
atelier-estuary-light.css
foundation.css
gruvbox-light.css
school-book.css
...
\`\`\`json
{
"example": "{{example.json}}"
}
\`\`\`
models/example.json
:
{
// sss
"x": "sss", //asdjf;jk;
"items": "xxxx"
}
渲染结果:
\`\`\`json
{
"example": {
// sss
"x": "sss", //asdjf;jk;
"items": "xxxx"
}
}
\`\`\`
\`\`\`tpl
example.pug
//第一行必须是文件名,后面是JSON数据
{
"name": "xxx"
}
//会有一部分默认数据
{
"title": "example", //ddd
"basename": "example",
"keywords": [],
"filename": "example.md.html",
"config": {}
}
\`\`\`
models/example.pug
:
.ex= title
渲染结果:
<div class="ex">example</div>
json-table.pug
的模板\`\`\`tpl
json-table.pug
[
//第一行是标题
{ "name":"名称", "optional":"是否可选", "type": "类型", "desc":"描述" },
{ "name":"是打发打发", "optional":1, "type": "string", "desc":"啊啊士大夫撒打发士大夫撒旦法撒旦法撒旦法师的法师打发士大夫撒旦法法师打发士大夫撒旦法法师打发士大夫撒旦法" },
{ "name":"yushan", "optional":1, "type": "string", "desc":"xxx" },
{ "name":"yushan", "optional":1, "type": "string", "desc":"xxx" },
{ "name":"yushan", "optional":1, "type": "string", "desc":"xxx" }
]
\`\`\`
default-models/json-table.pug
:
table
thead
tr
each key in keys
th= titleRow[key]
tbody
each row in rows
tr
each key in keys
td= row[key]
渲染结果:
工具中包含的默认模板有3个
- default-models/
- layout.pug //布局
- nav.pug //导航
- json-table.pug //json表格
FAQs
Example
The npm package cldoc receives a total of 4 weekly downloads. As such, cldoc popularity was classified as not popular.
We found that cldoc 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.
Research
Security News
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.