Socket
Book a DemoInstallSign in
Socket

depth

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

depth

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

latest
Source
npmnpm
Version
0.1.1
Version published
Maintainers
1
Created
Source

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

Keywords

dir

FAQs

Package last updated on 06 Sep 2014

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts