Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

is-path-in-cwd

sindresorhus23.6mMIT4.0.0TypeScript support: included

Check if a path is in the current working directory

path, cwd, pwd, check, filepath, file, folder, in, inside

readme

is-path-in-cwd

Check if a path is in the current working directory

Install

$ npm install is-path-in-cwd

Usage

import isPathInCwd from 'is-path-in-cwd';

isPathInCwd('unicorn');
//=> true

isPathInCwd('../rainbow');
//=> false

isPathInCwd('.');
//=> false

Get professional support for this package with a Tidelift subscription
Tidelift helps make open source sustainable for maintainers while giving companies
assurances about security, maintenance, and licensing for their dependencies.