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

@rtcoder/simple-summary

v1.1.0

Published

Text summarizer using Node.js

Downloads

51

Readme

simple-summary

Extractive text summarization library for Node.js. Automatically selects the most important sentences from a given text using frequency analysis and word clustering.

Installation

npm install @rtcoder/simple-summary

Usage

const summarize = require('@rtcoder/simple-summary');

const text = `The Internet is a global system of interconnected computer networks.
It carries a vast range of information resources and services, such as the World Wide Web.
The origins of the Internet date back to research during the 1960s.
Email is one of the most widely used communication tools on the Internet.`;

const result = summarize(text);
console.log(result);

API

summarize(text, [options])

| Parameter | Type | Description | |-----------|------|-------------| | text | string | Text to summarize | | options.n | number | Number of top words used for scoring (default: 100) | | options.clusterThreshold | number | Max distance between words in a cluster (default: 5) |

Returns a string with the selected sentences joined by newlines. Returns an empty string for invalid or empty input.

Options example

const result = summarize(text, {
    n: 50,             // consider only top 50 most frequent words
    clusterThreshold: 3,  // tighter word clusters
});

How it works

  1. Sentence extraction — splits the input into sentences
  2. Frequency analysis — tokenizes words, removes stop words, counts frequency
  3. Sentence scoring — for each sentence, finds clusters of important words and scores them based on density: score = (important_words)² / cluster_length
  4. Filtering — returns sentences scoring above mean + 0.5 * std_deviation

License

Apache 2.0