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

lllguard

v1.0.2

Published

[Github](https://github.com/LLL-Studio/LLLGuard) [npm](https://www.npmjs.com/package/lllguard) > **Lightweight Circuit Breaker for Node.js (Zero Dependencies)** > 의존성 제로, 시스템 셧다운을 막아주는 초경량 서킷 브레이커.

Downloads

419

Readme

lllguard

Github npm

Lightweight Circuit Breaker for Node.js (Zero Dependencies)
의존성 제로, 시스템 셧다운을 막아주는 초경량 서킷 브레이커.

⚡ Features

  • 📦 ESM Native Only: Designed exclusively for modern ECMAScript Modules (import/export).
  • 🛡️ Fail Fast Protection: Prevents cascading failures by blocking requests immediately when external services are down.
  • 🔄 Auto Recovery: Automatically tests the connection after a timeout (Half-Open state) and restores traffic if successful.

🚀 Installation / 설치

npm install lllguard

⚠️ Prerequisite / 필수 조건: This package is ESM-only. Ensure "type": "module" is set in your package.json.

본 패키지는 ESM 전용입니다. package.json"type": "module"이 설정되어 있어야 합니다.

🧠 State Machine / 상태 머신

LLLGuard operates on three core states:

  • 🟢 CLOSED (정상): All requests pass through normally. (모든 요청 정상 통과)

  • 🔴 OPEN (차단): External API is failing. All requests are rejected instantly to save resources. (에러 폭주로 인한 차단. 요청 즉시 거절)

  • 🟡 HALF_OPEN (정찰): After a timeout, allows one request to test if the external API has recovered. (차단 시간 종료 후, 상태 복구를 위해 한 번 찔러보는 대기 모드)

💻 Usage / 사용법

🇺🇸 English Guide

Wrap your fragile async functions (like API calls) with LLLGuard. If it fails consistently, the circuit will OPEN and protect your server.

import { LllGuard, CircuitBreakerError } from 'lllguard';

// Circuit opens after 5 failures, recovers after 10 seconds.
const guard = new LllGuard({ 
  failureThreshold: 5, 
  recoveryTimeout: 10000 
});

try {
  const data = await guard.execute(async () => {
    return await fetch('[https://unstable-api.com/data](https://unstable-api.com/data)');
  });
  console.log(data);
} catch (error) {
  if (error instanceof CircuitBreakerError) {
    console.error("Blocked by lll-guard. Wait for recovery.");
  } else {
    console.error("API Error:", error.message);
  }
}

🇰🇷 한국어 가이드

불안정한 비동기 함수(외부 API 호출 등)를 LLLGuard로 감싸서 실행하세요. 에러가 연속으로 발생하면 차단기가 내려가고 내 서버의 리소스를 보호합니다.

import { LllGuard, CircuitBreakerError } from 'lllguard';

// 5번 실패하면 차단기를 내리고, 10초(10000ms) 뒤에 복구를 시도합니다.
const guard = new LllGuard({ 
  failureThreshold: 5, 
  recoveryTimeout: 10000 
});

try {
  const data = await guard.execute(async () => {
    return await fetch('[https://unstable-api.com/data](https://unstable-api.com/data)');
  });
  console.log(data);
} catch (error) {
  if (error instanceof CircuitBreakerError) {
    console.error("차단기가 내려가 요청이 거절되었습니다.");
  } else {
    console.error("API 호출 중 에러 발생:", error.message);
  }
}