Package Exports
- rclone.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (rclone.js) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
Rclone.js
The JavaScript API to the "Swiss army knife of cloud storage" rclone.
Besides providing a way to install rclone on different platforms, a CLI and a JavaScript API are included.
Installation
npm install rclone.jsAfter installation, the latest binary of rclone is also fetched based on
your system environment.
Usage
Node.js
Except update (which is used to update rclone binary), all API functions
return a child process whose events we can listen to.
const rclone = require("rclone.js");
const ls = rclone.ls("source:");
ls.stdout.on("data", (data) => {
console.log(data.toString());
});
ls.stderr.on("data", (data) => {
console.error(data.toString());
});CLI
This simple CLI calls the JS API above and outputs stdout and stderr.
$ npx rclone --version
rclone v1.54.0
- os/arch: darwin/amd64
- go version: go1.15.7$ npx rclone ls source:
-1 2020-12-12 10:01:44 -1 Documents
-1 2020-12-11 16:24:20 -1 Pictures