demo_met_path_format.js:
var path = require('path'); //Create a path object: var obj = { dir: 'C:\\Users\\Refsnes', base: 'demo_path.js' } //Format the path object into a path string: var p = path.format(obj); console.log(p);
C:\Users\My Name>node demo_met_path_format.js
C:\Users\Refsnes\demo_path.js