depth

0.1.1 • Public • Published

depth

Returns the depth of a file or directory, e.g. number of folders deep.

Install

Install with npm:

npm i depth --save-dev

Run tests

npm test

Usage

var depth = require('depth');
 
console.log(depth('index.js'));
//=> 0
console.log(depth('./node_modules/'));
//=> 1
console.log(depth('./node_modules/verb'));
//=> 2
console.log(depth('./node_modules/verb/index.js'));
//=> 2

Author

Jon Schlinkert

License

Copyright (c) 2014 Jon Schlinkert, contributors. Released under the MIT license

Package Sidebar

Install

npm i depth

Weekly Downloads

3

Version

0.1.1

License

none

Last publish

Collaborators

  • doowb
  • jonschlinkert