JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 1845558
  • Score
    100M100P100Q204383F
  • License MIT

Return whether a directory is a subdirectory of another directory

Package Exports

  • is-subdir

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (is-subdir) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

is-subdir

Return whether a directory is a subdirectory of another directory

npm version

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.

Returns true when the directories match.

Installation

<npm|yarn|pnpm> add is-subdir

Usage

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

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

API

isSubdir(parentDir, subdir): boolean

License

MIT © Zoltan Kochan