Skip to main content

query

method Deno.Permissions.prototype.query
Jump to headingPermissions.prototype.query(desc: PermissionDescriptor): Promise<PermissionStatus>

Resolves to the current status of a permission.

Note, if the permission is already granted, request() will not prompt the user again, therefore query() 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 = await Deno.permissions.query({ name: "read", path: "/etc" });
console.log(status.state);

Parameters Jump to heading

Return Type Jump to heading

Back to top