File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -7,6 +7,16 @@ Deno web interface to Rclone, using WebAssembly build.
77``` ts
88import { Rclone } from " https://raw.githubusercontent.com/sntran/denolcr/main/rclone.ts" ;
99
10+ const rclone = new Rclone ();
11+ rclone .rc (" core/version" );
12+ ```
13+
14+ By default, the provided ` rclone.wasm ` [ rclone.wasm] module is used. This can be
15+ changed by providing another compiled module in the constructor. For example:
16+
17+ ``` ts
18+ import { Rclone } from " https://raw.githubusercontent.com/sntran/denolcr/main/rclone.ts" ;
19+
1020const module = await WebAssembly .compileStreaming (fetch (" https://sntran.github.io/denolcr/rclone.wasm" ));
1121const rclone = new Rclone (module );
1222
Original file line number Diff line number Diff line change 11import "https://raw.githubusercontent.com/rclone/rclone/master/fs/rc/js/wasm_exec.js" ;
22
3+ // Provides a default WASM module.
4+ const wasm = await WebAssembly . compileStreaming (
5+ fetch ( new URL ( "./rclone.wasm" , import . meta. url ) )
6+ ) ;
7+
38// A Rclone instance from a compiled WebAssemble module.
49export class Rclone extends WebAssembly . Instance {
5- constructor ( module : WebAssembly . Module ) {
10+ constructor ( module : WebAssembly . Module = wasm ) {
611 // Patches for rclone.
712 // @ts -ignore
813 globalThis . document ??= { } ;
You can’t perform that action at this time.
0 commit comments