<!-- Do not edit this file. It is automatically generated by API Documenter. --> [`Vault`](Vault) ## Vault class Work with files and folders stored inside a vault. **Signature:** ```typescript export class Vault extends Events ``` **Extends:** [`Events`](Events) ## Properties | Property | Modifiers | Type | Description | | --- | --- | --- | --- | | [`adapter`](Vault/adapter) | | [`DataAdapter`](DataAdapter) | | | [`configDir`](Vault/configDir) | | <code>string</code> | Gets the path to the config folder. This value is typically <code>.obsidian</code> but it could be different. | ## Methods | Method | Modifiers | Description | | --- | --- | --- | | [`append(file, data, options)`](Vault/append) | | Add text to the end of a plaintext file inside the vault. | | [`cachedRead(file)`](Vault/cachedRead) | | Read the content of a plaintext file stored inside the vault Use this if you only want to display the content to the user. If you want to modify the file content afterward use [Vault.read()](Vault/read) | | [`copy(file, newPath)`](Vault/copy) | | Create a copy of the selected file. | | [`create(path, data, options)`](Vault/create) | | Create a new plaintext file inside the vault. | | [`createBinary(path, data, options)`](Vault/createBinary) | | Create a new binary file inside the vault. | | [`createFolder(path)`](Vault/createFolder) | | Create a new folder inside the vault. | | [`delete(file, force)`](Vault/delete) | | Deletes the file completely. | | [`getAbstractFileByPath(path)`](Vault/getAbstractFileByPath) | | Get a file or folder inside the vault at the given path. To check if the return type is a file, use <code>instanceof TFile</code>. To check if it is a folder, use <code>instanceof TFolder</code>. | | [`getAllLoadedFiles()`](Vault/getAllLoadedFiles) | | Get all files and folders in the vault. | | [`getFileByPath(path)`](Vault/getFileByPath) | | Get a file inside the vault at the given path. Returns <code>null</code> if the file does not exist. | | [`getFiles()`](Vault/getFiles) | | Get all files in the vault. | | [`getFolderByPath(path)`](Vault/getFolderByPath) | | Get a folder inside the vault at the given path. Returns <code>null</code> if the folder does not exist. | | [`getMarkdownFiles()`](Vault/getMarkdownFiles) | | Get all markdown files in the vault. | | [`getName()`](Vault/getName) | | Gets the name of the vault. | | [`getResourcePath(file)`](Vault/getResourcePath) | | Returns an URI for the browser engine to use, for example to embed an image. | | [`getRoot()`](Vault/getRoot) | | Get the root folder of the current vault. | | [`modify(file, data, options)`](Vault/modify) | | Modify the contents of a plaintext file. | | [`modifyBinary(file, data, options)`](Vault/modifyBinary) | | Modify the contents of a binary file. | | [`off(name, callback)`](Events/off) | | <p>(Inherited from [Events](Events)<!-- -->)</p> | | [`offref(ref)`](Events/offref) | | <p>(Inherited from [Events](Events)<!-- -->)</p> | | [`on(name: 'create', callback, ctx)`](Vault/on('create').md) | | Called when a file is created. This is also called when the vault is first loaded for each existing file If you do not wish to receive create events on vault load, register your event handler inside [Workspace.onLayoutReady()](Workspace/onLayoutReady)<!-- -->. | | [`on(name: 'modify', callback, ctx)`](Vault/on('modify').md) | | Called when a file is modified. | | [`on(name: 'delete', callback, ctx)`](Vault/on('delete').md) | | Called when a file is deleted. | | [`on(name: 'rename', callback, ctx)`](Vault/on('rename').md) | | Called when a file is renamed. | | [`process(file, fn, options)`](Vault/process) | | Atomically read, modify, and save the contents of a note. | | [`read(file)`](Vault/read) | | Read a plaintext file that is stored inside the vault, directly from disk. Use this if you intend to modify the file content afterwards. Use [Vault.cachedRead()](Vault/cachedRead) otherwise for better performance. | | [`readBinary(file)`](Vault/readBinary) | | Read the content of a binary file stored inside the vault. | | [`recurseChildren(root, cb)`](Vault/recurseChildren) | <code>static</code> | | | [`rename(file, newPath)`](Vault/rename) | | Rename or move a file. | | [`trash(file, system)`](Vault/trash) | | Tries to move to system trash. If that isn't successful/allowed, use local trash | | [`trigger(name, data)`](Events/trigger) | | <p>(Inherited from [Events](Events)<!-- -->)</p> | | [`tryTrigger(evt, args)`](Events/tryTrigger) | | <p>(Inherited from [Events](Events)<!-- -->)</p> |