Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/ayonli_jsext/lib.deno.d.ts>Deno.Permissions#query

A JavaScript extension package for building strong and modern applications.
Latest
method Deno.Permissions.prototype.query
import { Deno } from "https://deno.land/x/ayonli_jsext@v0.9.72/lib.deno.d.ts";
const { Permissions } = Deno;

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);