🚀 DAY 4 OF LAUNCH WEEK: Introducing GitHub Actions Scanning Support.Learn more →
Socket
Book a DemoInstallSign in
Socket

path-is-absolute

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

path-is-absolute

Node.js 0.12 path.isAbsolute() ponyfill

latest
Source
npmnpm
Version
2.0.0
Version published
Weekly downloads
49M
-17.08%
Maintainers
1
Weekly downloads
 
Created
Source

Deprecated

This package is no longer relevant as Node.js 0.12 is unmaintained.

path-is-absolute Build Status

Node.js 0.12 path.isAbsolute() ponyfill

Install

$ npm install --save path-is-absolute

Usage

const pathIsAbsolute = require('path-is-absolute');

// Running on Linux
pathIsAbsolute('/home/foo');
//=> true
pathIsAbsolute('C:/Users/foo');
//=> false

// Running on Windows
pathIsAbsolute('C:/Users/foo');
//=> true
pathIsAbsolute('/home/foo');
//=> false

// Running on any OS
pathIsAbsolute.posix('/home/foo');
//=> true
pathIsAbsolute.posix('C:/Users/foo');
//=> false
pathIsAbsolute.win32('C:/Users/foo');
//=> true
pathIsAbsolute.win32('/home/foo');
//=> false

API

See the path.isAbsolute() docs.

pathIsAbsolute(path)

pathIsAbsolute.posix(path)

POSIX specific version.

pathIsAbsolute.win32(path)

Windows specific version.

License

MIT © Sindre Sorhus

Keywords

path

FAQs

Package last updated on 08 Nov 2018

Did you know?

Socket

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