npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

news-summarizer

v1.0.3

Published

This is the news summarizer which take a block of news as an input and gives a summarized version of it with alot more accuracy.

Readme

News Summarizer

News Summarizer is a lightweight, TypeScript-based library for summarizing news articles. It processes long-form content into concise summaries by analyzing sentence structure, key metrics, and contextual relevance.

Features

  • Extracts meaningful sentences from lengthy text.
  • Scores sentences based on content patterns and metrics.
  • Optimized for news articles with support for financial, analytical, and action-related text patterns.
  • Easy-to-use API with customizable summary lengths.

Installation

Install the library via npm:

npm install news-summarizer

Usage

Import and use the NewsSummarizer class in your TypeScript or JavaScript project:

import { NewsSummarizer } from "news-summarizer";

const summarizer = new NewsSummarizer();
const text = `
The global economy is expected to grow by 3.5% this year, according to the latest IMF report. Key sectors such as technology and healthcare are projected to see significant gains, while challenges remain in addressing climate change and geopolitical tensions. 
  Governments around the world are introducing new policies to support sustainable development. 
  These measures include investments in renewable energy and incentives for green technologies.
  Companies like Tesla and Apple are leading the charge in innovation, with new products 
  targeting both developed and emerging markets. Market analysts predict robust growth 
  for renewable energy stocks, citing strong demand and favorable policies.
  Despite global uncertainties, the overall outlook remains positive.
  The report also highlights the importance of international cooperation to achieve long-term goals.
`;

const summary = summarizer.summarize(text, 3); // Summarize to 3 sentences
console.log(summary);

Example Output

The global economy is expected to grow by 3.5% this year, according to the latest IMF report. Key sectors such as technology and healthcare are projected to see significant gains, while challenges remain in addressing climate change and geopolitical tensions. Companies like Tesla and Apple are leading the charge in innovation, with new products targeting both developed and emerging markets. Market analysts predict robust growth for renewable energy stocks, citing strong demand and favorable policies. Despite global uncertainties, the overall outlook remains positive.

Methods

summarize(text: string, numSentences: number = 3): string

Generates a summary for the given text.

  • Parameters:
    • text (string): The input text to summarize.
    • numSentences (number, optional): The number of sentences to include in the summary (default: 3).
  • Returns:
    • A string containing the summarized content.

Example

const text = "Your article or content here...";
const summary = summarizer.summarize(text, 5); // Summarize to 5 sentences
console.log(summary);

Development

Local Setup

Clone the repository and install dependencies:

git clone https://github.com/karanjas39/news-summarizer.git
cd news-summarizer
npm install

Build the project:

npm run build

Contribution

Contributions are welcome! Feel free to fork the repository and submit pull requests.

Contact


License

This project is licensed under the MIT License.