slash:将Windows反斜杠路径转换为斜杠路径

时间:2021-04-29 16:27:45
【文件属性】:
文件名称:slash:将Windows反斜杠路径转换为斜杠路径
文件大小:5KB
文件格式:ZIP
更新时间:2021-04-29 16:27:45
JavaScript 削减 将Windows反斜杠路径转换为斜杠路径: foo\\bar bar➔foo foo/bar 只要它们不是扩展长度的路径并且不包含任何非ASCII字符,。 这是因为Node.js中的path方法在Windows上输出\\路径而创建的。 安装 $ npm install slash 用法 import path from 'path' ; import slash from 'slash' ; const string = path . join ( 'foo' , 'bar' ) ; // Unix => foo/bar // Windows => foo\\bar slash ( string ) ; // Unix => foo/bar // Windows => foo/bar 原料药 斜线(路径) 类型: string 接受Windows反斜杠路径,并返回
【文件预览】:
slash-main
----.gitignore(23B)
----package.json(688B)
----.npmrc(19B)
----index.js(285B)
----test.js(457B)
----.github()
--------security.md(179B)
--------workflows()
--------funding.yml(111B)
----license(1KB)
----readme.md(1KB)
----index.test-d.ts(104B)
----.gitattributes(19B)
----.editorconfig(175B)
----index.d.ts(600B)

网友评论