Skip to content

marcallkz/pathwalker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

license

MIT

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published