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

@exieneko/twitter-client

v0.7.0

Published

Twitter API client for Javascript

Readme

twitter-client

Twitter API client for Javascript & Typescript, because I love reinventing the wheel ♡

[!CAUTION] This client uses Twitter's browser API instead of the official paid one
Using this package may get your account suspended. Use at your own risk!

About

This package provides a TwitterClient class for sending requests to Twitter from a single account. This allows full control over the account, including editing your profile and sending tweets

The Pool class can be used for spreading requests out across several automated accounts, but only methods that don't create or modify user-dependent data are allowed

Usage

To use this package, you need a Twitter account to log in with

Since this package will not create a new session using your username and password, you'll need to get the necessary tokens
Log in on twitter.com and get the values for the "auth_token" and "ct0" cookies

import { TwitterClient } from '@exieneko/twitter-client';
import type { User } from '@exieneko/twitter-client/types';

const twitter = new TwitterClient({
    // Your account tokens are entered when initializing the client
    // To allow multiple accounts, use `Pool` which requires an array of tokens instead
    authToken: 'xxxxxxxxxx', // <- auth_token
    csrf: 'xxxxxxxxxxxxxxx'  // <- ct0
});

const [errors, tweet] = await twitter.createTweet({ text: 'Hello world!' });

// Errors is always an array, containing errors from the Twitter API, if there are any
// Errors aren't always fatal and some data can still be returned
if (errors.length > 0) {
    console.error(errors[0].message);
}

// The 2nd element in the array is optional/undefined
if (tweet?.__typename === 'Tweet') {
    const user: User = tweet.author;
    // ...
}

Limitations

Twitter has some protections in place to prevent automated requests. This package attempts to bypass as many as possible, but Twitter may change their API over time and it's possible for this package to become outdated

Broken features:

  • verifyCredentials
  • unblockUser
  • and possibly some other v1.1 endpoints in the future