The Democratic Party teetered on the verge of yanking the presidential nomination from Hillary Clinton eight weeks before Election Day — with Vice President Joe Biden, Sen. Bernie Sanders and others actively angling to take her out.

That’s just one of the bombshell revelations from former Democratic National Committee Chair Donna Brazile in her new book, according to The Washington Post, which obtained a copy ahead of its Tuesday publication.

In the book — titled “ Hacks: The Inside Story of the Break-ins and Breakdowns That Put Donald Trump in the White House ”— Brazile blasts the former secretary of state’s “anemic” campaign, which she says gave off “the odor of failure” long before Election Day, took its minority voters for granted and forced out a stream of “stupid” and “stiff” messages.

And she describes a deeply dysfunctional Democratic Party that had been “stripped . . . to a shell” by “three titanic egos” — Clinton, President Barack Obama and Debbie Wasserman Schultz, who was Brazile’s predecessor as DNC chair.

The scheme to remove Clinton from the presidential race mushroomed on Sept. 11, when the nominee collapsed on the sidewalk after making an early exit from a memorial service at Ground Zero.

The alarming tumble was captured by an amateur videographer and rocketed around the Internet within minutes, seeming to confirm longstanding rumors — stoked by Donald Trump — that she was in precarious health.

Brazile writes that when she saw Clinton two days earlier at a Manhattan event, she was nursing a “rattled cough” and was “wobbly on her feet.”

Her aides covered up that Clinton had pneumonia and kept her sickness under wraps until two hours after her streetside fainting spell. Brazile called that decision “shameful.”

Under DNC rules, Brazile had the power to call a “special meeting” to vote in a replacement nominee if a candidate cannot physically continue to campaign. The 447 members of the national committee would have carte blanche to choose a new ticket.

Brazile says she threatened the Clinton campaign with that power on several occasions — and came close to invoking it on Sept. 12.

She received calls that morning from Biden’s chief of staff and from Sanders’ campaign manager — both with messages that their bosses wanted to discuss the matter. It was unclear whether Brazile ever talked to Biden or Sanders herself.

Brazile heard from former Maryland Gov. Martin O’Malley, who had made a brief run at the nomination.

And she got a visit from a high-level Clinton campaign official, Charlie Baker, who was there “to make sure that Donna didn’t do anything crazy.”

“Again and again I thought about Joe Biden,” Brazile says, as she pondered multiple political pairings who could grab the campaign reins from Clinton and her running mate, Sen. Tim Kaine of Virginia.

Her final choice would have been Biden and Sen. Cory Booker of New Jersey, she writes. Brazile believed Biden and Booker would appeal to the working-class voters that she feared Clinton had lost touch with.

But she could not pull the trigger.

“I thought of Hillary, and all the women in the country who were so proud of and excited about her,” Brazile writes. “I could not do this to them.”

Brazile had been the DNC’s vice chair until July 2016, when Wasserman Schultz was forced out of the job on the eve of the national convention by the release of internal party e-mails on WikiLeaks.

The e-mails showed a pattern of bias against Sanders and other Clinton primary opponents that critics said rigged the nomination in Clinton’s favor.

In her book, Brazile writes that she found a scandalous amount of financial mismanagement within the party, including “ridiculous” perks for Wasserman Schultz — a Chevy Tahoe with driver, a personal “body woman” and an entourage of “hangers-on and sycophants.”

Despite its $2 million debt, the party kept two top consulting firms on $25,000-per-month retainers and continued to pay an Obama pollster $180,000 a year.

A chapter of the book released Thursday by Politico set off an uproar with Brazile’s description of a shady campaign-finance deal Wasserman Schultz had struck in secret.

The scheme allowed the Clinton campaign to vacuum up thousands of dollars beyond donors’ legal contribution limits by using the DNC and its state party committees as pass-through accounts. But the set-up left the party nearly bankrupt, Brazile charged.

The arrangement also put the Clinton campaign in effective control of the party nearly a full year before she was formally declared its presidential nominee — leading Brazile to erupt in frustration.

“Y’all keep whipping me and whipping me and you never give me any money or any way to do my damn job,” she says she shouted at top Clinton aides. “I am not going to be your whipping girl!”

But Clinton staffers rebuffed her suggestions and treated her, she says, like “Patsey the slave.”

Brazile, who managed Al Gore’s presidential campaign in 2000, writes that she warned Clinton’s staff of a lack of interest and energy among voters, particularly in Hispanic and African-American communities.

She recalls that she saw no Clinton campaign signs as she visited neighborhoods across the country — except in campaign field offices.

The campaign, headquartered in Brooklyn and run by the 30-something Robby Mook, exuded an air of “self-satisfaction and inevitability,” Brazile complains.

“You half-expected to see someone in a lab coat walk by” in the “antiseptic” atmosphere, she says, comparing it to a hospital ward where “someone had died.”

Brazile says she found the campaign’s young, underpaid staffers too tightly wound.

She recalled the advice of former California Congressman Tony Coelho, who once asked her about a campaign staff, “Are the kids having sex? Are they having fun?”

Brazile recalls Coelho advising her that if the kids were not having sex or fun, “let’s create something to get that going, or otherwise we’re not going to win.”

“I didn’t sense much fun or [sex] in Brooklyn,” she notes dryly.

Instead, Brazile writes, Mook was so focused on stats and analytics that he “missed the big picture.”

Brazile reserves special venom for Brandon Davis, Mook’s deputy and her go-between to the campaign.

“Brandon often rolled his eyes as if I was the stupidest woman he’d ever had to endure on his climb to the top,” Brazile writes, treating her like a “crazy, senile old auntie.”

Brazile also describes her effort to get the Trump campaign to join the Democrats in denouncing Russian interference in the election.

Obama national security adviser Susan E. Rice and former Attorney General Eric Holder advised her to focus on the Russian threat in August 2016, she writes, making her suspect Kremlin operatives placed a listening device in the DNC executive suite.

Brazile says she approached RNC chief strategist Sean Spicer and Republican Party Chair Reince Priebus at a Trump-Clinton debate that fall — to no avail.

“I could see [Spicer’s] eyes dart away like this was the last thing he wanted to talk to me about,” she writes.