Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

path-depth

derhuerst1.8kISC1.0.0

Get the depth of a file/URL path.

depth, relative, path, absolute, path, resolution

readme

path-depth

Get the depth of a file/URL path.

depth('/a/b/c')      //  3
depth('a\\..\\b\\c') //  2
depth('a/./b')       //  2
depth('foo/../..')   // -1
depth('.')           //  0

npm version build status ISC-licensed chat on gitter support me on Patreon

Installing

npm install path-depth

Contributing

If you have a question, found a bug or want to propose a feature, have a look at the issues page.