nodejs get directory from path code example
Example 1: path.dirname nodejs
/* The path.dirname() method returns the directory name of a path,
similar to the Unix dirname command. Trailing directory separators
are ignored, see path.sep. */
path.dirname('/foo/bar/baz/asdf/quux');
// Returns: '/foo/bar/baz/asdf'
Example 2: get dirname to last directory node
path.basename(path.dirname(filename))