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

Package detail

is-root-path

sindresorhus9MIT3.0.0TypeScript support: included

Check if a path is the root path. Example: / or C:\

root, path, directory, top, level, absolute, check, detect, is

readme

is-root-path

Check if a path is the root path. Example: / or C:\

Install

$ npm install is-root-path

Usage

import isRootPath from 'is-root-path';

isRootPath('/');
//=> true

isRootPath('/Users');
//=> false