Menu
×
   ❮     
HTML CSS JAVASCRIPT SQL PYTHON JAVA PHP HOW TO W3.CSS C C++ C# BOOTSTRAP REACT MYSQL JQUERY EXCEL XML DJANGO NUMPY PANDAS NODEJS R TYPESCRIPT ANGULAR GIT POSTGRESQL MONGODB ASP AI GO KOTLIN SASS VUE DSA GEN AI SCIPY AWS CYBERSECURITY DATA SCIENCE
     ❯   

Node.js path.isAbsolute() Method

❮ Path Module


Example

Check if different strings are absolute paths:

var path = require('path');

console.log(path.isAbsolute('/test/demo_path.js')); //true
console.log(path.isAbsolute('test/demo_path.js')); //false
console.log(path.isAbsolute('C:\\test\\demo_path.js')); //true
Run example »

Definition and Usage

The path.isAbsolute() method returns true if the specified path is an absolute path, otherwise false.


Syntax

path.isAbsolute(path);

Parameter Values

Parameter Description
path Required. The path to check

Technical Details

Return Value: A Boolean
Node.js Version: 0.11.2

❮ Path Module