file-browser-go

command module
v0.0.0-...-74fc336 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 13, 2018 License: MPL-2.0 Imports: 2 Imported by: 0

README

##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

  1. ls -> list
var result = await browser.ls('path');
console.log(result.files);
  1. mv -> move
var result = await browser.mv('src', 'dest');
  1. cp -> copy
var result = await browser.cp('src', 'dest');
  1. rm -> remove
var result = await browser.rm('path');
  1. mkdir -> make directory
var result = await browser.mkdir('path');

getfile and putfile are generator functions.
For getfile and putfile check src/README.md .

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL