setFileContent

setFileContent

Set the content of this code file. Creates a new version.

const updatedFile = await codeFile.setFileContent(
	`export default function MyComponent() {
	  return <div>Hello World</div>
	}`
)

Parameters

  • code: string – The new source code content.

Returns

  • Promise<CodeFile> – The updated CodeFile instance.