Skip to main content

serializeInstructions()v3.3.40

Part of the @remotion/paths package.

Takes an array of Instruction's and serializes it into an SVG path string.

serialize-instructions.ts
import { serializeInstructions } from "@remotion/paths"; const newPath = serializeInstructions([ { type: "M", x: 10, y: 10, }, { type: "L", x: 20, y: 20, }, ]); // M 10 10 L 20 20

This function may throw if the instructions don't match the Instruction type, but it does not explicitly check for invalid input.

Compatibility​

BrowsersServersEnvironments
Chrome
Firefox
Safari
Node.js
Bun
Serverless Functions

See also​