Skip to content
This repository has been archived by the owner on Jul 31, 2019. It is now read-only.

roonie007/mkdirpm

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

mkdirpm

Like mkdir -p, but in node.js! and create multiple directories at one time No sync - refer to "https://www.npmjs.com/package/mkdirp"

Install

$ npm install mkdirpm

or (globally)

$ npm install mkdirpm -g 

Example

const mkdirpm  	= require("mkdirpm");
const path  	= require("path");
mkdirpm([path.join(__dirname,"folder1/folder2/folder3/folder4"),path.join(__dirname,"folder2"),path.join(__dirname,"folder3/folder1")],function(err,index,path)
{
	if(err)
		console.log(err,index,path); 
	// index : index of the path with an error in the array
	// path  : the path
});

OR only one path

const mkdirpm  	= require("mkdirpm");
const path  	= require("path");
mkdirpm(path.join(__dirname,"cccccc/aaaaaa"),function(err,index,path)
{
	if(err)
		console.log(err);
});

Example globally

mkdirpm "/home/user/folder1" "/home/user/folder2/folder1" "/home/user/folder3/folder1/folder2/folder3" "/home/user/folder4"

About

Like mkdir -p, but in node.js! and create multiple directories at one time , refer to https://www.npmjs.com/package/mkdirp

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published