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

@rich-automation/lotto

v2.0.5

Published

Lotto module

Readme

@rich-automation/lotto

npm
ci
codecov

@rich-automation/lotto는 headless browser를 활용해 JS 환경에서 로또를 자동으로 구매할 수 있는 인터페이스를 제공합니다.

설치

# npm
npm install @rich-automation/lotto

# yarn
yarn add @rich-automation/lotto

준비 사항

  1. 내부적으로 Playwright 또는 Puppeteer를 사용하므로, Chromium이 사전에 설치되어 있어야 합니다. (링크)
  2. 구매는 동행복권 사이트에서 진행되며, 예치금 충전 기능은 없으므로 미리 계정에 예치금을 충전해두어야 합니다.

사용법

기본 설정

import { LottoService } from '@rich-automation/lotto';
import { chromium } from 'playwright';
import puppeteer from 'puppeteer';

// playwright 로 시작, 모든 기능 사용 가능
const lottoService = new LottoService({
  controller: chromium // puppeteer
});

// puppeteer 로 시작, 모든 기능 사용 가능
const lottoService = new LottoService({
  controller: puppeteer
});

// API 모드로 시작, check / getCheckWinningLink 기능만 사용 가능
const lottoService = new LottoService({
  controller: 'api'
});

옵션 설명:

  • controller: (필수) puppeteer, playwright 모듈 또는 "api"
  • headless: 기본값 false
  • defaultViewport: 기본값 { width: 1080, height: 1024 }
  • logLevel: 기본값 2 (NONE = -1, ERROR = 0, WARN = 1, INFO = 2, DEBUG = 3)
import { LottoService, LogLevel } from '@rich-automation/lotto';

const lottoService = new LottoService({
  controller: chromium,
  headless: true,
  defaultViewport: { width: 1280, height: 720 },
  logLevel: LogLevel.DEBUG
});

로또 구매

const ID = '<YOUR_ID>';
const PWD = '<YOUR_PASSWORD>';

await lottoService.signIn(ID, PWD);

const numbers = await lottoService.purchase(5);

console.log(numbers); // [[ 1, 14, 21, 27, 30, 44 ],[ 4, 5, 27, 29, 40, 44 ],[ 9, 18, 19, 24, 38, 42 ],[ 4, 6, 13, 20, 38, 39 ],[ 8, 9, 10, 19, 32, 40 ]]

당첨 확인

이번 회차 확인:

import { getLastLottoRound } from '@rich-automation/lotto';

const numbers = [
  [1, 2, 3, 4, 5, 6],
  [5, 6, 7, 8, 9, 10]
];

const currentRound = getLastLottoRound();

const result = await lottoService.check(numbers, currentRound);

console.log(result); // [{rank:1,matchedNumbers:[1,2,3,4,5,6]},{rank:5,matchedNumbers:[5,6]]

다음 회차 링크 생성:

import { getNextLottoRound } from '@rich-automation/lotto';

const nextRound = getNextLottoRound();
const link = lottoService.getCheckWinningLink(numbers, nextRound);

console.log(link); // "https://dhlottery.co.kr/qr.do?method=winQr&v=1071q010203040506q050607080910";

API

signIn(id: string, password: string): Promise<string>

동행복권 로그인, 성공 시 로그인 쿠키 반환

signInWithCookie(cookies: string): Promise<string>

쿠키 기반 로그인

purchase(amount?: number): Promise<number[][]>

로또 번호 자동 구매 (1~5 게임)

check(numbers: number[][], round?: number): Promise<{ rank:number; matchedNumbers:number[] }[]>

(API) 당첨 결과 확인

getCheckWinningLink(numbers: number[][], round?: number): string

(API) 당첨 확인 링크 생성

destroy(): Promise<void>

브라우저 인스턴스 종료