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

post-miner

v1.0.9

Published

SDK for automating login and scraping workflows for social platforms (Facebook, Instagram, LinkedIn, Twitter, etc...) using Puppeteer.

Downloads

14

Readme


👀 Quick Preview

Here’s Post-Miner working on social media sites:


🚀 Features

  • Multi-Platform Support: Facebook, Instagram, LinkedIn, Twitter...
  • 🔐 Automated Login: Credentials or persistent sessions
  • 🍪 Cookie Management: Save/load across runs
  • 🕵️‍♂️ Stealth Mode: Puppeteer-extra for anti-bot detection
  • 📦 Unified API: Consistent interface across all platforms
  • 📚 Multiple Sessions: Isolated sessions with per-platform cookie storage

💡 Use Cases

  • Automatically extract product listings from social media and analyze
  • Build smart bots that log in, collect data, and interact with users autonomously
  • Monitor competitor pages and public profiles across social platforms
  • Build custom search engines or classified ad trackers

📦 Installation

npm install post-miner

🧑‍💻 Basic Usage

import { FacebookController } from 'post-miner';

const fb = new FacebookController('./cookies/facebook.json', {
  email: '[email protected]',
  password: 'your-password',
});

await fb.init();

const page = fb.getPage(); // Puppeteer Page instance
await page.goto('https://www.facebook.com');

await fb.close(); // Close the browser session

🧩 Other Platforms

new FacebookController('./cookies/facebook.json', { email, password });
new InstagramController('./cookies/instagram.json', { email, password });
new LinkedinController('./cookies/linkedin.json', { email, password });
new TwitterController('./cookies/twitter.json', { email, password });

API Methods:

  • .init(): initialize controller
  • .getPage(): get Puppeteer page
  • .getBrowser(): get browser instance
  • .getContext(): get context instance
  • .close(): clean shutdown

Parameters:

  • pathCookies: file path to store/load cookies
  • credentials: { email, password }
  • headless: boolean (default: false)
  • defaultViewport: { width, height } or null

🛠️ Development

git clone https://github.com/mohamad-aljeiawi/post-miner.git
cd post-miner
npm install
npm run dev       # Run test.ts in live dev mode
npm run build
npm run lint      # Lint code
npm run format    # Format code

🗂️ Project Structure

src/
├── core/           # Shared logic: browser, cookies, base controller
├── platforms/      # Platform-specific controllers
├── index.ts        # Entry point

🧱 Add a New Platform

To add support for another website/platform:

  1. Create a new controller in the platforms/ directory.
  2. Extend from BaseController and implement:
    • needsLogin(): logic to detect login screen
    • login(): steps to perform login
  3. Register the new controller in index.ts
  4. Add test case in test.ts

Example template:

import { BaseController } from '../core/base-controller';

class PlatformController extends BaseController {
  constructor(pathCookies, credentials, headless = false, defaultViewport = null) {
    super(pathCookies, 'https://platform.com', headless, defaultViewport);
  }

  protected async needsLogin() {
    // Logic to detect login page
  }

  protected async login() {
    // Login steps
  }
}

Please run npm run format before submitting pull requests.


🙋‍♂️ Author

Built with 💻 by Mohamad Al Jeiawi
Telegram: @mohamad_aljeiawi

If you're building tools around scraping, automation, or AI and looking for a contributor or consultant — let’s talk.


⭐ Support & Feedback

If you find this useful, consider leaving a ⭐ on GitHub.
Pull requests, suggestions, and feedback are always welcome!


📄 License

MIT © Mohamad Al Jeiawi