2.0.0 • Published 7 years ago

is-relative-path v2.0.0

Weekly downloads
193,847
License
MIT
Repository
github
Last release
7 years ago

is-relative-path npm npm

Sometimes I just want to scream

npm install is-relative-path

Usage

isRelative(path)

  • path <string>
  • Returns: <boolean>
var isRelative = require('is-relative-path');

isRelative('../'); // true
isRelative('/'); // false

Breaking change

Code

VersionCode
1.x(path) => path[0] === '.'
2.x(path) => !path.isAbsolute(path)

Test

pathv1.xv2.x
""falsetrue
"."truetrue
".."truetrue
"foo"falsetrue
"/foo"falsefalse