Skip to main content
Process.getActiveResourcesInfo - process - Node documentation
method Process.getActiveResourcesInfo

Usage in Deno

import { type Process } from "node:process";
Process.getActiveResourcesInfo(): string[]

The process.getActiveResourcesInfo() method returns an array of strings containing the types of the active resources that are currently keeping the event loop alive.

import { getActiveResourcesInfo } from 'node:process';
import { setTimeout } from 'node:timers';

console.log('Before:', getActiveResourcesInfo());
setTimeout(() => {}, 1000);
console.log('After:', getActiveResourcesInfo());
// Prints:
//   Before: [ 'TTYWrap', 'TTYWrap', 'TTYWrap' ]
//   After: [ 'TTYWrap', 'TTYWrap', 'TTYWrap', 'Timeout' ]

Return Type

string[]
Back to top