Check if a path is in the current working directory
$ npm install is-path-in-cwd
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.
Tidelift helps make open source sustainable for maintainers while giving companies
assurances about security, maintenance, and licensing for their dependencies.