mirror of
https://github.com/denoland/deno.git
synced 2024-11-25 15:29:32 -05:00
docs(cli/dts): make worker example pass (#10703)
This commit is contained in:
parent
7f94db1bfd
commit
3af44a26eb
1 changed files with 0 additions and 22 deletions
22
cli/dts/lib.deno.unstable.d.ts
vendored
22
cli/dts/lib.deno.unstable.d.ts
vendored
|
@ -1351,28 +1351,6 @@ declare interface WorkerOptions {
|
|||
* },
|
||||
* }
|
||||
* );
|
||||
* worker.postMessage({ cmd: "readFile", fileName: "./log.txt" });
|
||||
*
|
||||
* // deno_worker.ts
|
||||
*
|
||||
*
|
||||
* self.onmessage = async function (e) {
|
||||
* const { cmd, fileName } = e.data;
|
||||
* if (cmd !== "readFile") {
|
||||
* throw new Error("Invalid command");
|
||||
* }
|
||||
* const buf = await Deno.readFile(fileName);
|
||||
* const fileContents = new TextDecoder().decode(buf);
|
||||
* console.log(fileContents);
|
||||
* }
|
||||
*
|
||||
* // $ cat log.txt
|
||||
* // hello world
|
||||
* // hello world 2
|
||||
*
|
||||
* // $ deno run --allow-read mod.ts
|
||||
* // hello world
|
||||
* // hello world2
|
||||
* ```
|
||||
*/
|
||||
// TODO(Soremwar)
|
||||
|
|
Loading…
Reference in a new issue