Many IRC communities have shrunk. Different reasons. Things like Discord and mumble, combined with more collaboration and multiplayer competition in games took gamers away from IRC and crippled networks like Gamesurge.
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.