demo_met_path_basename.js:
var path = require('path'); //Extract the filename: var filename = path.basename('/Users/Refsnes/demo_path.js'); console.log(filename);
C:\Users\My Name>node demo_met_path_basename.js
demo_path.js