pathwalker
v0.0.1
Published
Returns all superior directories from a given directory
Downloads
1
Readme
pathwalker
Return all the parent directories of a directory.
usage
var pathwalker = require('pathwalker');
var directories = pathwalker("/path/to/dir");
//or
var directories = pathwalker("c:\\path\\to\\dir");
//or
var directories = pathwalker("c:/path/to/dir");
console.dir(directories);
# OUTPUTS
[ "/path/to/dir", "/path/to", "/path", "/"]
[ "c:\\path\\to\\dir", "c:\\path\\to", "c:\\path", "c:"]
[ "c:/path/to/dir", "c:/path/to", "c:/path", "c:"]
pathwalker(cwd)
Breakes the string in its slashes to return an array of the parent directories of "cwd".
install
With npm do:
npm install pathwalker
licence
MIT