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-pattern
Advanced tools
Draw and cache a repeated pattern on a canvas context.
npm install canvas-pattern
import canvasPattern from "canvas-pattern";
import createCanvasContext from "canvas-context";
const { canvas, context } = createCanvasContext("2d");
document.body.appendChild(canvas);
const pattern = new Image();
pattern.src = "pattern.png";
canvasPattern(context, pattern);
"repeat"
| "repeat-x"
| "repeat-y"
| "no-repeat"
Object
Options to draw. All optional.
CanvasPattern
⏏Draw and cache a repeated pattern on a canvas context.
Kind: Exported function
Param | Type | Default | Description |
---|---|---|---|
context | CanvasRenderingContext2D | The context to draw the pattern to | |
source | CanvasImageSource | The pattern to be drawn | |
[options] | CanvasPatternOptions | {} | The options to position the pattern and controls its repetition |
"repeat"
| "repeat-x"
| "repeat-y"
| "no-repeat"
Object
Options to draw. All optional.
Kind: global typedef Properties
Name | Type | Description |
---|---|---|
[pattern] | CanvasPattern | The CanvasPattern to draw. Created and returned by the function for reuse. |
[repetition] | CanvasPatternRepetition | A DOMString indicating how to repeat the pattern's image. |
[x] | number | |
[y] | number | |
[width] | number | |
[height] | number |
MIT. See license file.
FAQs
Draw and cache a repeated pattern on a canvas context.
The npm package canvas-pattern receives a total of 0 weekly downloads. As such, canvas-pattern popularity was classified as not popular.
We found that canvas-pattern demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 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
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.