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

socialbuffer

v0.1.0

Published

Queue markdown-based social posts to Buffer for X and LinkedIn from the terminal.

Downloads

8

Readme

socialbuffer

Minimal CLI for turning markdown files into queued Buffer posts for X and LinkedIn.

socialbuffer is the public name and primary command. tweetx remains available as a backward-compatible alias for now.

Run from source

Clone the repo, create a local .env, and run the CLI directly from source:

nvm use
cp .env.example .env
node ./bin/socialbuffer.js --help
node ./bin/socialbuffer.js post --file ./example-post.md --dry-run

The root .env is loaded automatically, so source usage works without a global install.

Node 20 is the supported runtime for development and CI.

Global install

Install the CLI globally so socialbuffer is available from any directory:

npm install -g .

When run outside this repo, socialbuffer looks for config in this order:

$SOCIALBUFFER_ENV_FILE
$TWEETX_ENV_FILE
$XDG_CONFIG_HOME/socialbuffer/.env
~/.config/socialbuffer/.env
~/.socialbuffer/.env
~/.config/tweetx/.env
~/.tweetx/.env
./.env

Use ~/.config/socialbuffer/.env for the public config path. The older tweetx config paths still work as legacy fallbacks.

Discover your channel

List Buffer channels:

node ./bin/socialbuffer.js channels

List only X/Twitter channels:

node ./bin/socialbuffer.js channels --service twitter

List only LinkedIn channels:

node ./bin/socialbuffer.js channels --service linkedin

With a global install, the same commands become:

socialbuffer channels --service twitter
socialbuffer channels --service linkedin

First command

node ./bin/socialbuffer.js post --file ./post.md --dry-run

Setup

Set these environment variables in one of the supported env files:

BUFFER_API_KEY=your_buffer_api_key
BUFFER_X_CHANNEL_ID=your_buffer_x_channel_id
BUFFER_LINKEDIN_CHANNEL_ID=your_buffer_linkedin_channel_id
X_BEARER_TOKEN=your_x_bearer_token

X_BEARER_TOKEN is only needed for the read-only analytics command.

Usage

Queue an X post in Buffer:

socialbuffer post --file ./post.md

Queue a LinkedIn post in Buffer:

socialbuffer post --platform linkedin --file ./post.md

Queue a post with one image:

socialbuffer post --file ./post.md --image ./shot.png

Queue a post with one remote image URL:

socialbuffer post --file ./post.md --image-url https://example.com/shot.png

Share immediately:

socialbuffer post --file ./post.md --mode shareNow

Preview the payload without sending anything:

socialbuffer post --file ./post.md --dry-run

Read X analytics:

socialbuffer analytics --username xdevelopers

Notes

  • The first version reads the markdown file as source text and flattens markdown formatting before publish.
  • channels uses Buffer's GraphQL API so it works with the API key from Buffer's API settings page.
  • The CLI auto-loads values from global config files and then lets the current directory's .env override them.
  • post defaults to platform x. Use --platform linkedin to target the configured LinkedIn channel.
  • analytics uses the X API directly and expects X_BEARER_TOKEN in .env or a supported global env file.
  • BUFFER_CHANNEL_ID remains supported as a legacy fallback for X only.
  • YAML frontmatter is stripped if present at the top of the file.
  • The current image path supports one local image or one remote image URL.

Built alongside DocsALot: convert your commits into documentation, social media posts on autopilot.