CLI Usage
Basic Syntax
bash
normpath [options] <path>Options
--format, -f <type>
Target format: unix, windows, or auto (default).
bash
# Auto-detect (default)
normpath "C:\\Users\\file.txt"
# Force Unix format
normpath --format unix "C:\\Users\\file.txt"
# Force Windows format
normpath --format windows "/home/user/file.txt"--absolute, -a
Resolve to absolute path.
bash
normpath --absolute "./relative/path.txt"--verbose, -v
Enable verbose output with debug information.
bash
normpath --verbose "C:\\Users\\file.txt"--help, -h
Show help message.
bash
normpath --helpExamples
Convert Windows to Unix
bash
normpath --format unix "C:\\Program Files\\MyApp\\config.json"Output:
json
{
"success": true,
"path": "/c/Program Files/MyApp/config.json",
"format": "unix"
}Convert Unix to Windows
bash
normpath --format windows "/home/user/projects/app"Output:
json
{
"success": true,
"path": "home\\user\\projects\\app",
"format": "windows"
}Handle UNC Paths
bash
normpath --format unix "\\\\server\\share\\folder"Output:
json
{
"success": true,
"path": "//server/share/folder",
"format": "unix"
}Exit Codes
0- Success1- Error (invalid arguments, empty path, etc.)
Shell Integration
Bash/Zsh
bash
# Convert path and use result
UNIX_PATH=$(normpath --format unix "$WIN_PATH" | jq -r '.path')
echo "Processing: $UNIX_PATH"PowerShell
powershell
$result = normpath --format windows "/home/user/file.txt" | ConvertFrom-Json
Write-Host "Path: $($result.path)"Next Steps
- Library Usage - Use as a Node.js module
- Examples - Real-world scenarios