Skip to main content
Version: Next

exit

function exit(exitCode?): void;

Exit editor.

tip

To ensure file system data safety, editor will wait for all the ongoing file write operations to complete before actually exiting, however any new write requests will be rejected.

Parameters​

ParameterTypeDescription

exitCode?

number

(Optional) The editor process exit with this exit code, by default with code 0.

Returns​

void

Throws​

Throws TypeError if exitCode is neither an integer nor undefined.

Example​

// Exit with default exit code `0`.
Rsvim.rt.exit();

// Exit with error exit code `-1`.
Rsvim.rt.exit(-1);