0.0.3 • Published 6 years ago

mk_path666 v0.0.3

Weekly downloads
7
License
MIT
Repository
github
Last release
6 years ago

目标

原生fs模块无法直接以一个不存在路径创建文件或目录, 本模块希望做到这一点。

思路

将路径分解为多级目录,依次尝试创建

用法

$ npm install mk_path666

after install package, use this to mk a path

const mk_path = require("../lib/mk_path.js")

mk_path.dir("./hel/lo/wor/ld",(err,dirpath)=>{if(err) throw err});

first parameter is path you want to make,it most be an not empty String. sceond parameter is callback function after mkdir,err will be null if action sucess.