New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

cygpath

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cygpath

convert between windows and cygwin/mingw/msys2 path styles

latest
npmnpm
Version
1.0.0
Version published
Weekly downloads
3
-25%
Maintainers
1
Weekly downloads
 
Created
Source

node-cygpath

Module for Node.js which converts between Windows (Win32) and Cygwin/Mingw/MSYS2 path styles, similar to the cygpath utility program found in Cygwin and MSYS2.

API documentation

toUnix (exported function)

Convert any path to a unix-style path. For example,

C:\Program Files (x86)\Steam\steamapps would get converted to /c/Program Files (x86)/Steam/steamapps.

options.convertDriveLetter defaults to true. When true, drive letters (eg C:) will be converted to an fs-root single-character path component (eg /c/). This behavior is modeled after that of Cygwin, MSYS2, etc. To skip this behavior and only convert path separators (ie. slashes), pass { convertDriveLetter: false }.

function toUnix(
  inputStr,
  options?: {
    convertDriveLetter?: boolean;
  }
): string;

toWindows (exported function)

Convert any path to a Win32-style path. For example,

/c/Program Files (x86)/Steam/steamapps would get converted to C:\Program Files (x86)\Steam\steamapps.

options.convertDriveLetter defaults to true. When true, an fs-root single-character path component (eg /c/) will be treated as (and converted to) a drive letter (eg C:). This behavior is modeled after that of Cygwin, MSYS2, etc. To skip this behavior and only convert path separators (ie. slashes), pass { convertDriveLetter: false }.

function toWindows(
  inputStr,
  options?: {
    convertDriveLetter?: boolean;
  }
): string;

toMixed (exported function)

Convert any path to a Win32-style path but with forward slashes. For example,

/c/Program Files (x86)/Steam/steamapps would get converted to C:/Program Files (x86)/Steam/steamapps.

options.convertDriveLetter defaults to true. When true, an fs-root single-character path component (eg /c/) will be treated as (and converted to) a drive letter (eg C:). This behavior is modeled after that of Cygwin, MSYS2, etc. To skip this behavior and only convert path separators (ie. slashes), pass { convertDriveLetter: false }.

function toMixed(
  inputStr,
  options?: {
    convertDriveLetter?: boolean;
  }
): string;

License

MIT

Keywords

path

FAQs

Package last updated on 23 Sep 2025

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