node.js path directory code example
Example 1: get dirname to last directory node
path.basename(path.dirname(filename))
Example 2: node.js name of file
var path = require('path');
var scriptName = path.basename(__filename);
path.basename(path.dirname(filename))
var path = require('path');
var scriptName = path.basename(__filename);