let path = 'uploads/io/io/ui/yu/rt/q/'.split('/');
lastEl;
for (var i = path.length - 1; i > 0; i--) {
path = path.join('/');
console.log(path);
fs.rmdirSync(path);
console.log('Удалена директория ' + path);
path = path.split('/');
lastEl = path.pop();
}
let card = $('<div>', { class: 'card'});
let img = $('<img>', { class: 'card-img-top', src: 'img/' + msg[i]['image'], alt: 'Card image cap'});
let card_body = $('<div>', { class: 'card-body shadow-lg bg-white rounded' });
let card_title = $('<h5>', { class: 'card-title' });
card_title.text(msg[i]['title']);
let card_title_category = $('<h6>', { class: 'card-title category' });
card_title_category.text('Категория: ' + msg[i]['category']);
let card_title_date = $('<h6>', { class: 'card-title date' });
card_title_date.text('Дата: ' + msg[i]['date'])
let card_text = $('<p>', { class: 'card-text' });
card_text.text(msg[i]['text']);
let read_button = $('<a>', { class: 'btn btn-primary' });
read_button.text('Читать');
// Упаковываем элемент
card_body.append(card_title, card_title_category, card_title_date, card_text, read_button);
card.append(card_body, img);
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Some blog</title>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.0/css/bootstrap.min.css" integrity="sha384-9gVQ4dYFwwWSjIDZnLEWnxCjeSWFphJiwGPXr1jddIhOegiu1FwO5qRGvFXOdJZ4" crossorigin="anonymous">
<link rel="stylesheet" href="/css/main.css">
<script src="https://code.jquery.com/jquery-3.3.1.min.js" integrity="sha256-FgpCb/KJQlLNfOu91ta32o/NMZxltwRo8QtmkMRdAu8=" crossorigin="anonymous"></script>
<script type="text/javascript" src="js/some_scripts.js"></script>
</head>
<body>
<button type="button" name="button" class="some_button">Кнопка!</button>
<div id="content">
</div>
</div>