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

haidarcf

v1.0.8

Published

A client library and CLI tool for accessing the CF Bypass.

Downloads

1,341

Readme

haidarcf

Klien API untuk CF Clearance Scraper & Turnstile Solver
Bypass Cloudflare WAF & Turnstile tanpa browser headless.

haidarcf adalah klien ringan yang memungkinkan Anda mengakses fungsionalitas inti dari CF Clearance Scraper API.
Gunakan modul ini atau perintah CLI untuk mengatasi tantangan Cloudflare seperti WAF dan Turnstile tanpa menjalankan browser headless sendiri.


Instalasi

# Menggunakan npm secara lokal
npm install haidarcf

# Atau secara global untuk akses CLI
npm install -g haidarcf

Penggunaan CLI (Command Line Interface)

Anda dapat menggunakan haidarcf langsung dari terminal melalui npx tanpa perlu menulis kode JavaScript:

1. WAF Session (Cookie & Headers Clearance)

npx haidarcf waf-session --url https://example.com/protected

2. Solve Turnstile (Minimal Mode)

npx haidarcf turnstile-min --url https://forms.com/login --sitekey 0x4AAAAAAAT-yE...

3. Solve Turnstile (Maximal Mode)

npx haidarcf turnstile-max --url https://forms.com/login

4. Fetch Rendered HTML Source

npx haidarcf source --url https://spa-website.com/

Options CLI:

| Opsi | Short | Deskripsi | Default | |------|-------|-----------|---------| | --url | -u | Target URL | https://example.com | | --sitekey | -k | Turnstile SiteKey | 0x4AAAAAAAT-yE... | | --proxy | -p | Proxy (host:port / user:pass@host:port) | Opsional |


Penggunaan Modul (JavaScript / Node.js)

Modul ini mendukung:

  • CommonJS (require)
  • ES Modules (import)

Kami merekomendasikan menggunakan destructuring untuk memberi alias haidar menjadi cf.


CommonJS Example

const { haidar: cf } = require('haidarcf');

async function getSession() {
  try {
    // Contoh menggunakan format object
    const session = await cf.wafSession({
      url: 'https://example.com/protected',
      proxy: 'host:port' // opsional
    });

    console.log('Cookies:', session.cookies);
    console.log('User-Agent:', session.headers['user-agent']);
  } catch (error) {
    console.error('Gagal mendapatkan WAF Session:', error.message);
  }
}

getSession();

ES Modules Example (Static Import)

import { haidar as cf } from 'haidarcf';

(async () => {
  try {
    const result = await cf.turnstileMin({
      url: 'https://forms.com/login',
      siteKey: '0x4AAAAAAAT-yE...'
    });

    console.log('Token Turnstile:', result.token);
  } catch (error) {
    console.error('Gagal:', error.message);
  }
})();

ES Modules Example (Dynamic Import)

const haidarPromise = import('haidarcf');

async function runDynamicScraper() {
  const haidarModule = await haidarPromise;

  const cf =
    haidarModule.haidar ||
    haidarModule.haidarcf ||
    (haidarModule.default && (haidarModule.default.haidar || haidarModule.default.haidarcf));

  try {
    const result = await cf.turnstileMin({
      url: 'https://forms.com/login',
      siteKey: '0x4AAAAAAAT-yE...'
    });

    console.log('Token Dynamic Import:', result.token);
  } catch (error) {
    console.error('Gagal menjalankan dynamic import:', error.message);
  }
}

runDynamicScraper();

API Reference

Semua fungsi bersifat async dan akan melempar Error jika terjadi kegagalan.


1. cf.wafSession()

cf.wafSession(url, proxy?)

atau

cf.wafSession({ url, proxy? })

Mengambil cookies dan headers untuk melewati Cloudflare WAF, sehingga request HTTP berikutnya dapat berjalan tanpa challenge.

| Parameter | Tipe | Diperlukan | Deskripsi | |------------|------|-------------|------------| | url | string | Ya | URL target (Contoh: https://example.com/protected) | | proxy | string | Tidak | Proxy opsional (user:pass@host:port) |


2. cf.turnstileMin()

cf.turnstileMin(url, siteKey, proxy?)

atau

cf.turnstileMin({ url, siteKey, proxy? })

Menyelesaikan challenge Cloudflare Turnstile dengan mode minimal.

| Parameter | Tipe | Diperlukan | Deskripsi | |------------|------|-------------|------------| | url | string | Ya | URL target (Contoh: https://forms.com/login) | | siteKey | string | Ya | Site Key (Contoh: 0x4AAAAAAAT-yE...) | | proxy | string | Tidak | Proxy opsional |


3. cf.turnstileMax()

cf.turnstileMax(url, proxy?)

atau

cf.turnstileMax({ url, proxy? })

Mode maksimum dengan simulasi interaksi pengguna alami.

| Parameter | Tipe | Diperlukan | Deskripsi | |------------|------|-------------|------------| | url | string | Ya | URL target (https://forms.com/login) | | proxy | string | Tidak | Proxy opsional |


4. cf.source()

cf.source(url, proxy?)

atau

cf.source({ url, proxy? })

Mengambil HTML yang sudah di-render oleh JavaScript dari suatu halaman.


Penanganan Error

try {
  const token = await cf.turnstileMin({
    url: 'https://forms.com/login',
    siteKey: '0x4AAAAAAAT-yE...'
  });

  console.log('Token:', token);
} catch (err) {
  console.error('haidarcf error:', err.message);
}

Kontak & Pengembang


Lisensi

ISC License.