pathwalker

0.0.1 • Public • Published

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

Readme

Keywords

none

Package Sidebar

Install

npm i pathwalker

Weekly Downloads

0

Version

0.0.1

License

MIT

Last publish

Collaborators

  • marcallkz