Skip to main content
Using Deno in production at your company? Earn free Deno merch.
Give us feedback
Module

x/deno/cli/tsc/dts/lib.deno.ns.d.ts>Deno.Permissions#querySync

A modern runtime for JavaScript and TypeScript.
Go to Latest
method Deno.Permissions.prototype.querySync
import { Deno } from "https://deno.land/x/deno@v1.30.0/cli/tsc/dts/lib.deno.ns.d.ts";
const { Permissions } = Deno;

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