Get all directories contained in a string file path
$ npm install --save path-directories
const dirnames = require('path-directories');
// Windows path - gives [ 'D:', 'DDL', 'ANIME', 'les chevaliers du zodiaques' ]
dirnames("D:\\DDL\\ANIME\\les chevaliers du zodiaques\\whateverFile.avi");
// POSIX path - gives [ 'D:', 'DDL', 'EBOOK' ]
dirnames("D:/DDL/EBOOK/whatEverFile.pub");
Returns all the directories in this string file path.
MIT