### Install crosspath with Yarn Source: https://github.com/wessberg/crosspath/blob/master/README.md Installs the crosspath package using Yarn. ```bash $ yarn add crosspath ``` -------------------------------- ### Install crosspath with npm Source: https://github.com/wessberg/crosspath/blob/master/README.md Installs the crosspath package using npm. ```bash $ npm install crosspath ``` -------------------------------- ### Install crosspath with pnpm Source: https://github.com/wessberg/crosspath/blob/master/README.md Installs the crosspath package using pnpm. ```bash $ pnpm add crosspath ``` -------------------------------- ### Import and use crosspath join and relative Source: https://github.com/wessberg/crosspath/blob/master/README.md Shows how to import and use crosspath functions like join and relative, which normalize paths to POSIX format. The example demonstrates that path.join converts backslashes to forward slashes and path.relative computes a relative path. ```typescript // Import just what you need: import {join, relative} from "crosspath"; // or simply: import path from "crosspath"; // Becomes 'C:/foo/bar' path.join("C:\\foo", "\\bar"); // Becomes '../bar' path.relative("C:\\foo", "C:\\bar"); ``` -------------------------------- ### Use native path helpers with path.native Source: https://github.com/wessberg/crosspath/blob/master/README.md Shows how to use the native path helpers via path.native, which preserve OS-specific path conventions instead of normalizing to POSIX. Useful when interacting with the file system and you want paths to respect the OS convention. ```typescript import path from "crosspath"; // Becomes 'C:\foo\bar' on Windows and C:\foo/\bar on POSIX-systems path.native.join("C:\\foo", "\\bar"); // Becomes '..\bar' on Windows and ../C:\bar on POSIX-systems path.native.relative("C:\\foo", "C:\\bar"); ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.