Skip to main content

installation 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 install @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
    }
    }
tip

"moduleResolution": "node" works too, but "bundler" is recommended for modern frontend tooling.

  • No path mapping required: everything is exposed through package exports.
  • Keep esModuleInterop enabled 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 = ESNext and target >= ES2020 in tsconfig.
  • ☐ Import at file granularity for tree-shaking.

What's next?