{"size": 311, "ext": "js", "max_stars_repo_path": "fs-module/code/deleteDirectory.js", "max_stars_repo_name": "Akshaya101/nodeX", "max_stars_repo_stars_event_min_datetime": "2022-03-03T12:43:52.000Z", "max_stars_repo_stars_event_max_datetime": "2022-03-18T22:56:21.000Z", "max_issues_repo_path": "fs-module/code/deleteDirectory.js", "max_issues_repo_name": "Akshaya101/nodeX", "max_issues_repo_issues_event_min_datetime": "2022-03-07T06:05:12.000Z", "max_issues_repo_issues_event_max_datetime": "2022-03-11T06:30:06.000Z", "max_forks_repo_path": "fs-module/code/deleteDirectory.js", "max_forks_repo_name": "Akshaya101/nodeX", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": 8, "max_issues_count": 4, "max_forks_count": null, "avg_line_length": 25.9166666667, "max_line_length": 83, "alphanum_fraction": 0.6752411576}
const { rmdir } = require('fs/promises');

async function deleteDirectory(path) {
  try {
    await rmdir(path);
    console.log(`Deleted directory ${path}`);
  } catch (error) {
    console.error(`Got an error trying to delete the directory: ${error.message}`);
  }
}

deleteDirectory('new-directory-renamed');