Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
captain-ui
Advanced tools
npm i -S captain-ui
// .babelrc or babel-loader option
{
"plugins": [
["import", { "libraryName": "captain-ui", "style": true }]
]
}
接着你可以直接引入 captain-ui 组件,等价于下方的按需引入组件
// 模块化地引入 js 和 css, 通过 babel-plugin-import 插件解析
import { Pay } from 'captain-ui';
每个组件都有自己对应的npm包,可以直接单独引入对应的包
import { Pay } from 'captain-pay';
css 文件引入需要 postcss-easy-import 类似插件解析引入的css文件路径
@import 'captain-pay';
// 没有插件的情况下,可以用以下方式直接引入
// @import 'captain-pay/lib/index.css';
yarn install
localhost 127.0.0.1
make dev
在浏览器中打开 http://localhost:3003/ 即可
以创建组件 OrderPay 为例
使用make init 创建组件
make init order-pay
在 docs/doc.config.js
中增加对应的文档配置
在 docs/examples-docs
目录下增加对应组件的文档,默认会直接引入 index.md
文档进行编译
与index.md同级目录下的 config.js
定义mock的请求数据,格式如下:
module.exports = [{
// 发起请求的链接
url: '/v2/pay/UnifiedCashier/getQrcode.json',
// 发起请求的请求方式
method: 'POST',
// 请求的返回数据内容
response: {
code: 0,
msg: '处理成功',
data: {
content: 'aHR0cHM6Ly93d3cuaGFvMTIzLmNvbS8=',
imageFormat: 'png',
codeFormat: 'QR_CODE',
encoding: 'BASE64',
width: 300,
height: 300
}
}
}, {
url: '/v2/pay/UnifiedCashier/payStatus.json',
method: 'POST',
response: {
code: 0,
msg: '处理成功',
data: {
status: 'success'
}
}
}];
FAQs
有赞vue wap业务组件库
The npm package captain-ui receives a total of 36 weekly downloads. As such, captain-ui popularity was classified as not popular.
We found that captain-ui demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 12 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.
Security News
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.