# interval-queue

> interval queue

Latest version **1.0.4** (published 2025-02-17) · ISC license · 0 weekly downloads

## Install

```sh
npm install interval-queue
pnpm add interval-queue
yarn add interval-queue
bun add interval-queue
```

## Health

**Score 35/100 (D)** — status: maintenance-mode.

Positive: has types; esm support; no vulnerabilities.

Warnings: low downloads.

Negative: stale; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.4 |
| Published | 2025-02-17 |
| First published | 2025-02-12 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 8.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | patrickmonster |

## Links

- npm: https://www.npmjs.com/package/interval-queue
- npm.io page: https://npm.io/package/interval-queue

## Recent versions

- 1.0.4 (latest) — 2025-02-17
- 1.0.3 — 2025-02-12
- 1.0.1 — 2025-02-12
- 1.0.0 — 2025-02-12

## README

# interval-queue

`interval-queue`는 주기적으로 실행되는 작업을 관리하기 위한 유틸리티 라이브러리입니다. 이 라이브러리는 Node.js 환경에서 작동하며, 다양한 시간 단위로 작업을 예약하고 관리할 수 있습니다.

## 설치

```sh
npm install interval-queue
```
# 사용법
## 기본 사용법
```javascript
import { createInterval, deleteInterval, clearIntervals } from 'interval-queue';

// 1초마다 실행되는 작업 생성
const interval = createInterval(() => {
    console.log('1초마다 실행됩니다.');
}, 1000);

// 인터벌 삭제
deleteInterval(interval);

// 모든 인터벌 삭제
clearIntervals();
```
## 시간 단위 사용법
```javascript
import { createIntervalSecond, createIntervalMinute, createIntervalHour } from 'interval-queue';

// 1분마다 실행되는 작업 생성
const minuteInterval = createIntervalMinute(() => {
    console.log('1분마다 실행됩니다.');
}, 1);

// 1시간마다 실행되는 작업 생성
const hourInterval = createIntervalHour(() => {
    console.log('1시간마다 실행됩니다.');
}, 1);
```

API
createInterval(fn, time, ...args)
주어진 시간 간격으로 함수를 실행합니다.

- fn: 실행할 함수
- time: 실행 간격 (밀리초)
- ...args: 함수에 전달할 인수

`createIntervalSecond(fn, time, ...args)`

주어진 시간 간격(초)으로 함수를 실행합니다.

`createIntervalMinute(fn, time, ...args)`

주어진 시간 간격(분)으로 함수를 실행합니다.

`createIntervalHour(fn, time, ...args)`

주어진 시간 간격(시간)으로 함수를 실행합니다.

`deleteInterval(loop)`

주어진 인터벌을 삭제합니다.

`clearIntervals()`

모든 인터벌을 삭제합니다.


# 라이선스
이 프로젝트는 MIT 라이선스를 따릅니다. 자세한 내용은 LICENSE를 참조하세요.

---
_Source: https://npm.io/package/interval-queue · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
