is-relative-path
Whether or not a given path is relative
Last updated 9 years ago by mrjoelkemp .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install is-relative-path 
SYNC missed versions from official npm registry.

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

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

Test

path v1.x v2.x
"" false true
"." true true
".." true true
"foo" false true
"/foo" false false

Current Tags

  • 2.0.0                                ...           latest (9 years ago)

4 Versions

  • 2.0.0                                ...           9 years ago
  • 1.0.2                                ...           9 years ago
  • 1.0.1                                ...           10 years ago
  • 1.0.0                                ...           11 years ago
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 1
Dependencies (0)
None
Dev Dependencies (2)

Copyright 2013 - present © cnpmjs.org | Home |