method Deno.Permissions.prototype.querySync
Permissions.prototype.querySync(desc: PermissionDescriptor): PermissionStatus
Returns the current status of a permission.
Note, if the permission is already granted, request()
will not prompt
the user again, therefore querySync()
is only necessary if you are going
to react differently existing permissions without wanting to modify them
or prompt the user to modify them.
const status = Deno.permissions.querySync({ name: "read", path: "/etc" });
console.log(status.state);
desc: PermissionDescriptor