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

@linkpress/core

v0.1.3

Published

Core library for LinkPress - AI-powered article processing

Readme

@linkpress/core

Core library for LinkPress — the building blocks for AI-powered article processing.

npm version npm license

What's Inside

| Module | Description | |--------|-------------| | ai | Multi-provider AI summarization & classification (Anthropic, OpenAI, Gemini) | | scraper | URL content extraction with Cheerio | | slack | Slack API client & link extraction utilities |

Installation

npm install @linkpress/core

Quick Start

AI Summarization

import { summarizeArticle } from '@linkpress/core';

const summary = await summarizeArticle(
  'Article Title',
  'Full article content...',
  'https://example.com/article',
  {
    provider: 'anthropic',
    apiKey: process.env.ANTHROPIC_API_KEY,
    model: 'claude-sonnet-4-5-20250929',
    language: 'English',
  }
);

console.log(summary.headline);    // Catchy headline
console.log(summary.tldr);        // 2-3 sentence summary
console.log(summary.keyPoints);   // Array of key points
console.log(summary.tags);        // ['AI', 'TypeScript', ...]
console.log(summary.difficulty);  // 'beginner' | 'intermediate' | 'advanced'

Content Classification

import { classifyContent } from '@linkpress/core';

const classification = await classifyContent(
  'Check out this great article about React hooks!',
  'https://blog.example.com/react-hooks',
  'Understanding React Hooks',
  'A deep dive into useState and useEffect',
  {
    provider: 'anthropic',
    apiKey: process.env.ANTHROPIC_API_KEY,
    model: 'claude-sonnet-4-5-20250929',
  }
);

if (classification.shouldCollect) {
  // Process the article
}

URL Scraping

import { scrapeUrl } from '@linkpress/core';

const content = await scrapeUrl('https://example.com/article');

console.log(content.title);       // Page title
console.log(content.description); // Meta description
console.log(content.content);     // Main text content
console.log(content.image);       // og:image URL
console.log(content.sourceLabel); // 'Blog' | 'GitHub' | 'Newsletter' | ...

Slack Integration

import { SlackClient, extractLinksFromMessages } from '@linkpress/core';

const client = new SlackClient({
  token: 'xoxc-...',
  cookie: 'xoxd-...',
});

// Get user info
const user = await client.getAuthUser();

// List conversations
const conversations = await client.getConversationsList();

// Get messages from a channel
const messages = await client.getConversationHistory('C01234567');

// Extract links from messages
const links = extractLinksFromMessages(messages);
// → [{ url: 'https://...', messageText: '...' }, ...]

Module Imports

Import specific modules for tree-shaking:

// Everything
import { summarizeArticle, scrapeUrl, SlackClient } from '@linkpress/core';

// AI only
import { summarizeArticle, classifyContent, fetchModels } from '@linkpress/core/ai';

// Scraper only
import { scrapeUrl, parseHtml } from '@linkpress/core/scraper';

// Slack only
import { SlackClient, extractLinksFromMessages } from '@linkpress/core/slack';

API Reference

AI Module

summarizeArticle(title, content, url, config): Promise<ArticleSummary>

Generate a magazine-style summary of an article.

Returns:

interface ArticleSummary {
  headline: string;      // Catchy headline
  tldr: string;          // 2-3 sentence summary
  keyPoints: string[];   // 3-5 bullet points
  whyItMatters: string;  // Developer perspective
  keyQuote?: string;     // Memorable quote
  tags: string[];        // Topic tags
  difficulty: 'beginner' | 'intermediate' | 'advanced';
}

classifyContent(messageText, url, title, description, config): Promise<ContentClassification>

Classify content for filtering decisions.

Returns:

interface ContentClassification {
  contentType: 'article' | 'announcement' | 'discussion' | 'reference' | 'social' | 'media' | 'internal' | 'other';
  technicalDepth: 'none' | 'shallow' | 'moderate' | 'deep' | 'expert';
  actionability: 'none' | 'awareness' | 'applicable' | 'reference';
  shouldCollect: boolean;
  reasoning: string;
}

fetchModels(provider, apiKey): Promise<ModelInfo[]>

Fetch available models from an AI provider.

Scraper Module

scrapeUrl(url): Promise<ScrapedContent>

Extract content from a URL.

Returns:

interface ScrapedContent {
  title: string;
  description: string;
  content: string;
  siteName?: string;
  image?: string;
  sourceLabel?: string;  // 'Blog' | 'GitHub' | 'LinkedIn' | 'Newsletter' | 'Article'
}

Slack Module

SlackClient

const client = new SlackClient({ token, cookie });

await client.getAuthUser();                    // Get current user
await client.getConversationsList();           // List all conversations
await client.getConversationHistory(channelId); // Get messages
await client.searchConversations(query);       // Search channels

extractLinksFromMessages(messages): ExtractedLink[]

Extract URLs from Slack messages, filtering out internal tools and non-article links.

Used By

LinkPress CLI — Turn Slack links into a personal tech magazine

Author

Changmin (Chris) Kang