getCodeFile

getCodeFile

Get a specific code file by its ID or file path.

// Look up by ID
const codeFile = await framer.getCodeFile("codeFile/AbcD_23")

// Look up by file path
const codeFile = await framer.getCodeFile("Button.tsx")

Parameters

  • idOrPath: string – The unique identifier (e.g. "codeFile/AbcD_23") or file path (e.g. "Button.tsx" or "overrides/withAnalytics.tsx") of the code file.

Returns

  • Promise<CodeFile | null> – The CodeFile instance or null if not found.