mkdir-async-recursive
Advanced tools
+3
-2
@@ -45,7 +45,8 @@ 'use strict'; | ||
| } | ||
| const dirs = path.split("/"); | ||
| const sep = path.includes("/") ? "/" : nodePath__default.sep; | ||
| const dirs = path.split(sep); | ||
| let dirPath = ""; | ||
| const result = []; | ||
| for (const dir of dirs) { | ||
| dirPath += `${dir}/`; | ||
| dirPath += `${dir}${sep}`; | ||
| await mkdir(dirPath, mode); | ||
@@ -52,0 +53,0 @@ } |
+3
-2
@@ -38,7 +38,8 @@ import fs from 'node:fs'; | ||
| } | ||
| const dirs = path.split("/"); | ||
| const sep = path.includes("/") ? "/" : nodePath.sep; | ||
| const dirs = path.split(sep); | ||
| let dirPath = ""; | ||
| const result = []; | ||
| for (const dir of dirs) { | ||
| dirPath += `${dir}/`; | ||
| dirPath += `${dir}${sep}`; | ||
| await mkdir(dirPath, mode); | ||
@@ -45,0 +46,0 @@ } |
+4
-4
| { | ||
| "name": "mkdir-async-recursive", | ||
| "version": "1.0.0", | ||
| "version": "1.0.1", | ||
| "description": "Asynchronously and recursively creates a directory. Returns undefined or the first directory path created.", | ||
@@ -51,5 +51,5 @@ "type": "module", | ||
| "devDependencies": { | ||
| "@types/node": "^22.9.0", | ||
| "prettier": "^3.3.3", | ||
| "typescript": "^5.6.3", | ||
| "@types/node": "^22.10.0", | ||
| "prettier": "^3.4.1", | ||
| "typescript": "^5.7.2", | ||
| "unbuild": "^2.0.0" | ||
@@ -56,0 +56,0 @@ }, |
7620
1.74%133
1.53%