Pithos vs Lodash, Zod & Neverthrow
Pithos is organized into five modules. Each solves a specific problem with minimal bundle impact.
Quick Comparison
| Module | vs | Bundle Size (average) | Performance (average) |
|---|---|---|---|
| Arkhe | Lodash | 20.9x smaller | 8.4x faster |
| Kanon | Zod | 4.1x smaller | 11.0x faster |
| Zygos | Neverthrow | 2.7x smaller | 1.6x faster |
When to Use Each Module
Arkhe - Utility Functions
Use Arkhe when:
- You want smaller bundles than Lodash
- You're building a modern app
- You want better TypeScript inference
- You care about supply chain security
Use Lodash instead when:
- You need IE11 support
- Your codebase already uses it heavily
Many Lodash functions have native equivalents now. See Taphos for guidance on what to replace with native JS vs Arkhe.
Kanon - Schema Validation
Use Kanon when:
- You want smaller bundles than Zod
- You need straightforward, type-safe validation without overhead
- You want JIT-compiled validators for maximum performance
- You want zero dependencies
- You're already using Pithos
Use Zod instead when:
- You need complex transforms (
.transform()) - You need async validation
- You need extensive built-in format validators (IP, JWT, CUID, ULID...)
- You're already using it
Zygos - Error Handling
Use Zygos when:
- You want smaller bundles
- You also need Option/Either/Task monads
- You're already using Pithos
- You want generator-based error handling (
safeTry) - You want a drop-in Neverthrow replacement
Use Neverthrow instead when:
- If Neverthrow is your only Pithos use case, the migration cost may not justify it
- You want the "original" implementation
Use fp-ts instead when:
- You want full functional programming
- You need Functor, Applicative, Monad abstractions
- You're comfortable with Haskell-style FP
- You need
pipewith full type class hierarchy
Sphalma - Typed Error Factories
Use Sphalma when:
- You need structured, typed errors with hex codes
- You want consistent error identification across your codebase
- You're using Zygos and want typed error channels
Sphalma has no direct competitor — it fills a gap that most projects solve with ad-hoc error classes or plain strings.
Taphos - Native Equivalence
Use Taphos when:
- You're migrating away from Lodash
- You want to know which Arkhe functions have native equivalents
- You want deprecation guidance before removing a dependency
The Pithos Philosophy
💡 Why kilobytes matter - "it's just a few kB, who cares?"
Every dependency adds up. Validation adds 20 kB. Dates add 15 kB. Utils add 25 kB. State adds 30 kB... Before you know it: 500+ kB of JavaScript that the browser has to download, parse, and execute.
This directly affects user experience. Every extra kilobyte of JavaScript increases parse and execution time, which may impact Core Web Vitals, particularly LCP (Largest Contentful Paint) and INP (Interaction to Next Paint). On mobile devices and slower connections, the difference is even more noticeable.
Less code also means a smaller attack surface: fewer lines to audit, fewer places for vulnerabilities to hide.
That's why every Pithos module is designed to ship only what you actually use.
We're not trying to replace everything. We're trying to:
- Cover 80% of needs with minimal bundle impact
- Stay compatible where it matters (Neverthrow API, Zod shim)
- Point to native when JavaScript caught up (Taphos)
- Stay honest about when other libs are better
Use what works for you. Mix and match if needed.