Before using anything in this namespace, make sure to import LensStudio:FileSystem and add filesystem in your plugin's module.json.
LensStudio:FileSystem
filesystem
module.json
// module.json{ "main": "main.js", "permissions": ["filesystem"]} Copy
// module.json{ "main": "main.js", "permissions": ["filesystem"]}
// main.jsimport * as fs from 'LensStudio:FileSystem';let s = fs.readFile(new Editor.Path(import.meta.resolve('ellipsis.txt'))); Copy
// main.jsimport * as fs from 'LensStudio:FileSystem';let s = fs.readFile(new Editor.Path(import.meta.resolve('ellipsis.txt')));
Before using anything in this namespace, make sure to import
LensStudio:FileSystem
and addfilesystem
in your plugin'smodule.json
.Example