Add a timeout to fetch requests using AbortController
const ctrl = new AbortController(); setTimeout(() => ctrl.abort(), 5000); const r = await fetch(url, { signal: ctrl.signal });
Check if a path exists and is a directory
Get the directory of the currently running script
Parse JSON without try-catch crashing your app
Access environment variables in Node.js