Web File System - Local files driver
File system abstraction with access management.
API provides common file operations for some folder on local drive. Any operations outside of the folder will be blocked. Also, it possible to configure a custom policy for read/write operations.
Can be used as backend for Webix File Manager https://webix.com/filemanager
API
Get data
const wfs = ;const fs = "/temp/folder"; //get files in a folderlet files = await fs; //get files in a folder and subfolders as plain listlet files = await fs; //get files in a folder and subfolders as nested structurelet files = await fs; //get folder onlylet files = await fs; //get files that match a masklet files = await fs; //ignore some fileslet files = await fs; //get info about a single filelet info = await fs; //check if file existslet check = await fs;
Modify files
//make folderawait fs; //removeawait fs; //copyawait fs; //moveawait fs; //readlet stream = await fs; //writeawait fs
Access Policy
// ForceRoot policy is added automatically // readonlyconst wfs = ;const fs = "/temp/folder" ; // customconst fs = "/temp/folder" { if op == wfsOperationRead return true; // write to temp folder only if file === 0 return true; return false; };
Other API
//loggingconst wfs = ;const fs = "/temp/folder" null verbose: true ;
License
MIT