urix-modern
v0.1.1
Published
Maintained compatibility implementation of urix.
Maintainers
Readme
urix-modern
A maintained, compatibility-first implementation of the deprecated urix package.
This project preserves the original urix(path) API and its OS-dependent behavior.
It does not attempt to redesign path or URL handling.
Published on npm as urix-modern.
Installation
npm install urix-modernCommonJS
var urix = require("urix-modern")
urix("c:\\users\\you\\foo")ESM
Node.js can use the CommonJS implementation through its default-import interoperability:
import urix from "urix-modern"
urix("c:\\users\\you\\foo")There is no separate ESM build or named export.
Behavior
On Windows, backslashes become forward slashes and a leading drive letter is replaced by /.
urix("c:\\users\\you\\foo")
// /users/you/fooOn Linux, macOS, and other POSIX systems, the input is returned unchanged.
urix("c:\\users\\you\\foo")
// c:\users\you\fooThis behavior intentionally includes the original package's edge cases.
It does not normalize repeated slashes, resolve . or .., encode URLs, or validate paths.
See COMPATIBILITY.md for the complete compatibility contract.
Node.js support
The supported Node.js versions are 22 and later. CI covers Node.js 22, 24, and 26 on Windows, Linux, and macOS.
Migration from urix
Replace the package dependency and keep the function call unchanged:
-var urix = require("urix")
+var urix = require("urix-modern")
urix(path)The package name changes because this project does not assume ownership of the original urix name.
The function signature and conversion behavior remain compatible.
Keep require("urix") with an npm alias
To migrate without changing existing imports, install urix-modern under the old dependency name:
npm install urix@npm:urix-modernExisting code can then remain unchanged:
var urix = require("urix")npm records the alias in package.json:
{
"dependencies": {
"urix": "npm:urix-modern@^0.1.1"
}
}Development
The project has no runtime or development dependencies.
npm run check
npm testThe modernization decisions are recorded in MODERNIZATION.md.
License
MIT. The original copyright notice and license are preserved in LICENSE.
