npm.io
2.0.0 • Published 5 months ago

path-absolute

Licence
MIT
Version
2.0.0
Deps
0
Size
3 kB
Vulns
0
Weekly
0
Stars
104

path-absolute

Resolves a path to an absolute path. Supports tilde

npm version

Installation

<npm|yarn|pnpm> add path-absolute

Usage

const pathAbsolute = require('path-absolute')

pathAbsolute('~/foo')
//> '/home/zkochan/foo'

pathAbsolute('/foo/bar')
//> '/foo/bar'

pathAbsolute('./foo/bar', '/home')
//> '/home/foo/bar'

API

pathAbsolute(path, [cwd]): string

Resolves a path to an absolute path

License

MIT Zoltan Kochan

Keywords