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

swiftcn

v1.0.3

Published

CLI for swiftcn - shadcn/ui inspired SwiftUI components

Readme

swiftcn CLI

Command-line tool for adding swiftcn components to your SwiftUI project. Built with Node.js and TypeScript.

Prerequisites

  • Node.js 20+

Install

npm install -g swiftcn

Or use directly with npx:

npx swiftcn@latest <command>

Commands

init

Initialize swiftcn in your project. Creates a swiftcn.json config file, installs theme files, and optionally sets up SDUI infrastructure.

swiftcn init                       # Interactive prompts
swiftcn init -y                    # Use defaults, skip prompts
swiftcn init --sdui                # Include SDUI infrastructure
swiftcn init -p Components         # Custom components path
swiftcn init --theme-path Theme    # Custom theme path
swiftcn init --sdui-path App/SDUI     # Custom SDUI path (implies --sdui)

| Option | Description | Default | |--------|-------------|---------| | -p, --path <path> | Path to components directory | Components | | --theme-path <path> | Path to theme directory | Theme | | --sdui | Include SDUI infrastructure | false | | --sdui-path <path> | Path to SDUI directory (implies --sdui) | SDUI | | -y, --yes | Skip prompts and use defaults | false |

add <component>

Add a component to your project. Copies the component source files into your configured directory.

swiftcn add button               # Add a single component
swiftcn add button -f            # Overwrite existing files
swiftcn add button --no-sdui     # Skip SDUI extension file
swiftcn add button -f --no-sdui  # Force without SDUI

| Option | Description | Default | |--------|-------------|---------| | -f, --force | Overwrite existing files | false | | --no-sdui | Skip SDUI extension file | includes SDUI |

list

List all available components.

swiftcn list              # Compact list
swiftcn list -v           # Show variants, sizes, and SDUI info
swiftcn list --verbose    # Same as -v

| Option | Description | Default | |--------|-------------|---------| | -v, --verbose | Show detailed information | false |

Available Components

| Component | Description | |-----------|-------------| | button | CNButton — customizable button with size and variant options | | card | CNCard — container with rounded corners and shadow | | input | CNInput — text input with label and error states | | switch | CNSwitch — toggle switch for boolean values | | badge | CNBadge — small status indicator badge | | slider | CNSlider — range input control |

Development

# Install dependencies
npm install

# Build
npm run build

# Watch mode
npm run dev

# Run tests
npm test

# Run tests in watch mode
npm run test:watch

# Test coverage
npm run test:coverage

# Type check
npm run typecheck

Architecture

Service-based architecture with dependency injection:

src/
├── index.ts                    # Entry point, creates container
├── container.ts                # DI container
├── commands/                   # Thin orchestration layer
│   ├── init.ts
│   ├── add.ts
│   └── list.ts
├── services/                   # Core business logic
│   ├── index.ts                # Re-exports
│   ├── GitService.ts           # Git clone & cleanup
│   ├── FileService.ts          # File ops (copy, readJson, writeJson)
│   ├── RegistryService.ts      # Registry loading & component lookup
│   ├── ConfigService.ts        # swiftcn.json read/write
│   └── FetcherService.ts       # Shared fetch logic
├── types/                      # Centralized Zod schemas
│   ├── index.ts
│   ├── config.schema.ts
│   ├── registry.schema.ts
│   └── options.schema.ts
├── utils/
│   ├── ui.ts                   # Terminal UI (@clack/prompts)
│   ├── paths.ts                # Path sanitization
│   ├── errors.ts               # SwiftCNError + ErrorCode enum
│   └── constants.ts            # ALLOWED_REPO_URLS, REGISTRY_URL, VERSION
└── __tests__/
    ├── commands/               # Command unit tests + helpers
    ├── services/               # Service unit tests
    ├── types/                  # Schema validation tests
    └── utils/                  # Utility unit tests

Commands are thin orchestrators that receive a Container via factory functions. Services handle all business logic and are independently testable. The registry is fetched from GitHub at runtime.