How can I convert a windows path to posix path using node path

前端 未结 5 866
心在旅途
心在旅途 2021-01-03 23:28

I\'m developing on windows, but need to know how to convert a windows path (with backslashes \\) into a POSIX path with forward slashes (/)?

<
5条回答
  •  别那么骄傲
    2021-01-04 00:00

    There is node package called upath will convert windows path into unix.

    upath = require('upath');
    

    or

    import * as upath from 'upath';
    
    upath.toUnix(destination_path)
    

提交回复
热议问题