add fs and notifications to stdlib

This commit is contained in:
grngxd 2025-06-17 12:49:23 +01:00
parent f858daff59
commit 20f413508f
7 changed files with 163 additions and 35 deletions

View file

@ -4,7 +4,8 @@
<button onclick="greet()">Greet</button>
<button onclick="file()">Read File</button>
<button onclick="directory()">List Directory</button>
<button onclick="notify()">Notify</button>
<script>
function greet() {
tiramisu.invoke("hello", "world")
@ -27,6 +28,14 @@
.then(files => alert("Files: " + files.join(", ")))
.catch(error => alert("Error listing directory: " + error.message));
}
function notify() {
const message = prompt("Enter the notification message:");
if (!message) return;
tiramisu.notifications.notify(message)
.then(() => alert("Notification sent!"))
.catch(error => alert("Error sending notification: " + error.message));
}
</script>
</body>
</html>