writeTextFile method

Future<void> writeTextFile(
  1. Object path,
  2. Object data, [
  3. WriteFileOptions? options
])

Write string data to the given path, by default creating a new file if needed, else overwriting.

await Deno.writeTextFile("hello1.txt", "Hello world\n");  // overwrite "hello1.txt" or create it

Requires allow-write permission, and allow-read if options.create is false.

Implementation

_i2.Future<void> writeTextFile(
  _i2.Object path,
  _i2.Object data, [
  _i4.WriteFileOptions? options,
]) =>
    _i3.promiseToFuture(_i3.callMethod(
      this,
      'writeTextFile',
      [
        path,
        data,
        options ?? _i6.undefined,
      ],
    ));