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

story-spider

v1.0.4

Published

A TypeScript library for scraping stories from various Vietnamese websites

Readme

Story Spider

Story Spider is a TypeScript library for scraping stories from popular Vietnamese story websites like truyenyy.vn, truyenfull.vn, etc. It features a modular architecture that makes it easy to add support for additional websites.

Features

  • Collect story information (title, description, author, genre, status, total chapters)
  • Get chapter lists with details
  • Retrieve chapter URLs by chapter number
  • Get chapter content in HTML or text format
  • Intelligent content cleaning with html-to-text integration
  • Advanced caching for reduced bandwidth and faster performance
  • Rate limiting to avoid overloading servers
  • Extensible adapter system for supporting multiple websites

Installation

npm install story-spider

Usage

Basic Usage

import { StorySpider, TruyenfullScraper } from 'story-spider';

// Create story spider
const storySpider = new StorySpider({
    rateLimiterOptions: {
      minTime: 1000,
      maxConcurrent: 1,
    }
});

// Register a scraper
storySpider.registerScraper(new TruyenfullScraper());

// Get story information
const storyInfo = await storySpider.scapeStoryInfo('https://truyenyy.vn/truyen/example-story/');
console.log(storyInfo);

// Get chapter list
const chapters = await storySpider.scapeChapterList('https://truyenyy.vn/truyen/example-story/');
console.log(chapters);

// Get chapter content
const chapterContent = await storySpider.scapeChapterContent(chapterUrl);
console.log(chapterContent);

Creating a Custom Scraper

You can create your own scraper for any website by extending the StoryScraper class:

import { StoryScraper, StoryInfo, ChapterInfo } from 'story-spider';

export class CustomScraper extends StoryScraper {
  getSiteIdentifier(): string {
    // Implementation for getting site id
  }

  getSupportedDomains(): string[] {
    // Implementation for getting supported domains
  }

  canHandle(url: string): boolean {
    // Implementation for check if url can handle
  }

  async scapeStoryInfo(storyUrl: string): Promise<StoryInfo> {
    // Implementation for getting story info
  }

  async scapeChapterList(storyUrl: string): Promise<ChapterInfo[]> {
    // Implementation for getting chapter list
  }

  async scapeChapterContent(chapterUrl: string): Promise<string> {
    // Implementation for getting chapter content
  }
}

// Register the scraper
storySpider.registerScraper(new CustomScraper());

Supported Websites

The base library provides infrastructure for scrapers. Specific website scrapers can be implemented separately or contributed to this project.

Dependencies

  • html-to-text: For advanced HTML content cleaning
  • axios: For network requests
  • cheerio: For HTML parsing
  • winston: For logging
  • node-cache: For caching

License

ISC