1. path-is-absolute
Node.js 0.12 path.isAbsolute() ponyfill
path-is-absolute
Package: path-is-absolute
Created by: sindresorhus
Last modified: Fri, 21 Jul 2023 15:52:30 GMT
Version: 2.0.0
License: MIT
Downloads: 185,044,500
Repository: https://github.com/sindresorhus/path-is-absolute

Install

npm install path-is-absolute
yarn add path-is-absolute

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

Dependencies

RELATED POST

Enhancing Vue.js Development: Harnessing the Potential of Vue-Loader

Enhancing Vue.js Development: Harnessing the Potential of Vue-Loader

Simplify Data Validation in Vue.js: A Step-by-Step Guide to Using Regex

Simplify Data Validation in Vue.js: A Step-by-Step Guide to Using Regex

Troubleshooting Made Easy: Common Issues and Solutions with vue-loader Without vue-cli

Troubleshooting Made Easy: Common Issues and Solutions with vue-loader Without vue-cli

Optimizing Webpack 4 with Vue CLI 3: Disabling the Cache-Loader

Optimizing Webpack 4 with Vue CLI 3: Disabling the Cache-Loader

Step-by-Step Guide: How to Add a Function to Your Vuex Plugin

Step-by-Step Guide: How to Add a Function to Your Vuex Plugin