is-relative-path

Whether or not a given path is relative

Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.
Last updated 9 years ago by mrjoelkemp .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ npm 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 [deprecated]           ...           9 years ago
  • 1.0.2 [deprecated]           ...           9 years ago
  • 1.0.1 [deprecated]           ...           11 years ago
  • 1.0.0 [deprecated]           ...           11 years ago
Maintainers (1)
Downloads
Total 16
Today 0
This Week 0
This Month 8
Last Day 0
Last Week 1
Last Month 8
Dependencies (0)
None
Dev Dependencies (2)

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