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

tw2csv

v1.0.3

Published

Easy CLI tool to gather tweets for data analysis

Downloads

7

Readme

tw2csv

Useful CLI tool for collecting tweets.

If you haven't set up Node.js environment, you should install it.

v0.x -> v1

There are destructive changes from v0.x to v1.x. Please re-setup the app configuration file.

Install

npm install -g tw2csv

How to use

At first, get your application's keys from developer.twitter.com and setup command.

# directory name "tweets" is just an example
$ mkdir ~/tweets
$ cd ~/tweets
$ tw2csv

If there isn't tw2csv.config.json, tw2csv will generate it automatically. You have to set Twitter app's keys to tw2csv.config.json like below.

{
    "appKey": "***************************",,
    "appSecret": "***************************",,
    "accessToken": "***************************",
    "accessSecret": "***************************"
}

Then you can run tw2csv!

$ tw2csv search "Node.js" results.csv

Commands

Search Tweets

$ tw2csv search "KEYWORDS FOR SEARCH" OUTPUT_FILENAME.csv

Options

  • --bot (-b) : Ignore tweets from possible bots. tw2csv detect bots based on the source is on its allow list. So if you need to be careful at the misdetection, I recommend not to turn on.
  • --rt (-r) : Ignore retweets.
  • --quote (-q) : Ignore quote tweets.
  • --mention (-m) : Ignore replies (mentions).
  • --linebreak (-l) : Remove line breaks in tweets and user's bio. Please turn it on if your tool or script have a trouble with multi-lined CSV file.
  • --verbose (-v) : verbose mode. Show all logs on console.

Check API Access Limits

$ tw2csv limit

This will show the API Limit and its reset time like below.

[Info] API Limit ( 74 / 75 ), Reset: 5/31/2022, 10:34:03 PM