Generates JSON-formatted directory list.