Share Brilliantly
server corner
(async function(){
const fl = await import('./file.mjs');
let data = await fl.read('c:/path.txt');
let stats = await fl.read('c:/path.txt');
await fl.append('c:/path.txt', 'new line');
await fl.remove('c:/path.txt');
// params - path, fullpath, recurse
//fullpath indicates whether the function should return full paths
//recurse indicates whether to recursively search all sub folders
let files = await fl.listDirectory('c:/directory/');
})();
(async function(){
const fl = import('./file.mjs');
let process = (line) => {
//do something with the line
}
await fl.readLines('C:/Testing/test/app.js', process)
})();
let data = fl.load('data.json');
(async function(){
const fl = import('./file.mjs');
let files = fl.listDirectory('c:/somefolder/');
})();
(async function(){
const fl = import('./file.mjs');
let files = fl.recurseDirectory('c:/somefolder/', true);
})();