trivial and outdated NPM packages

is-absolute outdated npm logo

A convoluted way to call path.isAbsolute()

Weekly Downloads
4,405,398
Dependencies
4
Latest Release
8 years ago
Switch to the native implementation.
Outdated
First version with native support
Node.js 0.11.2
added to Node.js
13 years ago

Dependency Tree

  • is-absolute @1.0.0 (4)
    • is-relative @1.0.0 (2)
      • is-unc-path @1.0.0 (1)
        • unc-path-regex @0.1.2
    • is-windows @1.0.2

About

Checks if a path is absolute.

To check if a path is absolute, you can use the builtin Node.js method path.isAbsolute:

const path = require("path");

path.isAbsolute("/foo/bar"); // true
path.isAbsolute("foo/bar"); // false
path.isAbsolute("C:\\foo\\bar"); // true
path.isAbsolute("C:/foo/bar"); // true
path.isAbsolute("C:\\"); // true
path.isAbsolute("C:"); // false
path.isAbsolute("."); // false
path.isAbsolute(".."); // false