IN THE PAST decade, “Tom the Dancing Bug” nearly died.

The comics feature is Ruben Bolling‘s ticket to the Herblock Prize, which he will receive tonight at the Library of Congress, as presented by the Herblock Foundation. But the strip’s mere existence has required commercial ingenuity.

“The cutbacks across the print newspaper world almost killed ‘Tom the Dancing Bug,’ ” says Bolling, the nom-de-toon of Ken Fisher. “As the comic was losing print clients, its Internet presence grew, with a huge increase in readership, but without a replacement of the lost revenue.”

That dip in income forced Bolling in 2012 to launch a subscription club he calls the Inner Hive.

“The Inner Hive saved the comic strip,” Bolling tells The Post’s Comic Riffs, “because I gained a direct relationship with my readers, who now are among its main supporters.

“The Inner Hive has gone from a necessary addition to the revenue streams of Tom the Dancing Bug,” continues Bolling, who has also worked in law and finance, “to one of its true joys.”

Bolling rewards that reader support with an inventive, parody-happy strip (begun in 1990) that can steer toward anything under the sun — and which in 2016 steered hard toward candidate Donald Trump.

“I found Trump’s rise to be absolutely fascinating and terrifying,” says Bolling, who’s based in New York, no stranger to Trump operations. “It’s been like watching a con man insinuate his way into your family.

“‘Tom the Dancing Bug’ has always been about whatever I’ve been thinking about any given week,” he continues, “and for the past year, Trump has permeated my thoughts every week. He took over my comic strip like he took over everything.”

Bolling’s strip is generally so eclectic that he finds a vein of humor even in winning the Herblock, which rewards political cartooning in the spirit of the late Washington Post legend.

“I’m just honored that my peers recognized me in this way,” Bolling says. “It’s a weird comic strip to win an editorial-cartooning award because it’s often not political, and can be absolutely ridiculous. Its main characters have included an australopithecine, an idiot time-traveler, a lawyer for children and a brain in a beaker.

“But I think that reflects the evolution of political cartooning,” he continues, “away from the monolithic paradigm of a newspaper staff cartoonist drawing single panels to a more fluid style, incorporating the Web and different styles of humor.”

Yet for Bolling, there is an aspect of coming full circle, given his first exposure to the work of Herblock, who died in 2001. [Tonight’s Herblock Lecture speaker, Rep. John Lewis (D-Ga.), will also address the influence of Herblock, of whom he was a fan.]

“My first exposure to political cartooning was a signed Herblock book about Nixon that my aunt [Yetta Gruen] gave to me,” says Bolling, who was born in Washington shortly before his family moved to New Jersey. “She worked at The Washington Post’s wedding section, knew I loved cartooning and got Herblock to sign it to me.”

And tonight, several decades later, Bolling will receive a $15,000 check — made out from the Herblock Foundation itself.

Read more: