Skip to main content

serializeInstructions()

Part of the @remotion/paths package. Available from v3.3.40

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.

See also