code: function writeText(wasmModule, format, output, callback) {
    if (format === "linear" || format === "stack") {
      if (!assemblyscript.util.wabt) {
        process.stderr.write("\nwabt.js not found\n");
        return callback(EFAILURE);
      }
      var binary = wasmModule.ascCurrentBinary || (wasmModule.ascCurrentBinary = wasmModule.emitBinary()); // reuse
      output.write(assemblyscript.util.wasmToWast(binary, { readDebugNames: true }), "utf8", end);
    } else
      output.write(wasmModule.emitText(), "utf8", end);
  
    function end(err) {
      if (err || output === process.stdout) return callback(err);
      output.end(callback);
    }
  }
docs: Writes text format of the specified module, using the specified format.