import fs from 'fs' ; export function removeDirectorySync ( dir ) { if ( fs . rmSync != null && typeof fs . rmSync === 'function' ) { return fs . rmSync ( dir , { recursive : true } ) ; } return fs . rmdirSync ( dir , { recursive : true } ) ; }