mirror of
https://github.com/Next-Flip/Momentum-Firmware.git
synced 2026-04-25 03:29:58 -07:00
JS: Add basic storage module API
This commit is contained in:
23
applications/system/js_app/examples/apps/Scripts/storage.js
Normal file
23
applications/system/js_app/examples/apps/Scripts/storage.js
Normal 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();
|
||||
Reference in New Issue
Block a user