Skip to content
This repository has been archived by the owner on Sep 30, 2018. It is now read-only.

Latest commit

 

History

History
34 lines (23 loc) · 1.06 KB

README.md

File metadata and controls

34 lines (23 loc) · 1.06 KB

moved to https://github.com/zkochan/packages/tree/master/is-subdir

is-subdir

Return whether a directory is a subdirectory of another directory

npm version Build Status Build Status on Windows

Cross-platform. Works correctly on Windows, where directory paths can start with disk drive letters in different casings. Like c:\foo and C:\foo\bar.

Installation

npm i -S is-subdir

Usage

'use strict'
const path = require('path')
const isSubdir = require('is-subdir')

console.log(isSubdir(process.cwd(), path.resolve('node_modules')))
//> true

License

MIT © Zoltan Kochan