# path मॉड्यूल — नोड.जेएस

Source: https://www.geekswithgeeks.com/hi/nodejs/node-path

> ऐसे फ़ाइल पथ बनाएँ जो हर OS पर काम करें।

## पथ जोड़ना

`path.join` वर्तमान OS के लिए सही सेपरेटर उपयोग करता है।

```javascript
import path from "node:path";

const filePath = path.join("data", "users", "list.json");
console.log(filePath);                // data/users/list.json
console.log(path.basename(filePath)); // list.json
console.log(path.extname(filePath));  // .json
```

## ESM में __dirname

ES modules में `__dirname` नहीं होता — इसे `import.meta.url` से `fileURLToPath` द्वारा निकालें।
