open
function open(path, options?): Promise<File>;
Open a file and resolve to an instance of RsvimFs.File. The file does not need to previously exist if using the create or createNew open options.
The caller have to close the file to prevent resource leaking, see RsvimFs.File.close.
Parameters
| Parameter | Type | Description |
|---|---|---|
|
| File path. |
| (Optional) Open options, by default is |
Returns
It resolves to an instance of RsvimFs.File.
Throws
Throws TypeError if any parameters are invalid. Or throws Error if failed to open/create the file.
Example
const file = await Rsvim.fs.open("README.md");