Get the directory of the currently running script
import { dirname } from 'path'; import { fileURLToPath } from 'url'; const __dirname = dirname(fileURLToPath(import.meta.url));
Check if a path exists and is a directory
Add a timeout to fetch requests using AbortController
Parse JSON without try-catch crashing your app
Access environment variables in Node.js