West Ham lead through Jonathan Spector and could have more but for a combination of last-ditch defending by Barnsley and wasteful finishing by the hosts.
The American slotted neatly into the far corner when Mark Noble's effort was deflected into his path on 29 minutes. It was a stroke of luck which an impressive Hammers side probably deserved for their complete dominance of the game.
Barnsley have keeper Luke Steele to thank that it is only 1-0. Zavon Hines will be furious that he failed to score from two yards after Barrera squared to him with a delightful ground pass from wide right. Steele blocked the shot and the rebound was cleared.
Spector's goal, his third of the season, had been coming. Championship Barnsley spent most of the match pressed back in their final third. Mark Noble regularly cut out the Tyke's efforts to clear their lines.
Obina has been at the heart of much of the Hammers' best play, dropping deep to stitch midfield and attack together and feed Frank Nouble, with Hines churning up the left wing.
Minutes before the goal, Pablo Barrera spurned a golden chance to open the scoring when he headed wide at the far post from close range on 25 minutes, from Luis Boa Morte hanging cross from wide left.
The miss denied the Irons the lead their play probably deserved to that point, so Spector's goal eased the pressure felt by all at Upton Park.
Earlier in this FA Cup round three tie, Hines scuffed a shot into keeper Luke Steel after a short pass combo between Frank Nouble and Victor Obina squared the ball to the youngster 12 yards out, on eight minutes.
The busy Obina soon afterwards got in a great position in the box but dragged his shot wide of the far post.
Visitors Barnsley were on the back foot in most the exchanges, defending right on the 18 yard line as the Hammers tried to pass their way through the white shirts, a tactic which drew applause and groans in equal measure from home fans.
The speed on the left flank from West Ham was more than Barnsley could cope with.
The Tykes had showed the first attacking intent of the game with a flowing passing move up the pitch which put Adam Hammill through on goal in the penalty area, with only four minutes gone. Tomkins' late tackle a averted disaster for the hosts.
On 34 minutes, Goran Lovre scuffed his shot straight at Robert Green after a slip by Tomkins put him in for a rare chance.
A convincing display so far by West Ham and no less than expected by fans and everyone during troubled times.
Comments: Our rules
We want our comments to be a lively and valuable part of our community - a place where readers can debate and engage with the most important local issues. The ability to comment on our stories is a privilege, not a right, however, and that privilege may be withdrawn if it is abused or misused.
Please report any comments that break our rules.
Read the rules here