This package has been deprecated

Author message:

Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

path-cygwin-patch

1.0.1 • Public • Published

path-cygwin-patch

A npm module to replace methods of path to handle paths starting with '/' in Cygwin or MSYS2.

Description

The path module of Node.js does not handle paths starting with '/' in Cygwin or MSYS2, so sometimes yields an invalid path and causes a problem.

// On MSYS2
 
const path = require('path');
 
console.log(path.join('/c/Users', 'iorate/Documents')); // => \c\Users\iorate\Documents

This module exports nothing but patches path in Cygwin or MSYS2.

const path = require('path');
require('path-cygwin-patch');
 
console.log(path.join('/c/Users', 'iorate/Documents')); // => C:\Users\iorate\Documents

Some npm executables accept configuration files written in JavaScript. If such an executable has a problem on Cygwin or MSYS2, you can try to inject this module in a configuration file.

// .foorc.js
 
require('path-cygwin-patch');
 
module.exports = {
  // ...
};

Test

npm install
 
npm test

Known Issue

Patched functions are SLOW because they invoke cygpath internally.

Author

iorate (Twitter)

License

path-cygwin-patch is licensed under MIT License.

Readme

Keywords

Package Sidebar

Install

npm i path-cygwin-patch

Weekly Downloads

1

Version

1.0.1

License

MIT

Unpacked Size

8.29 kB

Total Files

5

Last publish

Collaborators

  • iorate