v0.1A scripting language for the web
Standard Library

fs

Read and write files, list directories, and inspect paths on disk.

Import:

import "fs";

Reading

string text = read_file("notes.txt");
print(text);

Writing

write_file replaces a file; append_file adds to the end.

write_file("notes.txt", "A new note.");
append_file("log.txt", "another line\n");

Inspecting

file_exists(path)1 if the path exists, 0 otherwise.
file_size(path)Size of the file in bytes.
is_dir(path)1 if path points to a directory.

Directories

mkdir("new-folder");
array entries = list_dir(".");
entries | length | print;

Renaming and deleting

rename_file("old.txt", "new.txt");
delete_file("new.txt");