demo_met_path_dirname.js:
var path = require('path'); //Return the directries: var directories = path.dirname('/Users/Refsnes/demo_path.js'); console.log(directories);
C:\Users\My Name>node demo_met_path_dirname.js
/Users/Refsnes