Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
A universal, simple, and beautiful hand-drawn style painting tool, USB-Paint. It can be introduced and used in any front-end framework or page.
English | 简体中文
A universal (Universal), simple (Simple), and beautiful (Beautiful) Hand-drawn style painting tool component—USB-Paint. You can think of it as a plug-and-play drawing panel tool, like the ubiquitous USB interface, which can be quickly integrated into any frontend project (native HTML, Vue, React, Svelte, Angular).
npm install usb-paint
or
yarn add usb-paint
import USBPaint from "usb-paint";
new USBPaint({
target: document.querySelector("#root"),
});
<script src="usbdraw.js" type="text/javascript"></script>
<script>
let a = new USBPaint({
target: document.querySelector("#root"),
});
</script>
import USBPaint from "usb-paint";
new USBPaint({
target: document.querySelector("#root"),
lineOptions: {
lineWidth: 8,
lineColor: "red",
lineAlpha: 1,
lineSmooth: 1,
lineThin: 0.6,
lineStream: 1,
lineStart: 0,
lineEnd: 80,
},
showTools: true,
toolsConfig: {
tools: "all", // ["eraser", "paint", "trash", "export" ],
position: {
x: 400,
y: 400,
direction: "column", // column row
},
iconsConfig: {
size: 20,
width: 0.5,
color: "red",
fill: "black",
},
backgroud: {
color: "blue",
border: "1px solid red",
radius: 10,
},
},
background: "black",
});
Parameter | Required | Type | Default | Description |
---|---|---|---|---|
target | No | HTMLElement | body element | Target container, can be a DOM element or CSS selector |
lineOptions | No | LineOptionsType | (Details below) | Configuration for brush line |
showTools | No | boolean | false | Show toolbar or not |
toolsConfig | No | ToolsConfigType | (Details below) | Toolbar configuration when showTools is true |
background | No | string | - | Transparent by default; accepts Hex/RGB/HSL/HSB/color names (e.g., red) |
Parameter | Required | Type | Default | Description |
---|---|---|---|---|
lineWidth | No | number | 4 | Brush line width |
lineColor | No | string | #000 | Brush line color; accepts Hex/RGB/HSL/HSB/color names |
lineAlpha | No | number | 1 | Brush line opacity |
lineSmooth | No | number | 1 | Softness of the brush line edges |
lineThin | No | number | 0.6 | Brush pressure's effect on stroke size |
lineStream | No | number | 1 | Degree of stroke simplification |
lineStart | No | number | 0–100 | Tapering at the start of the line |
lineEnd | No | number | 0–100 | Tapering options at the end of the line |
Parameter | Required | Type | Default | Description |
---|---|---|---|---|
tools | No | string/ array | all | Toolbar tools; accepts any combination of ["eraser", "paint", "trash", "export"]; "[]" hides toolbar, "all" shows all |
position | No | string/AxisType | top | Toolbar position; accepts "left"/"right"/"top"/"bottom" or AxisType position data (detailed below) |
iconsConfig | No | object | - | Icon configuration for the toolbar |
backgroud | No | object | - | Background configuration for the toolbar |
Parameter | Required | Type | Default | Description |
---|---|---|---|---|
x | Yes | number | - | Horizontal coordinate (px) |
y | Yes | number | - | Vertical coordinate (px) |
direction | Yes | string | - | Arrangement direction: row/column |
Parameter | Required | Type | Default | Description |
---|---|---|---|---|
size | No | number | 20 | Icon size (px) |
width | No | number | 1.25 | Icon line width |
color | No | string | #000 | Icon line color; accepts Hex/RGB/HSL/HSB/color names |
fill | No | string | none | Icon fill color; accepts Hex/RGB/HSL/HSB/color names, "none" for no fill by default |
Parameter | Required | Type | Default | Description |
---|---|---|---|---|
color | No | string | #fff | Background color; accepts Hex/RGB/HSL/HSB/color names |
border | No | string | 1px solid rgba(0,0,0,0.1) | Border (CSS format) |
radius | No | number | 10 | Border radius |
Event Name | Description | Return Data |
---|---|---|
exportToImage | Export image data | base64 |
eraserTool | Eraser | - |
freeDrawTool | Drawing | - |
clearTool | Clear | - |
import USBPaint from "usb-paint";
const usbPaint = new USBPaint();
// Trigger image export
usbPaint.exportToImage();
// Activate eraser tool
usbPaint.eraserTool();
// Activate drawing tool
usbPaint.freeDrawTool();
// Clear the canvas
usbPaint.clearTool();
FAQs
A universal, simple, and beautiful hand-drawn style painting tool, USB-Paint. It can be introduced and used in any front-end framework or page.
The npm package usb-paint receives a total of 119 weekly downloads. As such, usb-paint popularity was classified as not popular.
We found that usb-paint demonstrated a healthy version release cadence and project activity because the last version was released less than 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’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.