path-is-root
Check if a path is root
Last updated 8 years ago by rwu823 .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ npm install path-is-root 
SYNC missed versions from official npm registry.

Build Status Coverage

path-is-root

check if a path is root

Install

npm install --save path-is-root

Usage

import isRoot from 'path-is-root'
  
test('should be root path in Unix', assert => {
  assert.is(isRoot('/'), true)
})

test('should be not root path in Unix', assert => {
  assert.is(isRoot('/x'), false)
})

test('should be root path in Win', assert => {
  assert.is(isRoot('C:/'), true)
})

test('should be not root path in Win', assert => {
  assert.is(isRoot('C:/x'), false)
})

API

isRoot(path)

Returns a boolean of whether the path is root

Current Tags

  • 0.1.0                                ...           latest (8 years ago)

1 Versions

  • 0.1.0                                ...           8 years ago
Maintainers (1)
Downloads
Total 0
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (0)
None
Dev Dependencies (3)
Dependents (1)

© 2010 - cnpmjs.org x YWFE | Home | YWFE