1. Home
  2. Node
  3. Parse path

Parse a method belonging to the Path native Node module. A parsed path returns an object containing directory, module base name, extension and the file name.

#node#module#path
const path = require('path');
var pathData = path.parse(__filename);
console.log(pathData);
copy
Full Node cheatsheet