##FSGOD (Alpha)
A service for securely managing, transfering, collaborating, and hosting content on your local network
The only component thus far (v 1.0.3) is the Virtual Directory Tree (VDT).
The purpose of this library is to make dynamic managing of any size of file system easy and quick.
##API Example
const fsgod = require('fsgod');
// fsgod.VDT and fsgod.VirtualDirectoryTree are aliases of the same function.
fsgod.VDT('./', (vdt) => {
var myDirectory = vdt;
for ( var i = 0; i < myDirectory.content.length; i++ ){
console.log(myDirectory.content[i].name);
}
});
The above code should log the names of all the items in the directory it's currently in
##More Info
Function | Arguments | Usage |
---|
VDT or VirtualDirectoryTree | url: the path to the directory you'd like to operate, done: to be called when VDT is done getting the directory | fsgod.VDT(urlToFolder, function(vdt){ }) |
The vdt
object that gets passed to the callback in fsgod.VDT
is the Virtual Directory Tree. fsgod.VDT
recursively walks through a specified folder and builds each item into a JavaScript object and passes it back to the user in the callback. For the meantime (v1.0.3), fsgod.VDT
can only be used to read data. If you'd like to help, email me at maui.wowie@tuta.io.
VDT object keys | Usage | Type |
---|
content | The content of the item, if it's a directory it will be an array of other items. If it's a file it will be it's file content | Array or String |
name | The name of the file or directory | String |
type | Will let you know if its a directory or file | String |
fullPath | The full path to the item | String |