deno.land / x / casualdb@v0.1.4 / writeWorker.ts

writeWorker.ts
View Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
import { writeJson } from "https://deno.land/std@0.68.0/fs/write_json.ts";
self.onmessage = async (e) => { const { file, data, taskId } = e.data; console.debug(`[casualdb:worker:debug] write task: ${taskId}`);
try { await writeJson(file, data); self.postMessage({ taskId, error: false }); } catch (error) { self.postMessage({ taskId, error: error.valueOf() }); } finally { self.close(); }};
casualdb
Simple JSON "database" for Deno with type-safety! ⚡️
DocumentationDocumentation
GitHub Repositorycampvanilla/casualdb
GitHub Stars
29

Version Info

Tagged at
a year ago

External Dependencies

1 external dependency