createCodeFile

Beta
Beta

createCodeFile

createCodeFile

Create a new code file in the project.

const newFile = await framer.createCodeFile(
  "MyComponent",
  `export default function MyComponent() {
    return <div>Hello World</div>
  }`
);

Parameters

  • name: string — The name of the file to create

  • code: string — The initial content of the file

Returns

  • Promise<CodeFile> – The created CodeFile instance