mirror of
https://github.com/denoland/deno.git
synced 2024-12-22 15:24:46 -05:00
docs: fix broken Deno.write() example (#4190)
This commit is contained in:
parent
1f9d158bdc
commit
b84f3efa14
1 changed files with 2 additions and 2 deletions
|
@ -167,7 +167,7 @@ export async function read(rid: number, p: Uint8Array): Promise<number | EOF> {
|
|||
*
|
||||
* const encoder = new TextEncoder();
|
||||
* const data = encoder.encode("Hello world\n");
|
||||
* const file = Deno.openSync("/foo/bar.txt");
|
||||
* const file = Deno.openSync("/foo/bar.txt", {create: true, write: true});
|
||||
* Deno.writeSync(file.rid, data);
|
||||
*/
|
||||
export function writeSync(rid: number, p: Uint8Array): number {
|
||||
|
@ -188,7 +188,7 @@ export function writeSync(rid: number, p: Uint8Array): number {
|
|||
*
|
||||
* const encoder = new TextEncoder();
|
||||
* const data = encoder.encode("Hello world\n");
|
||||
* const file = await Deno.open("/foo/bar.txt");
|
||||
* const file = await Deno.open("/foo/bar.txt", {create: true, write: true});
|
||||
* await Deno.write(file.rid, data);
|
||||
*
|
||||
*/
|
||||
|
|
Loading…
Reference in a new issue