1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-12-22 23:34:47 -05:00

docs: fix broken Deno.write() example (#4190)

This commit is contained in:
Chris Knight 2020-02-29 19:37:32 +00:00 committed by GitHub
parent 1f9d158bdc
commit b84f3efa14
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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);
*
*/