
Company News
/Security News
Socket Selected for OpenAI's Cybersecurity Grant Program
Socket is an initial recipient of OpenAI's Cybersecurity Grant Program, which commits $10M in API credits to defenders securing open source software.
u5.js is a minimalist and lightweight canvas animation library. Its API is essentially a stripped down version of the popular p5.js library which focuses on 2D canvas animation.
I have been using and loving p5.js since 2014, it is all over my website ucodia.space, including the home page. Though the p5.js library was never built to be tree-shakeable and is now over 800KB, which is very large if all you need is to animate simple primitives.
There is an exisiting issue in the p5.js GitHub repository, though it seems the way the library is built makes it impossible to enable tree-shaking while remaining backward compatible.
As such I have decided to give a try at building a library with the same API which focuses only on 2D canvas animation.
frameCountdeltaTimeframeRate()windowWidthwindowHeightwindowResized()widthheightbackground()clear()fill()noFill()noStroke()stroke()circle()ellipse()line()rect()square()triangle()strokeWeight()HALF_PIPIQUARTER_PITAUTWO_PIsetup()draw()remove()noLoop()loop()u5()createCanvas()resizeCanvas()rotate()translate()scale()mouseXmouseYpmouseXpmouseYmouseIsPressedmouseMoved()mousePressed()mouseReleased()doubleClicked()map()constrain()Here is an equivalent to p5.js setup and draw example.
const example = (sketch) => {
let y = 100;
sketch.setup = function () {
sketch.createCanvas(720, 400);
sketch.stroke("white");
sketch.frameRate(30);
};
sketch.draw = function () {
sketch.background("black");
y = y - 1;
if (y < 0) {
y = sketch.height;
}
sketch.line(0, y, sketch.width, y);
};
};
new u5(example, document.getElementById("container"));
FAQs
u5.js is a minimalist and lightweight canvas animation library
We found that u5js 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.

Company News
/Security News
Socket is an initial recipient of OpenAI's Cybersecurity Grant Program, which commits $10M in API credits to defenders securing open source software.

Security News
Socket CEO Feross Aboukhadijeh joins 10 Minutes or Less, a podcast by Ali Rohde, to discuss the recent surge in open source supply chain attacks.

Research
/Security News
Campaign of 108 extensions harvests identities, steals sessions, and adds backdoors to browsers, all tied to the same C2 infrastructure.