unix-path-resolve

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

MIT 2 个版本
安装
npm install unix-path-resolve
yarn add unix-path-resolve
pnpm add unix-path-resolve
bun add unix-path-resolve
README

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

版本列表
1.0.2 2022-01-06
1.0.1 2021-12-23