0.0.1 • Published 10 years ago

pathwalker v0.0.1

Weekly downloads
1
License
MIT
Repository
-
Last release
10 years ago

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