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

@croco/search-core

v0.0.2

Published

검색 메타데이터, 엔진 추상화, 자동 동기화, 한국어 텍스트 변환을 제공하는 검색 코어 패키지입니다.

Readme

@croco/search-core

검색 메타데이터, 엔진 추상화, 자동 동기화, 한국어 텍스트 변환을 제공하는 검색 코어 패키지입니다.

설치

pnpm add @croco/search-core @croco/events-core

사용법

import { SearchField, SearchService, Searchable } from "@croco/search-core";

@Searchable({ index: "users", autoSync: true })
class UserDocument {
  @SearchField({ searchable: true, filterable: true })
  name!: string;
}

const searchService = new SearchService({ engine: searchEngine });
const result = await searchService.search("users", { query: "홍길동" });
import { derive, textTransforms } from "@croco/search-core";

const derived = derive({ type: "ngram", source: "name", options: { min: 2, max: 3 } });
const chosung = textTransforms.initials("크로코 프레임워크");
void derived;
void chosung;

API 레퍼런스

핵심 클래스

  • SearchEngine, 검색 엔진 구현이 따라야 하는 추상 계약입니다.
  • SearchService, 현재 tenantId를 자동 주입하는 상위 검색 서비스입니다.
  • SearchAutoSync, 인덱스 변경 이벤트를 받아 검색 엔진과 동기화합니다.
  • SearchTransformRegistry, InMemorySearchTransformRegistry, 텍스트 변환 어댑터를 관리합니다.

데코레이터와 변환 도구

  • @Searchable, 문서를 검색 인덱스에 연결합니다.
  • @SearchField, 필드별 검색 옵션을 선언합니다.
  • derive, 파생 필드 구성을 생성합니다.
  • textTransforms, ngram, 자모 분해, 초성, 로마자 변환 유틸리티입니다.

주요 타입

  • SearchQuery, SearchResult, SearchHit, SearchDocument
  • IndexConfig, SearchFieldConfig, SearchDerivedFieldConfig, SearchEngineCapabilities
  • SearchableOptions, SearchFieldOptions, DeriveOptions, SearchTransformRef

이벤트와 문제 타입

  • 이벤트: DocumentIndexedEvent, DocumentDeletedEvent, SearchSyncFailedEvent
  • 문제 타입: MissingTenantProblem, IndexNotFoundProblem, StrategyUnavailableProblem, TransformNotFoundProblem, SearchCapabilityUnavailableProblem

구현 포인트

  • 검색 엔진은 tenantId 기반 격리를 기본으로 가정합니다.
  • autoSync를 사용하면 이벤트 기반으로 인덱스 갱신을 자동화할 수 있습니다.
  • ./ko 서브패스로 한국어 전용 초성, 자모 변환 도구를 별도 import 할 수 있습니다.