Socket
Book a DemoInstallSign in
Socket

unix-path-resolve

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

unix-path-resolve

Cross platform resolve that always returns a UNIX style `/` seperated path

latest
Source
npmnpm
Version
1.0.2
Version published
Maintainers
1
Created
Source

unix-path-resolve

Cross platform resolve that always returns a UNIX style / seperated path

npm install unix-path-resolve

Mostly useful for resolving modules cross platform

Usage

const resolve = require('unix-path-resolve')

resolve('/foo/bar', '../baz') // /foo/baz
resolve('/foo/bar', '/baz/foo') // /baz/foo
resolve('/a/b/c', '../../../../d') // throws since its out of bounds
resolve('a', 'b') // throws since none of them are absolute
resolve('/a/b/c', '..\\d') // /a/b/d
resolve('/a/b/c', 'c:\\foo\\bar') // /foo/bar
resolve('file:///a/b', './c') // /a/b/c

License

MIT

FAQs

Package last updated on 06 Jan 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts