index.js
function tarDir(dir) {
    var archiveName = path.basename(dir) +'.orig.tar.xz';
    var archivePath = path.join(path.dirname(dir), archiveName);

    return exec('tar cfJ '+ archivePath +' '+ dir);
}
function tarDir(dir) {
    var archiveName = path.basename(dir) +'.orig.tar.xz';
    var archivePath = path.join(path.dirname(dir), archiveName);

    return exec('tar cfJ '+ archivePath +' '+ dir);
}
function tarDir ( dir ) { var archiveName = path . basename ( dir ) + '.orig.tar.xz' ; var archivePath = path . join ( path . dirname ( dir ) , archiveName ) ; return exec ( 'tar cfJ ' + archivePath + ' ' + dir ) ; }
Uses tar to create an xz archive of a directory and writes it to its parent dir.
Uses tar to create an xz archive of a directory and writes it to its parent dir .