contrib/nodeunit/junit_reporter.js
function (path, callback) {
    var mkdir = child_process.spawn('mkdir', ['-p', path]);
    mkdir.on('error', function (err) {
        callback(err);
        callback = function(){};
    });
    mkdir.on('exit', function (code) {
        if (code === 0) callback();
        else callback(new Error('mkdir exited with code: ' + code));
    });
}
function (path, callback) {
    var mkdir = child_process.spawn('mkdir', ['-p', path]);
    mkdir.on('error', function (err) {
        callback(err);
        callback = function(){};
    });
    mkdir.on('exit', function (code) {
        if (code === 0) callback();
        else callback(new Error('mkdir exited with code: ' + code));
    });
}
function ( path , callback ) { var mkdir = child_process . spawn ( 'mkdir' , [ '-p' , path ] ) ; mkdir . on ( 'error' , function ( err ) { callback ( err ) ; callback = function ( ) { } ; } ) ; mkdir . on ( 'exit' , function ( code ) { if ( code === 0 ) callback ( ) ; else callback ( new Error ( 'mkdir exited with code: ' + code ) ) ; } ) ; }
Ensures a directory exists using mkdir -p.

@param {String} path
@param {Function} callback
@api private
Ensures a directory exists using mkdir - p .