
Research
/Security News
9 Malicious NuGet Packages Deliver Time-Delayed Destructive Payloads
Socket researchers discovered nine malicious NuGet packages that use time-delayed payloads to crash applications and corrupt industrial control systems.
@twick/canvas
Advanced tools
A React-based canvas library built with Fabric.js for video and image manipulation.
A React-based canvas library built with Fabric.js for video and image manipulation.
This package provides a comprehensive canvas solution for video and image editing, built on top of Fabric.js with React integration. It offers advanced manipulation capabilities for creating professional video editing applications.
npm install @twick/canvas
# or
pnpm add @twick/canvas
import { useTwickCanvas } from '@twick/canvas';
import { useRef, useEffect } from 'react';
function CustomCanvas() {
const canvasRef = useRef<HTMLCanvasElement>(null);
const containerRef = useRef<HTMLDivElement>(null);
const { twickCanvas, buildCanvas, addElementToCanvas } = useTwickCanvas({
onCanvasReady: (canvas) => {
console.log("Canvas ready", canvas);
},
onCanvasOperation: (operation, data) => {
console.log("Canvas operation", operation, data);
}
});
useEffect(() => {
const container = containerRef.current;
const canvasSize = {
width: container?.clientWidth,
height: container?.clientHeight,
};
buildCanvas({
videoSize: {
width: 720,
height: 1280,
},
canvasSize,
canvasRef: canvasRef.current,
});
}, []);
return (
<div ref={containerRef}>
<canvas ref={canvasRef} />
</div>
);
}
// Add an image
const imageElement = {
type: "image",
id: "image-1",
frame: {
size: [400, 300],
},
props: {
src: "https://example.com/image.jpg",
}
};
addElementToCanvas({ element: imageElement, index: 0 });
// Add text
const textElement = {
type: "text",
id: "text-1",
props: {
x: 100,
y: 100,
text: "Hello World",
fontSize: 64,
fill: "#FFFFFF",
}
};
addElementToCanvas({ element: textElement, index: 1 });
useTwickCanvas: Custom hook for canvas manipulationcreateCanvas: Create a new Fabric.js canvas instancereorderElementsByZIndex: Reorder canvas elements by z-indexgetCurrentFrameEffect: Get current frame effectconvertToCanvasPosition: Convert video coordinates to canvas coordinatesconvertToVideoPosition: Convert canvas coordinates to video coordinatesCanvasProps: Canvas configuration propsCanvasMetadata: Canvas metadata interfaceFrameEffect: Frame effect interfaceCanvasElement: Canvas element interfaceCanvasElementProps: Canvas element props interfaceCaptionProps: Caption configuration propsFor complete API documentation, refer to the generated documentation.
This library requires a browser environment with support for:
The library will throw appropriate errors if used in an unsupported environment.
For complete documentation, refer to the project documentation site.
This package is licensed under the Sustainable Use License (SUL) Version 1.0.
For commercial licensing inquiries, contact: contact@kifferai.com
For full license terms, see the main LICENSE.md file in the project root.
FAQs
A React-based canvas library built with Fabric.js for video and image manipulation.
The npm package @twick/canvas receives a total of 112 weekly downloads. As such, @twick/canvas popularity was classified as not popular.
We found that @twick/canvas demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 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 discovered nine malicious NuGet packages that use time-delayed payloads to crash applications and corrupt industrial control systems.

Security News
Socket CTO Ahmad Nassri discusses why supply chain attacks now target developer machines and what AI means for the future of enterprise security.

Security News
Learn the essential steps every developer should take to stay secure on npm and reduce exposure to supply chain attacks.