path & __dirname (Node.js)
Në shqip përdoret i njëjti emër.
ShpjegimiSQ
Moduli path bashkon rrugët e skedarëve saktë në çdo sistem (path.join("a", "b")). __dirname është dosja e skriptit (në ES modules: import.meta.dirname).
EnglishEN
The path module joins file paths correctly on any system (path.join("a", "b")). __dirname is the script's folder (in ES modules: import.meta.dirname).
Si ta mendosh
Si një GPS për dosjet.
Lexoje në anglisht
Like a GPS for folders.
Shembull kodijavascript
import path from "node:path";
const skedari = path.join(import.meta.dirname, "te_dhena", "notat.json");