Getting info from JSON

        const counterName = interaction.guild.channels.cache
            .filter(channel =>"ticket_"))
            .map(channel => parseInt("_")[1]))

            const fs = require('fs');
            const path = require('path');

            const data = fs.readFileSync(path.resolve(__dirname, './tickets.json'));
            const tickets = JSON.parse(data);       

            const ticketId = ((counterName[counterName.length - 1] || 0) + 1).toString().padStart(4, '0')

            fs.writeFileSync(path.resolve(__dirname, './tickets.json'), JSON.stringify(tickets, null, 2));

            const createdChannel = await interaction.guild.channels.create("ticket_" + ((counterName[counterName.length - 1] || 0) + 1).toString().padStart(4, '0'), {`

Hello, this is my code for countering ticket channels, like 0001, 0002, 0003 etc. but i have one simple problem, how i can getting info from tickets.json? Because now i getting info from channel name, but its bad for me, because if i close ticket and delete it, the function"ticket_") it will make the next ticket be 0001 again because there is no channel named ticket_0001 etc.
I am quite inexperienced in this, so if someone could please tell me what to do, I would be grateful, thanks everyone! I made this using the tutorials but I'm bad at programming so I don't know how to do it.
In JavaScript you use dot notation to reference keys inside an object