npm stats
  • Search
  • About
  • Repo
  • Sponsor
  • more
    • Search
    • About
    • Repo
    • Sponsor

Made by Antonio Ramirez

depth

0.1.1

@jonschlinkert

npmHomeRepoSnykSocket
Downloads:103
$ npm install depth
DailyWeeklyMonthlyYearly

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

  • github/jonschlinkert
  • twitter/jonschlinkert

License

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