is-relative-path
DefinitelyTyped icon, indicating that this package has TypeScript declarations provided by the separate @types/is-relative-path package

2.0.0 • Public • Published

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

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 2.0.0
    370
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 2.0.0
    370
  • 1.0.2
    679,554
  • 1.0.1
    4,050
  • 1.0.0
    0

Package Sidebar

Install

npm i is-relative-path

Weekly Downloads

683,974

Version

2.0.0

License

MIT

Last publish

Collaborators

  • pahen
  • xhmikosr
  • mrjoelkemp