Installation

Each Soff library can be installed independently. Install only what you need.

Tree-shakeable
Import only what you need. Each locale is independently importable.
Zero dependencies
Pure TypeScript with no external runtime dependencies.
Lightweight
Optimized for bundle size, typically <1KB per locale.

Package Managers

# Cron parser
npm install soff-cron

# Holiday calculator
npm install soff-date

# Geographic data
npm install soff-geo

# Document validation
npm install soff-id

# Input masking
npm install soff-mask

# Currency formatting
npm install soff-money

# Phone validation
npm install soff-phone
Requirements
  • Node.js 20 or higher
  • TypeScript 5.0+ (optional, but recommended)

Tree-shaking

All libraries support tree-shaking. Import only the locales you need to minimize bundle size:

// ✅ Good - only Colombia is bundled (~3KB)
import { getHolidays } from 'soff-date/locales/co';

// ❌ Avoid - imports all locales
import { getHolidays } from 'soff-date';

ESM & CommonJS

All libraries ship both ESM and CommonJS builds:

// ESM
import { validateNIT } from 'soff-id/locales/co';

// CommonJS
const { validateNIT } = require('soff-id/locales/co');