Run JavaScript
jsc
jsc// hello.js
console.log("Hello, world!")jsc hello.jsHello, world!// Read a file at `filePath` and returns it contents (with UTF-8).
jsc.readFile(filePath: string): string
// Read a file at `filePath` and returns it contents encoded with Base64.
jsc.readFileBase64(filePath: string): string
// Write a string to a file (with UTF-8).
jsc.writeFile(filePath: string, content: string): Result
// Write a string encoded with Base64 to a file (with UTF-8).
jsc.writeFileBase64(filePath: string, content: string): Result
// Return a list of files at `filderPath`.
jsc.listFiles(folderPath: string): string[]
// See if there's a file at the path and it's not a folder.
jsc.isFile(filePath: string): boolean
// See if there's a folder at the path and it's not a file.
jsc.isDirectory(folderPath: string): boolean
// `mkdir`.
jsc.makeFolder(folderPath: string): Result
// `rm` or `del`.
jsc.deleteFile(filePath: string): Result
// `mv` from `pathA` to `pathB`.
jsc.move(pathA: string, pathB: string): Result
// `cp` from `pathA` to `pathB`.
jsc.copy(pathA: string, pathB: string): Result
// Run a system command and get its return value (0 for example).
jsc.system(command: string): Resultinternalbrowser
internalbrowserLast updated