Socket
Socket
Sign inDemoInstall

is-relative-path

Package Overview
Dependencies
0
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    is-relative-path

Whether or not a given path is relative


Version published
Weekly downloads
644K
decreased by-11.18%
Maintainers
1
Install size
4.10 kB
Created
Weekly downloads
 

Readme

Source

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

Keywords

FAQs

Last updated on 13 Aug 2017

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc