lib/render.js
function( path, callback ) {
		var parts = ( path || '' ).split( /\//g ),
			filepath = '/';

		// Trim Left
		if ( ! parts[ 0 ].length ) {
			parts.shift();
		}

		// Trim right
		if ( parts.length && ! parts[ parts.length - 1 ].length ) {
			parts.pop();
		}

		// Handle root '/' error
		if ( ! parts.length ) {
			return callback( new Error( "No directory path found to make" ) );
		}

		// Make sure each branch is created
		async.mapSeries( parts,
			function( dir, callback ) {
				fs.stat( filepath += dir + '/', function( e, stat ) {
					if ( stat && stat.isDirectory() ) {
						callback();
					}
					else {
						fs.mkdir( filepath, callback );
					}
				});
			},
			callback
		);
	}
function( path, callback ) {
		var parts = ( path || '' ).split( /\//g ),
			filepath = '/';

		// Trim Left
		if ( ! parts[ 0 ].length ) {
			parts.shift();
		}

		// Trim right
		if ( parts.length && ! parts[ parts.length - 1 ].length ) {
			parts.pop();
		}

		// Handle root '/' error
		if ( ! parts.length ) {
			return callback( new Error( "No directory path found to make" ) );
		}

		// Make sure each branch is created
		async.mapSeries( parts,
			function( dir, callback ) {
				fs.stat( filepath += dir + '/', function( e, stat ) {
					if ( stat && stat.isDirectory() ) {
						callback();
					}
					else {
						fs.mkdir( filepath, callback );
					}
				});
			},
			callback
		);
	}
function ( path , callback ) { var parts = ( path || '' ) . split ( / \/ / g ) , filepath = '/' ; // Trim Left if ( ! parts [ 0 ] . length ) { parts . shift ( ) ; } // Trim right if ( parts . length && ! parts [ parts . length - 1 ] . length ) { parts . pop ( ) ; } // Handle root '/' error if ( ! parts . length ) { return callback ( new Error ( "No directory path found to make" ) ) ; } // Make sure each branch is created async . mapSeries ( parts , function ( dir , callback ) { fs . stat ( filepath += dir + '/' , function ( e , stat ) { if ( stat && stat . isDirectory ( ) ) { callback ( ) ; } else { fs . mkdir ( filepath , callback ) ; } } ) ; } , callback ) ; }
Creates directory path if not already
Creates directory path if not already