
Security News
vlt Launches "reproduce": A New Tool Challenging the Limits of Package Provenance
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
canvas-extras
Advanced tools
Adds extra handy bits to canvas, including Progress Bars, rounded rectangles, and stadiums.
canvas-extras adds extra handy bits to canvas, including Progress Bars, rounded rectangles, and stadiums.
npm i canvas-extras
To use canvas-extras, you must already:
ctx.progressBar(currentProgress, maxProgress, x, y, width, height, barFillColor, emptyFillColor)
For the progress bar to work correctly, do not use any code that changes the bar's appearance (e.g. fill() or stroke()) as it will cause the bar to appear incorrectly.
ctx.beginPath();
ctx.progressBar(5, 10, 50, 50, 200, 100, 'orange');
ctx.endPath();
This will yield this result:
![Image of progress bar.] (https://rollbot.net/images/progress1.png)
ctx.roundRect(x,y, width, height, roundness)
ctx.beginPath();
ctx.fillStyle = '#aaaaaa';
ctx.roundRect(50,50, 100, 100, 25);
ctx.fill();
ctx.closePath();
This will yield this result:
![Image of rounded square.] (https://rollbot.net/images/square.png)
Stadiums are also known as capsule shapes or pill shapes
ctx.stadium(x,y, width, height)
ctx.beginPath();
ctx.fillStyle = '#aaaaaa';
ctx.stadium(50,50, 500, 100);
ctx.fill();
ctx.closePath();
This will yield this result:
![Image of stadium.] (https://rollbot.net/images/stadium.png)
I'd really appreciate it if you gave a bit of credit to me if you use my package!
Thanks!
FAQs
Adds extra handy bits to canvas, including Progress Bars, rounded rectangles, and stadiums.
We found that canvas-extras 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.
Security News
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
Research
Security News
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
Research
The Socket Research Team discovered a malicious npm package, '@ton-wallet/create', stealing cryptocurrency wallet keys from developers and users in the TON ecosystem.