Installation
Everything you need to get started with Pithos: TypeScript, tree-shaking, and bundler setup.
Install the package
Add Pithos to your project using your preferred package manager. The library is published on npm as a single package that includes every module (Arkhe, Kanon, Zygos, Sphalma, and Taphos), so one install gives you the full toolkit with zero transitive dependencies.
- npm
- pnpm
- yarn
- bun
npm install @pithos/core
pnpm install @pithos/core
yarn add @pithos/core
bun add @pithos/core
Pithos ships zero runtime dependencies and ES modules only.
TypeScript configuration
- Target modern JS to preserve native APIs and full type inference:
{
"compilerOptions": {
"target": "ES2020",
"module": "ESNext",
"moduleResolution": "bundler",
"esModuleInterop": true,
"skipLibCheck": true
}
}
"moduleResolution": "node" works too, but "bundler" is recommended for modern frontend tooling.
- No path mapping required: everything is exposed through package exports.
- Keep
esModuleInteropenabled if your project mixes CJS/ESM.
Tree-shaking and optimal imports
- Import at function/module granularity to keep bundles small:
import { chunk } from "pithos/arkhe/array/chunk";
import { parse } from "pithos/kanon";
import { ok, err } from "pithos/zygos/result/result"; - Avoid
import * as Pithos from "pithos": the package exposes per-file entry points specifically for tree-shaking. - All exports are ESM and side-effect free; modern bundlers will drop unused code automatically.
Compatibility
Bundlers: Vite / esbuild / Rollup / webpack 5+ / Turbopack
Works out of the box (ESM + package exports). Keep build.target at least es2020 to avoid unnecessary downleveling.
Frameworks: Pithos is framework-agnostic. It works with React, Vue, Angular, Svelte, Astro, vanilla JS, or any other JavaScript setup (Node.js, Deno, Bun, browser scripts...).
Quick checklist
- ☐ Install via your package manager.
- ☐ If using TypeScript: set
module=ESNextandtarget>=ES2020in tsconfig. - ☐ Import at file granularity for tree-shaking.
What's next?
- Get Started — See Pithos in action in 5 minutes
- Practical Example — Build a real feature combining multiple modules
- Best Practices — Validate at boundaries, trust the types