2 title: Node.js path API
6 Quick reference to the [Node.js path API](https://nodejs.org/api/path.html).
12 const fs = require('fs')
14 fs.realpath('/etc/passwd', function (err, path) {
15 path // => "/private/etc/passwd"
20 const path = require('path')
21 dir = path.join('etc', 'passwd')
22 dir = path.resolve('/etc', 'passwd', '..', 'var')
26 path.dirname('/etc/passwd') // => "/etc"
27 path.basename('/etc/passwd') // => "passwd"
28 path.basename('/etc/rc.d', '.d') // => "rc"
33 - https://nodejs.org/api/path.html