code: function assertIsDirectory(path) {
    try {
      if (!fs.lstatSync(path).isDirectory()) {
        console.log('Path "' + path + '" is not a directory.');
        process.exit();
      }
    } catch (e) {
      console.log('Directory "' + path + '" could not be found.');
      process.exit();
    }
  }
docs: Asserts that the given path points to a directory and exits otherwise.
  @param {string} path