Taiwanese officials today turned a large area around the American Embassy into a barbed-wire no-man's-land and advised foreigners to stay off the street after yesterday's violent demonstrations against the U.S. diplomatic pullout.

At the same time, Taipei residents copied their Communist rivals in Peking by launching a widespread campaign of wallposters and impromptu street-corner speeches-all attacking the United States. "Send Carter to the mainland to sell peanuts," said one wallposter, commenting on the American decision to recognize Peking and close its embassy here.

Double rows of metal barriers with barbed wire closed off a quarter mile-wide area around the American Embassy bulding, where Marines used tear gas to disperse demonstrators last night. At least 400 Taiwanese police-along with many buses, squad cars, emergency vehicles and a fire engine-remained inside the barricade and stared out at small crowds of students looking in at them.

U.S. officials ordered the American officers club in Taipei and an enlisted club called the China Seas to close by 6 P.M. tonight and Monday. Both club buildings were slightly damaged and at least two cars outside the China Seas were overturned last night by rampaging Taiwanese youth.

The U.S. Armed Forces Radio here broadcast throughout the day a recommendation by American and Taiwanese officials that "Americans and all other foreigners remain off the streets today." American schools here were ordered to be closed Monday.

About 5,000 Americans live here, including 700 noncombat servicemen who will be withdrawn from the island within four months under the agreement to shift recognition to mainland China.

Although crowds of young people gathered around town were not openly hostile to American passersby, several Taiwanese continued to show strong feelings about the American decision, which came without warning here early yesterday morning. A taxi-cab driver waiting at the Grand Hotel refused to take an American journalist to his intended destination, the American Embassy building.

"You're an American devil," he yelled several times until the journalist left the taxicab.

Wallposters went up in several areas of the city in an odd echo of a similar cammpaign in mainland China in recent weeks. Like the Peking wallposters, the unusual outpouring of individual opinion here had some official blessing, although few if any of the Taipei posters suggested criticism of the local government, as had many of those in Peking. Many of them supported a call to rally around the Nationalist Chinese government here and askked all "patriots" to sign a petition in support of it.

"The dignity of China (Taiwan) has been sold out by the foreign devils," said a poster near the Taiwan Normal University. "One man can only wear one pair of shoes, one car can only have one driver, one nation can only have one heart," it said.

tJust outside the American Embassy barricade on busy Loyang Stree, about 100 young people gathered to stare at the barded wire festooned with Nationalist Chinese flags and listen to some young orators.

"We people on Taiwan have been too quiet and meek. If we don't speak out, the world will ignore us," one young man told an approving audience. He punctuated the speech by leading the group in several shouts of "Down with American!"

Taiwaese President Chiang Ching-kuo, who already has bitterly denounced the American decision, met today with several military leaders to discuss its impact on the island's preparations against attack from the mainland. American analysts consider such an attack unlikely, but President Carter insisted on the right to continue to sell some defensive arms to the island and received tacit approval from Peking.

Taiwan's vice foreign minister, Fredericak Chien, said the government believes it faces a new threat from the mainland. "We think our enemy could have been encouraged by this new move to take untoward action toward us," he told foreign reporters.

But asked if he had any knowledge of troop movements by Chinese on the mainland, Chien replied: "We have not received such military inteligence."

Taiwanese Premier Y.S. Sun met with leading businessmen and economic experts. Businessmen were assured at the meeting that the government would continue several major capital investment projects like new port facilities and atomic power plants designed to make the island more economically independent.

The government has not yet disclosed a new dat for legislative elections, scheduled for Dec. 23 but postponed immediately after Carter's decision was announced. The government apparently wished to avoid heated tempers over a volatile issue in the last days of the campaign that might result in the kind of major riot that marred elections here a year ago. Several antigovernment candidates have help government candidates whenever said they think the U.S. pullout will the election campaign is resumed.

An American Embassy official said only a skeleton staff would be working at the embassy Monday and that he did not know when the full U.S. staff would be called back to work. A U.S. spokesman said the American consular office, which handles visa and immigration work in another part of the city, would be closed completely for a while.

Barbed wire also was strung across entrances to the compound of the U.S.-Taiwan Defense Command and the U.S. military commissary on busy Chung Shan Road. At the Taiwan Normal University, an American student, Reuven Ben Yuhmin of New York City, said he was preparing his own wallposter to express his sympathy friends. He said many had asked him to write a letter to Carter and that he had felt some of the difficulties of being an American in this angry city this weekend.

"A girl was going to go hiking in the mountains today with me," he said, but after the announcement, she found she had no time for an American.