##File Browser Go
Go binary and JS api of the file browser. It reads msgpack input from stdin and writes msgpack output to stdout.
Currently supports:
- ls -> List contents of a directory
- cp -> copy contents (within remote fs)
- mv -> move contents (within remote fs)
- rm -> remove file or directory (within remote fs)
- mkdir -> Create a directory on the remote fs
- getfile -> stream file from remote fs to local fs
- putfile -> stream file from local fs to remote fs
###Creating a browser object:
- FileBrowser(inStream, outStream);
eg.
let shell = child_process.spawn('file-browser-go', ...);
let browser = new FileBrowser(shell.stdin, shell.stdout);
###Basic usage
- ls -> list
var result = await browser.ls('path');
console.log(result.files);
- mv -> move
var result = await browser.mv('src', 'dest');
- cp -> copy
var result = await browser.cp('src', 'dest');
- rm -> remove
var result = await browser.rm('path');
- mkdir -> make directory
var result = await browser.mkdir('path');
getfile
and putfile
are generator functions.
For getfile
and putfile
check src/README.md .