1.0.0 • Published 1 year ago

pathabs v1.0.0

Weekly downloads
-
License
MPL-2.0
Repository
-
Last release
1 year ago

pathabs

Resolve the absolute path from a relative or OS-specific path

Installation

npm i pathabs

Importing

Module

import pathabs from "pathabs";

CommonJS

const pathabs = require("pathabs");

Usage

let filePath = "~/Documents/GitHub";

// "~/Documents/GitHub"
console.log(filePath);

filePath = pathabs(filePath);

// "/home/{USER_NAME}/Documents/GitHub" on Linux
// "C:\Users\{USER_NAME}\Documents\GitHub" on Windows
console.log(filePath);