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

x/deno/cli/dts/lib.deno.ns.d.ts>Deno.resources

A modern runtime for JavaScript and TypeScript.
Go to Latest
function Deno.resources
import { Deno } from "https://deno.land/x/deno@v1.28.1/cli/dts/lib.deno.ns.d.ts";
const { resources } = Deno;

Returns a map of open resource IDs (rid) along with their string representations. This is an internal API and as such resource representation has unknown type; that means it can change any time and should not be depended upon.

console.log(Deno.resources());
// { 0: "stdin", 1: "stdout", 2: "stderr" }
Deno.openSync('../test.file');
console.log(Deno.resources());
// { 0: "stdin", 1: "stdout", 2: "stderr", 3: "fsFile" }

Returns

ResourceMap