diff --git a/src/tiny/io.ts b/src/tiny/io.ts index aafa10c..636e80e 100644 --- a/src/tiny/io.ts +++ b/src/tiny/io.ts @@ -81,6 +81,15 @@ export class DirAccess { } } + static remove_file_or_error(path: string) { + switch (get_runtime()) { + case JavaScriptRuntime.NodeJS: + return NodeJSDirAccess.remove_file_or_error(path); + default: + return false; + } + } + static make_dir(p_dir: string, recursive: boolean = false) { switch (get_runtime()) { case JavaScriptRuntime.NodeJS: @@ -166,4 +175,8 @@ export class NodeJSDirAccess extends DirAccess { static make_dir(p_dir: string, recursive: boolean = false) { fs.mkdirSync(p_dir, {recursive: true}); } + + static remove_file_or_error(path: string) { + fs.unlinkSync(path); + } } \ No newline at end of file