jHTTP body and code execution order

I was making simple application to see how HTTP request form fields and body look like . So there is a simple HTML form, after filling it and sending with POST method, user receives String represantation of this HTTP request. I am not sure however why one solution works and the others don't. It's probably because I don't fully understand howe callbacks and events work in Node. I would be grateful for explaining why other solutions don't work.

HTML form:

<body>
    <form action ="" method="post" enctype="multipart/form-data">
    <fieldset>
        <label for="name">Imię:</label>
        <input type = "text" id="name" name="name" placeholder="Imię i nazwisko">
        <br>
        <label for="gender">Płeć:</label>
        <select id="gender" name="gender">
            <option value="female">kobieta</option>
            <option value="male">mężczyzna</option>
            <option value="other">inna</option>
        </select>
        <br>
        <label for="mail">Adres email</label>
        <input type = "email" id="mail" name="mail">
        <br>
        <label for="info">Informacje:</label> 
        <textarea id="info" name="info" placeholder="Napisz coś o sobie"></textarea>
        <br>
        <input type = "submit" value = "Zatwierdź"/>    
        <br>
    </form>
</body>

Working NodeJS code:

const http = require('http');
const fs = require('fs');
const port = 3000;
const hostname = '0.0.0.0';
const formidable = require("formidable");
const util = require('util');

const html = fs.readFileSync('form.html');

const server = http.createServer((req, res) =>
{
    if(req.method.toLowerCase() == 'get')
        displayForm(res, html);

    else if(req.method.toLowerCase() == 'post')
        showBody(res, req);
        processFields(res, req);
});

const displayForm = function(res, html)
{
    res.writeHead(200, {'Content-Type': 'text/html', 'Content-Lenghth': 'html.length'});
    res.write(html);
}

const processFields = function(res, req)
    {
        const form = new formidable.IncomingForm(); 

        form.encoding = 'utf-8';
        form.parse(req, (err, fields, files) =>
        {

            res.writeHead(200, {'Content-Type': 'text/plain; charset=utf-8'});
            res.write('received the data:\n\n');    
            res.write(util.inspect(
                {
                    fields: fields,
                    files: files
                }));    
        });
    }

const showBody = function(res, req)
    {
        let body = [];
        req.on('data', (chunk) =>
            {
                body.push(chunk);
            }).on('end', () => 
                {   
                    body = Buffer.concat(body).toString();
                    res.write('\n\nRequest body: \n\n' + body);
                    res.end();
                });
    }

server.listen(port, hostname, () =>
    {
        console.log('Server started on port ' + port);
    }); 

Output in HTTP response:

received the data: { fields: { imie: 'Izabela Łęcka', gender: 'female', mail: 'dssd@cs', info: 'dsds' }, files: {} }

Request body:

-----------------------------212792179519249 Content-Disposition: form-data; name="imie" Izabela Łęcka -----------------------------212792179519249 Content-Disposition: form-data; name="gender" female -----------------------------212792179519249 Content-Disposition: form-data; name="mail" dssd@cs -----------------------------212792179519249 Content-Disposition: form-data; name="info" dsds -----------------------------212792179519249--

Here, where showBody() is a callback for processFields, in a result body array is empty.

const server = http.createServer((req, res) =>
{
    if(req.method.toLowerCase() == 'get')
        displayForm(res, html);

    else if(req.method.toLowerCase() == 'post')
        processFields(res, req, showBody);
});

const displayForm = function(res, html)
{
    res.writeHead(200, {'Content-Type': 'text/html', 'Content-Lenghth': 'html.length'});
    res.write(html);
}

const processFields = function(res, req, callback)
    {
        const form = new formidable.IncomingForm(); 

        form.encoding = 'utf-8';
        form.parse(req, (err, fields, files) =>
        {

            res.writeHead(200, {'Content-Type': 'text/plain; charset=utf-8'});
            res.write('received the data:\n\n');    
            res.write(util.inspect(
                {
                    fields: fields,
                    files: files
                }));

            callback(res, req);
        });
    }

const showBody = function(res, req)
    {
        let body = [];
        req.on('data', (chunk) =>
            {
                body.push(chunk);
            }).on('end', () => 
                {   
                    body = Buffer.concat(body).toString();
                    res.write('\n\nRequest body: \n\n' + body);
                    res.end();
                });
    }

And here processFields() is a callback for showBody(). In result browser is stuck after sending form.

    const server = http.createServer((req, res) =>
{
    if(req.method.toLowerCase() == 'get')
        displayForm(res, html);

    else if(req.method.toLowerCase() == 'post')
        showBody(res, req, processFields);
});

const displayForm = function(res, html)
{
    res.writeHead(200, {'Content-Type': 'text/html', 'Content-Lenghth': 'html.length'});
    res.write(html);
}

const processFields = function(res, req, callback)
    {
        const form = new formidable.IncomingForm(); 

        form.encoding = 'utf-8';
        form.parse(req, (err, fields, files) => /*debugger shows that Node stucks in this method */
        {

            res.writeHead(200, {'Content-Type': 'text/plain; charset=utf-8'});
            res.write('received the data:\n\n');    
            res.write(util.inspect(
                {
                    fields: fields,
                    files: files
                }));
            res.end();
        });
    }

const showBody = function(res, req, callback)
    {
        let body = [];
        req.on('data', (chunk) =>
            {
                body.push(chunk);
            }).on('end', () => 
                {   
                    body = Buffer.concat(body).toString();
                    res.write('\n\nRequest body: \n\n' + body);
                    callback(res, req);
                });
    }

server.listen(port, hostname, () =>
    {
        console.log('Server started on port ' + port);
    }); 

I know that i'm not using callbacks accordingly to Node.js convention (no error as first parameter for callback) but is it a cause?

In first solution,why is result of processFields() written to response before result of showBody(), even if showBody() is invoked first? What is the order of execution? While listniening for 'data' events, showBody() gives back flow control and processFields() is executed before 'end' event is emitted?