1、简介

将Windows反斜杠路径转换为斜杠路径,如foo\\bar ➔ foo/bar

https://www.npmjs.com/package/slash

2、示例

const path = require('path');
const slash = require('slash');
 
const string = path.join('foo', 'bar');
// Unix    => foo/bar
// Windows => foo\\bar
 
slash(string);
// Unix    => foo/bar
// Windows => foo/bar

 

相关文章:

  • 2021-12-02
  • 2022-12-23
猜你喜欢
  • 2022-02-18
  • 2022-12-23
  • 2021-11-22
  • 2022-12-23
  • 2022-02-17
  • 2022-12-23
  • 2021-10-11
相关资源
相似解决方案