FileManager.createNewFile method
FileManager › createNewFile
Unofficial
Create a new file in the vault at specified location.Signature:
createNewFile(location?: TFolder, filename?: string, extension?: string, contents?: string): Promise<TFile>Parameters:
| Parameter | Type | Description |
|---|---|---|
| location? | TFolder | Location to create the file in, defaults to root. |
| filename? | string | Name of the file to create, defaults to 'Untitled' (incremented if file already exists). |
| extension? | string | Extension of the file to create, defaults to 'md'. |
| contents? | string | Contents of the file to create, defaults to empty string. |
Returns: Promise<TFile> — A promise that resolves to the newly created file.