Deno.mkdirSync
mkdirSync
-
mkdirSync(path: string, options?: MkdirOptions): void
-
同步地在指定路径下创建一个新的目录。
Synchronously creates a new directory with the specified path.
Deno.mkdirSync("new_dir"); Deno.mkdirSync("nested/directories", { recursive: true }); Deno.mkdirSync("restricted_access_dir", { mode: 0o700 });
目录存在的情况下,默认抛出错误。
Defaults to throwing error if the directory already exists.
需要
allow-write
权限。Requires
allow-write
permission.
参数
- ##### path: string
- ##### Optional options: [MkdirOptions](interfaces/deno.mkdiroptions.html)