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' ]
string[]