aidenybai/cnfast
소개
`cn`보다 25배 빠른 드롭인 대체 구현
웹 및 앱 개발측정된 스타 증가
- in 24h
- 0
- in 7 days
- 0
- in 15 days
- -3
- in 1 month
- -6
서로 겹치는 기간의 순증가량이며 일별 합계가 아닙니다. 측정값이 없으면 비워 둡니다. 스타는 관심도를 나타내며 품질을 보장하지 않습니다.
README.md
Original[!NOTE] Check out
cnby shadcn for an even fastercnpackage.cnfastwill no longer be maintained in favor ofcn. I recommend you go use that package instead!
cnfast
Fast drop-in replacement for tailwind-merge + clsx.
cnfast runs 25× faster than tailwind-merge + clsx across 58 real-world repositories, with byte-identical output. Same API, no code changes.
import { cn } from "cnfast";
cn("px-2 py-1", isActive && "px-4", { "text-red-500": hasError });
// "py-1 px-4 text-red-500"
Install
npm install cnfast
Migrate an existing clsx, classnames, or tailwind-merge project in one command:
npx cnfast migrate
On a shadcn/ui project, add or replace your cn utility through the registry. This rewrites lib/utils.ts to re-export cnfast and installs the package:
npx shadcn@latest add aidenybai/cnfast/cn
Usage
Swap the shadcn/ui cn helper for cnfast:
// before
import { clsx, type ClassValue } from "clsx";
import { twMerge } from "tailwind-merge";
export const cn = (...inputs: ClassValue[]) => twMerge(clsx(inputs));
// after
export { cn } from "cnfast";
cnfast also exports clsx, twMerge, and twJoin.
Development
ni
nr build
nr test
License
MIT
관련 프로젝트 살펴보기
불러오는 중…