pathabs
v1.0.0
Published
Resolve the absolute path from a relative or OS-specific path
Downloads
9
Maintainers
Readme
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);