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

novelpia

v1.0.134

Published

Novelpia 비공식 TypeScript API 클라이언트

Readme

Novelpia API Client

Novelpia 소설 플랫폼의 API를 TypeScript로 쉽게 사용할 수 있는 클라이언트 라이브러리입니다.

설치

npm install novelpia
# or
pnpm add novelpia

빠른 시작

기본 사용법

import { NovelPiaClient } from "novelpia"

// 클라이언트 초기화
const client = new NovelPiaClient()

// 소설 검색
const results = await client.search({
    search_val: "판타지",
    rows: 20,
})

console.log(`총 ${results.total_cnt}개의 소설 발견`)
results.list.forEach((novel) => {
    console.log(`- ${novel.novel_name} by ${novel.writer_nick}`)
})

사용 예제

소설 검색하기

const client = new NovelPiaClient()

// 기본 검색
const basicSearch = await client.search({
    search_val: "안녕",
})

// 상세 검색
const advancedSearch = await client.search({
    search_val: "판타지",
    page: 1,
    rows: 50,
    sort_col: "count_view", // 조회수 순
    novel_genre: "하렘",
    is_complete: 0, // 연재중인 작품만
    is_challenge: 0,
})

// 결과 처리
console.log(`찾은 소설: ${advancedSearch.total_cnt}개`)
advancedSearch.list.forEach((novel) => {
    console.log({
        id: novel.novel_no,
        title: novel.novel_name,
        author: novel.writer_nick,
        views: novel.count_view,
        likes: novel.count_good,
        genres: novel.novel_genre_arr,
        story: novel.novel_story,
        lastUpdate: novel.last_write_date,
    })
})

큐레이션 조회하기

const client = new NovelPiaClient()

// 밀리언 노벨 큐레이션
const curation = await client.getCuration({
    main_group: 59,
    rows: 100,
})

console.log(`큐레이션: ${curation.conf.title}`)
console.log(`${curation.conf.sub_title}`)

curation.list.forEach((novel) => {
    console.log({
        title: novel.novel_name,
        author: novel.writer_nick,
        genres: novel.novel_genre,
        link: novel.link_url,
    })
})

페이지네이션

const client = new NovelPiaClient()

// 1페이지 (20개씩)
const page1 = await client.search({
    search_val: "소설",
    page: 1,
    rows: 20,
})

// 2페이지
const page2 = await client.search({
    search_val: "소설",
    page: 2,
    rows: 20,
})

console.log(`전체: ${page1.total_cnt}개`)
console.log(`필터된: ${page1.block_cnt}개 제외됨`)

에러 처리

const client = new NovelPiaClient()

try {
    const results = await client.search({
        search_val: "판타지",
    })
    console.log(`찾은 소설: ${results.list.length}개`)
} catch (error) {
    console.error("API 요청 실패:", error.message)
}

커스텀 API URL 사용

// 다른 주소의 API 서버 사용
const customClient = new NovelPiaClient("https://custom.api.com/proc")

const results = await customClient.search({
    search_val: "소설",
})

검색 파라미터

SearchParams

interface SearchParams {
    page?: number // 페이지 번호 (기본: 1)
    rows?: number // 행 개수 (기본: 20)
    search_type?: string // 검색 타입 (기본: 'all')
    search_val?: string // 검색어
    novel_type?: string // 소설 타입
    novel_genre?: string // 장르
    sort_col?: "last_viewdate" | "count_view" | "count_good" // 정렬
    is_complete?: 0 | 1 // 완결 여부
    is_challenge?: 0 | 1 // 챌린지 여부
}

CurationParams

interface CurationParams {
    main_group: number // 그룹 ID
    rows?: number // 행 개수 (기본: 100)
    prev_million_flag?: boolean // 이전 밀리언 플래그
}

응답 타입

소설 정보 (NovelSearch)

{
    novel_no: number                 // 소설 번호
    novel_name: string              // 소설 제목
    writer_nick: string             // 작가 닉네임
    novel_story: string             // 소설 설명
    count_view: number              // 조회수
    count_good: number              // 추천수
    count_book: number              // 북마크 수
    novel_genre_arr: string[]       // 장르 배열
    cover_url: string               // 커버 이미지 URL
    last_write_date: string         // 마지막 업데이트 날짜
    is_complete: number             // 완결 여부
    // ... 기타 필드
}

검색 응답 (NovelSearchResponse)

{
    status: number                  // HTTP 상태 코드
    list: NovelSearch[]            // 소설 목록
    total_cnt: number              // 전체 개수
    block_cnt: number              // 차단된 개수
    block_adult_cnt: number        // 성인 차단 개수
}

테스트

# 테스트 실행
pnpm test

# 커버리지 확인
pnpm test -- --coverage

빌드

# TypeScript 컴파일
pnpm build

# 결과는 dist/ 디렉토리에 생성됨

타입 지원

완벽한 TypeScript 지원과 자동 완성을 제공합니다:

import { NovelPiaClient, type NovelSearchResponse } from "novelpia"

const client = new NovelPiaClient()
const result: NovelSearchResponse = await client.search({
    search_val: "판타지",
})

라이선스

MIT