findChildren
Searches the immediate children of this node (i.e. all page nodes, not including their children). Returns all pages for which callback returns true.
Supported on:
Signature
findChildren(callback?: (node: PageNode) => boolean): Array<PageNode>
Parameters
callback
A function that evaluates whether to return the provided node. If this argument is omitted, findChildren returns node.children.
Remarks
Example: find pages matching a certain name scheme
const templates = figma.root.findChildren(n => n.name.includes("template"))