grantOrThrow(...descriptors: Deno.PermissionDescriptor[]): Promise<void>(will be removed in 1.0.0) Use the Deno Permissions API directly instead.
Attempts to grant a set of permissions or rejects.
import { grantOrThrow } from "@std/permissions"; await grantOrThrow({ name: "env" }, { name: "net" });
If the permission can be prompted for, the function will attempt to prompt. If any of the permissions are denied, the function will reject for the first permission that is denied. If all permissions are granted, the function will resolve.
Parameters
...descriptors: Deno.PermissionDescriptor[]Return Type
Promise<void>grantOrThrow(descriptors: Deno.PermissionDescriptor[]): Promise<void>(will be removed in 1.0.0) Use the Deno Permissions API directly instead.
Attempts to grant a set of permissions or rejects.
import { grantOrThrow } from "@std/permissions"; await grantOrThrow([{ name: "env" }, { name: "net" }]);
If the permission can be prompted for, the function will attempt to prompt. If any of the permissions are denied, the function will reject mentioning the the denied permissions. If all permissions are granted, the function will resolve.
Parameters
descriptors: Deno.PermissionDescriptor[]Return Type
Promise<void>