JS: Add basic storage module API

This commit is contained in:
Willy-JL
2024-02-22 03:12:59 +00:00
parent 02c62beae9
commit e2ab71e1d3
3 changed files with 262 additions and 0 deletions

View File

@@ -0,0 +1,23 @@
let storage = require("storage");
let path = "/ext/storage.test";
print("File exists:", storage.exists(path));
print("Writing...");
storage.write(path, "Hello World!");
print("File exists:", storage.exists(path));
print("Reading...");
let data = storage.read(path);
print(data);
print("Removing...")
storage.remove(path);
print("Done")
// There's also:
// storage.virtualInit(path);
// storage.virtualMount();
// storage.virtualQuit();