MCPcopy Index your code
hub / github.com/scriptscat/scriptcat / onload

Function onload

example/cat_file_storage.js:16–41  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

14 baseDir: "test-dir",
15 data: new Blob(["Hello World"]),
16 onload() {
17 CAT_fileStorage("list", {
18 baseDir: "test-dir",
19 onload(list) {
20 console.log(list);
21 list.forEach(value => {
22 if (value.name === "test.txt") {
23 CAT_fileStorage("download", {
24 file: value,
25 baseDir: "test-dir",
26 async onload(data) {
27 console.log(await data.text());
28 CAT_fileStorage("delete", {
29 path: value.name,
30 baseDir: "test-dir",
31 onload() {
32 console.log('ok');
33 }
34 });
35 }
36 });
37 }
38 });
39 }
40 })
41 }, onerror(err) {
42 console.log(err);
43 switch (err.code) {
44 case 1:

Callers

nothing calls this directly

Calls 3

logMethod · 0.80
forEachMethod · 0.80
textMethod · 0.45

Tested by

no test coverage detected