Janet Cooke, of the metropolitan staff of The Washington Post, won the 1981 Pulitzer Prize in feature writing yesterday for "Jimmy's World," the story of an 8-year-old heroin addict in southeast Washington.

The Pulitzer for meritorious public service went to the Charlotte (N.C.) Observer for a series that led to increased state efforts to control "brown lung," a disease caused by cotton dust in the nation's textile mills.

Other major awards went to The New York Times, for national reporting and commentary, and to the Longview (Wash.) Daily News for its coverage of the eruption of Mount St. Helens. For his book reviews, Jonathan Yardley of The Washington Star won the Pulitzer for criticism.

And, in a poignant note, the prize for fiction was warded posthumously to an author who killed himself in 1969 for the book. "A Confederacy of Dunces," a comic novel by John Kennedy Toole, was finally published last year after Toole's mother spent years trying to interest someone in the work.

The 65th Pulitzer Prizes, announced yesterday at Columbia University by Michael J. Sovern, president of the university and of the Pulitzer board, honored achievement in 17 categories. For the first time since 1935, the board did not give an award this year in the editorial writing category, and it passed over the music category for the first time since 1965.

The awards, the most distinguished in the field of American journalism, carry a prize of $1,000, except for the public service award, for which a gold medal is presented. The Pulitzer board this year received 1,237 entries, including a record 159 in the field of investigative reporting (special local reporting.)

The winners in that category were Clark Hallas and Robert B. Lowe of the Arizona Daily Star in Tucson, for what the Pulitzer board said was "an attack no one had ever dared threaten" -- an investigation of the University of Arizona Athletic Department that eventually led to the head coach's resignation and indictment on 88 felony counts in an airline ticket fraud scheme.

The prize for editorial cartooning went to Mike Peters of the Dayton (Ohio) Daily News, and the Pulitzer for international reporting was awarded to Shirley Christian of the Miami Herald, whose dispatches from Central America "reported the human stories -- the peasant, the soldier, the landowner," the Pulitzer board said.

In "Jimmy's World," Cooke told the story of a third-generation heroin addict, aged 8, who sat calmly in a living room chair while his mother's lover injected heroin into his arm. The story was published at a time when a new influx of high-quality but cheap heroin onto the streets of the nation's capital had led to a surge in heroin use and a steep increase in the number of heroin deaths in the city.

The story, the Pulitzer board said, "was met by a wave of shock and disbelief," but social workers and teachers confirmed that heroin was being used by others of Jimmy's age. The story also led to a fruitless search for the boy by District of Columbia officials, who once threatened to subpeona Cooke for his identity.

Cooke wrote the story on assignment for the city desk in September 1980. At the time she was a member of the District Weekly staff. The 26-year-old reporter, a native of Toledo, Ohio, came to The Post in January 1980 from the Toledo Blade. She is a graduate of Vassar and the University of Toledo.

The series that brought the Observer the coveted public service award consisted of 22 articles and eight editorials that showed the failure of government and industry officials and physicians to deal effectively with the disease called byssinosis, a constant threat to more than 100,000 textile workers in the Carolinas.

The Daily News of Longview, Wash., which has a circulation of 26,000, produced more than 400 stories on the volcano eruption in two weeks with its small staff, most of whom worked 80 hours the first week, to win its award for local reporting.

The Times' John M. Crewdson won the national reporting award for his coverage of illegal aliens and immigration, which the Pulitzer jury said prompted the Justice Department to begin its own review of the Immigration and Naturalization Service. Dave Anderson of The Times was cited for his sprots columns, particularly those that "commented on the behavior of athletes' agents."

The spot news photography award went to Larry C. Price of the Fort Worth (Tex.) Star Telegram for a photograph showing an execution by firing squad in Liberia. The Pulitzer for feature photography was won by Taro M. Yamasaki of the Detroit Free Press, for photographs of the state prison in Jackson, Mich.

Other Pulitzer awarded yesterday in the area of letters:

Drama, Beth Henley for "Crimes of the Heart."

History, Lawrence A. Cremin, for "American Education: The National Experience, 1783-1876."

Biography, Robert K. Massie, for "Peter the Great: His life and World."

Poetry, James Schuyler, for "The Morning of the Poem."

General nonfictiopn, Carl E. Schorske, for "Fin-de-Siecle Vienna: Politics and Culture."