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 🙏

© 2025 – Pkg Stats / Ryan Hefner

retweeter

v1.0.12

Published

Simple bot that retweets

Readme

Retweeter

Simple bot that retweets and likes recent tweets for a topic if they meet some criteria

Node.js CI Build Status Maintainability Code Coverage Scrutinizer Code Quality Codacy Badge StyleCI

How to use

  • Apply for a Twitter Developer Account to access Twitter APIs

    • Once approved, you will have API_KEY, API_KEY_SECRET, ACCESS_TOKEN, ACCESS_TOKEN_SECRET
  • Choose the #interesting_topic_to_retweet you want to search the recent tweets for

  • Choose based on what criteria you would like the retweeter to retweet and like (explained the condig in more details later)

  • Instantiate a Bot object and call retweet function as follow:

try {
    console.log('Starting ...');
    const bot = new Bot({
      screenName: 'REPLACE_YOUR_ACCOUNT_SCREEN_NAME',
      apiConfig: {
        consumer_key: YOUR_API_KEY,
        consumer_secret: YOUR_API_KEY_SECRET,
        access_token: YOUR_ACCESS_TOKEN,
        access_token_secret: YOUR_ACCESS_TOKEN_SECRET,
        timeout_ms: 60 * 1000,
        strictSSL: true,
      },
      tweetConfig: {
        minFavs: YOUR_TWEET_MIN_FAVS,
        minFavsToFollowers: YOUR_TWEET_MIN_FAVS_TO_FOLLOWERS_RATIO,
        hashtagsLimit: YOUR_TWEET_MIN_ALLOWED_HASHTAGS,
        wordBlocklist: YOUR_WORD_BLOCKLIST,
        userConfig: {
          minCreationDiff: YOUR_TWEET_USER_MIN_CREATION_DIFF,
          minFollowers: YOUR_TWEET_USER_MIN_FOLLOWERS,
          minTweets: YOUR_TWEET_USER_MIN_TWEETS,
          userBlocklist: YOUR_USER_BLOCKLIST_IDS
        }
      }
    });

    await bot.retweet({
      q: '#interesting_topic_to_retweet',
      count: YOUR_SEARCH_PARAM_COUNT,
      result_type: YOUR_SEARCH_PARAM_RESULT_TYPE,
      lang: 'en',
      // make sure hashtags are included
      include_entities: true
    });
  } catch (error) {
    console.log(error);
  }

Configs

| Name | Description | Required | Type | | ------------- | ------------- | ------------- | ------------- | | consumer_key | Twitter API key | Yes | string | cconsumer_secret | Twitter API key secret | Yes | string | access_token | Twitter API access token | Yes | string | access_token_secret | Twitter API access token secret | Yes | string | minFavs | Tweet minimum number of favorites for retweeting & liking | Yes | number | minFavsToFollowers | Ratio of tweet favorites to the user followers for retweeting & liking | Yes | number | hashtagsLimit | Maximum number of hashtag that can be in a tweet for retweeting & liking | Yes | number | wordBlocklist | Tweet is ignored if it has any of the blocklisted word | No | string[] | minCreationDiff | Only consider those users who joined tweeter X days ago | Yes | number | minFollowers | Tweet user minimum number of total followers for retweeting & liking | Yes | number | minTweets | Tweet user minimum number of total tweets for retweeting & liking | Yes | number | userBlocklist | Block listed user IDs | No | string[]