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.
简化 Canvas 渲染逻辑为初心的轻量级插件。
Bate
阶段,需要不断完善,希望做最简单的轻量级的 Canvas 插件下载安装:
npm install --save i-painter
<!-- index.html -->
<script src="xx/xx/i-painter.js"></script>
<script>
let Pen = new Painter(el);
</script>
import Painter from "i-painter";
let Pen = new Painter(el);
Painter.drawImage(string || object);
属性 | 是否必填 | 作用 |
---|---|---|
url(string) | √ | 图片地址 |
- | - | - |
url | √ | 图片地址 |
x | × | x 轴坐标,默认值:0 |
y | × | y 轴坐标,默认值:0 |
w | × | 图片宽度,默认值:画布宽度 |
h | × | 图片高度,默认值:画布高度 |
Painter.drawText(string || object);
属性 | 是否必填 | 作用 |
---|---|---|
text(string) | √ | 文本 |
- | - | - |
text | √ | 文本 |
x | × | x 轴坐标,默认值:0 |
y | × | y 轴坐标,默认值:0 |
size | × | 字体大小:默认值:24 |
color | × | 字体颜色:默认值:#FFFFFF |
position | × | 字体定位,可选值:left | center | right 默认值:left |
hollow | × | 是否空心,默认值:false |
Painter.drawRect(object);
属性 | 是否必填 | 作用 |
---|---|---|
x | × | x 轴坐标,默认值:0 |
y | × | y 轴坐标,默认值:0 |
w | × | 宽度,默认值:100 |
h | × | 高度,默认值:100 |
color | × | 颜色:可传 string | array, 默认值:#FFFFFF |
radius | × | 圆角:默认值:0 |
hollow | × | 是否空心,默认值:false |
Painter.drawRound(object);
属性 | 是否必填 | 作用 |
---|---|---|
x | × | x 轴坐标,默认值:0 |
y | × | y 轴坐标,默认值:0 |
r | × | 半径,默认值:10 |
border | × | 边框,默认值:10 |
color | × | 颜色:可传 string, 默认值:#FFFFFF |
hollow | × | 是否空心,默认值:false |
Painter.getDataURL();
Painter.toDownload(filename);
属性 | 是否必填 | 作用 |
---|---|---|
filename | × | 下载图片名,默认值:i-painter |
Painter.toElementImage();
FAQs
> 简化 Canvas 渲染逻辑为初心的轻量级插件。
The npm package i-painter receives a total of 0 weekly downloads. As such, i-painter popularity was classified as not popular.
We found that i-painter 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.