System

external interface System(source)

Properties

Link copied to clipboard
abstract external var args: ReadonlyArray<String>
Link copied to clipboard
abstract external val base64decode: (input: String) -> String?
Link copied to clipboard
abstract external val base64encode: (input: String) -> String?
Link copied to clipboard
abstract external val clearScreen: () -> Unit?
Link copied to clipboard
abstract external val clearTimeout: (timeoutId: Any?) -> Unit?
Link copied to clipboard
abstract external val createHash: (data: String) -> String?

A good implementation is node.js' crypto.createHash. (https://nodejs.org/api/crypto.html#crypto_crypto_createhash_algorithm)

Link copied to clipboard
abstract external val createSHA256Hash: (data: String) -> String?

This must be cryptographically secure. Only implement this method using crypto.createHash("sha256").

Link copied to clipboard
abstract external val deleteFile: (path: String) -> Unit?
Link copied to clipboard
abstract external val getFileSize: (path: String) -> Double?
Link copied to clipboard
abstract external val getMemoryUsage: () -> Double?
Link copied to clipboard
abstract external val getModifiedTime: (path: String) -> Date??
Link copied to clipboard
abstract external val getWidthOfTerminal: () -> Double?
Link copied to clipboard
abstract external var newLine: String
Link copied to clipboard
abstract external val realpath: (path: String) -> String?
Link copied to clipboard
abstract external val setModifiedTime: (path: String, time: Date) -> Unit?
Link copied to clipboard
abstract external val setTimeout: Function<Any?>?
Link copied to clipboard
abstract external var useCaseSensitiveFileNames: Boolean
Link copied to clipboard
abstract external val watchDirectory: (path: String, DirectoryWatcherCallback, recursive: Boolean?, options: WatchOptions?) -> FileWatcher?
Link copied to clipboard
abstract external val watchFile: (path: String, FileWatcherCallback, pollingInterval: Double?, options: WatchOptions?) -> FileWatcher?
Link copied to clipboard
abstract external val writeOutputIsTTY: () -> Boolean?

Functions

Link copied to clipboard
abstract external fun createDirectory(path: String)
Link copied to clipboard
abstract external fun directoryExists(path: String): Boolean
Link copied to clipboard
abstract external fun exit(exitCode: Double = definedExternally)
Link copied to clipboard
abstract external fun fileExists(path: String): Boolean
Link copied to clipboard
abstract external fun getCurrentDirectory(): String
Link copied to clipboard
abstract external fun getDirectories(path: String): ReadonlyArray<String>
Link copied to clipboard
abstract external fun getExecutingFilePath(): String
Link copied to clipboard
abstract external fun readDirectory(path: String, extensions: ReadonlyArray<String> = definedExternally, exclude: ReadonlyArray<String> = definedExternally, include: ReadonlyArray<String> = definedExternally, depth: Double = definedExternally): ReadonlyArray<String>
Link copied to clipboard
abstract external fun readFile(path: String, encoding: String = definedExternally): String?
Link copied to clipboard
abstract external fun resolvePath(path: String): String
Link copied to clipboard
abstract external fun write(s: String)
Link copied to clipboard
abstract external fun writeFile(path: String, data: String, writeByteOrderMark: Boolean = definedExternally)