I'm part of some of the channels you think would be largest on Freenode like #javascript and #nodejs. There may be hundreds of people in the online user list, but it's literally the same 10 people talking every day.
There's 10x that number of people talking daily in just Elm's Slack. I'm on three javascript-related webdev Discord servers that that each have at least 100 unique users interacting daily.
I have to wonder if 90% of people connected to IRC are just echoes in the system, autoreconnecting from old hardware long after their owners have moved on.
In these threads people always say "nah, IRC is doing great!" But frankly I don't think people realize how much IRC communities have shrunk. Its lunch has been eaten and it feels like the only people still around on IRC are aging people who once used it in its prime.
Social media, especially things like Twitter and the various short video sharing services took away the "general chat" demographic -- partially because folks who were closer (real-life friends and family) like to feel closer, and folks who are not tend to be younger, and the younger demographic trends towards newer technologies.
Tech stuff has held up on freenode for a while, but as you point out this isn't always the case. I would argue that freenode is probably safe from too much decline for a while yet -- those of us who are "aging people who once used [IRC] in its prime" (I'm 36, guy, "aging" is a bit harsh :)) also tend to be people with a lot of experience in $technical_topic. If you want to ask questions about $technical_topic, and the people with experience are on IRC, that's where you go.
You've pointed out a lot of Javascript-related stuff is not on IRC. Javascript is a relatively new technology (compared to IRC), Node is relatively newer, and Elm newer yet. The boom in web technologies, and the ability to run native applications written in JS has caused that community to surge. It's also relatively easier to get into Javascript than it is to get into (say) C. So you attract more people, and you're going to attract younger people, and you're going to have a really diverse audience for a wide range of topics. All of a sudden a single channel on a chat network doesn't make much sense anymore, and running an IRC network yourself doesn't seem like fun, so you decide to use Discord or Slack. I think this makes a lot of sense for lots of communities.
For other (especially smaller, or very niche) technical communities, IRC is still a good solution. It's not fair to say that "its lunch has been eaten" -- it'll remain relevant until text-based messaging is no longer the most accessible way to communicate. But there are other, different solutions for similar problems that do a better job of catering to specific audiences. And that's just fine.
Unfortunately, it's kind of a PITA to get unique counts from server stats, which are mostly aggregates. So I can't answer that question. But Freenode's a rather active network.