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

tweets-digger

v0.0.4

Published

scrape tweets of user from timeline

Downloads

10

Readme

tweets-digger

npm version License: MIT

A Node.js package to scrape tweets and replies from a user's timeline on X (formerly Twitter).

Features

  • Scrape tweets and replies from any public X profile
  • Automated scrolling to load all tweets
  • Save extracted data to JSON file
  • Supports headless browser operation
  • TypeScript support

Installation

npm install tweets-digger

Usage

import { scrapeTweetsOfUser } from 'tweets-digger';

// Replace with your X auth token
const AUTH_TOKEN = 'your-auth-token-here';

// Replace with the username you want to scrape
const USERNAME = 'example_user';

// Optional: Specify custom Chrome/Chromium executable path
const CHROME_PATH = '/usr/bin/chromium';

async function main() {
  try {
    await scrapeTweetsOfUser(USERNAME, AUTH_TOKEN, CHROME_PATH);
    console.log('Scraping completed!');
  } catch (error) {
    console.error('Error:', error);
  }
}

main();

API Reference

scrapeTweetsOfUser(username, auth_token, executablePath?)

Scrapes tweets and replies from a user's timeline.

Parameters

  • username (string): The X username to scrape tweets from
  • auth_token (string): Your X authentication token
  • executablePath (string, optional): Path to Chrome/Chromium executable. Defaults to '/usr/bin/chromium'

Returns

  • Promise: Resolves when scraping is complete. The scraped data is saved to 'data.json' in the current directory.

Getting Your Auth Token

  1. Log in to X (Twitter) in your browser
  2. Open Developer Tools (F12)
  3. Go to Application > Cookies
  4. Find the 'auth_token' cookie value
  5. Copy this value to use with the package

Requirements

  • Node.js 14 or higher
  • Chrome or Chromium browser installed

Dependencies

  • puppeteer: For browser automation
  • TypeScript support included

Contributing

We welcome contributions to tweets-digger! Here's how you can help:

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Install dependencies (npm install)
  4. Make your changes
  5. Run the build to ensure everything works (npm run build)
  6. Commit your changes (git commit -m 'Add some amazing feature')
  7. Push to the branch (git push origin feature/amazing-feature)
  8. Open a Pull Request

Development Setup

  1. Clone your fork:

    git clone https://github.com/your-username/tweets-digger.git
    cd tweets-digger
  2. Install dependencies:

    npm install
  3. Build the project:

    npm run build

Code Style

  • Write clean, readable TypeScript code
  • Follow existing code formatting patterns
  • Add appropriate comments for complex logic
  • Update tests if necessary
  • Update documentation for any new features

License

MIT © lokihammer