An open API service indexing awesome lists of open source software.

https://github.com/bledxs/soff-monorepo

A collection of lightweight, tree-shakeable TypeScript utilities for LATAM business logic - holidays, ID validation, input masking, and currency formatting
https://github.com/bledxs/soff-monorepo

argentina brazil colombia currency holidays javascript latam mask mexico monorepo npm-package tree-shakeable turborepo typescript validation

Last synced: 5 months ago
JSON representation

A collection of lightweight, tree-shakeable TypeScript utilities for LATAM business logic - holidays, ID validation, input masking, and currency formatting

Awesome Lists containing this project

README

          


Soff Logo

Soff Monorepo


A collection of lightweight, tree-shakeable TypeScript utilities for common business logic.


[![CI](https://github.com/bledxs/soff-monorepo/actions/workflows/ci.yml/badge.svg)](https://github.com/bledxs/soff-monorepo/actions/workflows/ci.yml)
[![codecov](https://codecov.io/gh/bledxs/soff-monorepo/branch/master/graph/badge.svg)](https://codecov.io/gh/bledxs/soff-monorepo)
[![License](https://img.shields.io/github/license/bledxs/soff-monorepo)](LICENSE)
[![All Contributors](https://img.shields.io/github/all-contributors/bledxs/soff-monorepo?color=ee8449&style=flat-square)](#contributors)

---

**Zero dependencies** Β· **TypeScript** Β· **Tree-shakeable** Β· **SSR Ready**

## Packages

| Package | Version | Size (gzip) | Description |
| ----------------------------------- | ------------------------------------------------------------------------------------------- | ----------------------------- | ------------------------------------------------------- |
| [soff-cron](./packages/soff-cron) | [![npm](https://img.shields.io/npm/v/soff-cron)](https://www.npmjs.com/package/soff-cron) | ~2KB (Core) / ~3KB (i18n) | Cron expression parser and human-readable formatter |
| [soff-date](./packages/soff-date) | [![npm](https://img.shields.io/npm/v/soff-date)](https://www.npmjs.com/package/soff-date) | ~2KB (Core) / ~4KB (Loc) | Holiday calculator with algorithmic date computation |
| [soff-geo](./packages/soff-geo) | [![npm](https://img.shields.io/npm/v/soff-geo)](https://www.npmjs.com/package/soff-geo) | ~1KB (Core) / ~45-100KB (Loc) | Geographic data for LATAM (Departments, Municipalities) |
| [soff-id](./packages/soff-id) | [![npm](https://img.shields.io/npm/v/soff-id)](https://www.npmjs.com/package/soff-id) | ~0.5KB (Core) / ~1KB (Loc) | ID document validation for LATAM countries |
| [soff-mask](./packages/soff-mask) | [![npm](https://img.shields.io/npm/v/soff-mask)](https://www.npmjs.com/package/soff-mask) | ~3KB (Core) | Input masking utilities |
| [soff-money](./packages/soff-money) | [![npm](https://img.shields.io/npm/v/soff-money)](https://www.npmjs.com/package/soff-money) | ~9KB (Core) | Currency formatting and manipulation |
| [soff-phone](./packages/soff-phone) | [![npm](https://img.shields.io/npm/v/soff-phone)](https://www.npmjs.com/package/soff-phone) | ~0.5KB (Core) / ~1KB (Loc) | Phone number validation and formatting |

## ✨ Features

### πŸš€ Lightweight

Each package is optimized for minimal bundle size. Most packages are under 5KB gzipped.

### 🌳 Tree-shakeable

Import only what you need. Every function and locale is independently importable.

### πŸ“¦ Zero Dependencies

Pure TypeScript with no external runtime dependencies.

### πŸ”· TypeScript First

Full type safety out of the box with exported types and interfaces.

### 🌐 Universal

Works in Node.js, browsers, and edge runtimes (Cloudflare, Vercel, etc.).

### 🌎 LATAM Focus

Built specifically for Latin American business requirements and regulations.

## πŸš€ Quick Start

```bash
# Install individual packages
npm install soff-cron soff-date soff-geo soff-id soff-mask soff-money soff-phone

# Or with pnpm
pnpm add soff-cron soff-date soff-geo soff-id soff-mask soff-money soff-phone

# Or with yarn
yarn add soff-cron soff-date soff-geo soff-id soff-mask soff-money soff-phone
```

### πŸ“š Usage Examples

### soff-cron

```typescript
import { formatCron, validateCron, parseCron } from 'soff-cron';

// Format cron to human-readable text
formatCron('0 9 * * 1-5', { locale: 'en' }); // β†’ 'At 09:00, Monday through Friday'
formatCron('*/15 * * * *', { locale: 'es' }); // β†’ 'Cada 15 minutos'

// Validate cron expression
validateCron('0 0 * * *'); // β†’ { isValid: true }

// Parse cron to structured data
parseCron('0 9-17 * * 1-5'); // β†’ { minute: {...}, hour: {...}, ... }
```

### soff-date

```typescript
import { getHolidays, isHoliday } from 'soff-date/locales/co';

// Get all Colombian holidays for 2025
getHolidays(2025);

// Check if a date is a holiday
isHoliday(new Date('2025-01-01')); // β†’ { key: 'newYear', ... }
```

### soff-geo

```typescript
import { searchMunicipality } from 'soff-geo/locales/co';

// Search for a municipality
searchMunicipality('Medellin'); // β†’ [{ name: 'MedellΓ­n', code: '05001', ... }]
```

### soff-id

```typescript
import { validateCC } from 'soff-id/locales/co';

// Validate Colombian ID
validateCC('1234567890'); // β†’ { isValid: true, ... }
```

### soff-mask

```typescript
import { mask } from 'soff-mask';
import { phoneCO } from 'soff-mask';

// Apply phone mask
mask('3001234567', phoneCO); // β†’ '(300) 123 4567'
```

### soff-money

```typescript
import { Money, COP } from 'soff-money';

// Create and format money
const price = Money.fromDecimal(1500000, COP);
price.format(); // β†’ '$1.500.000'
```

### soff-phone

```typescript
import { validate } from 'soff-phone/co';

// Validate phone
validate('3001234567'); // β†’ { isValid: true, type: 'mobile', ... }
```

## Development

This monorepo uses [Turborepo](https://turbo.build/) and [npm workspaces](https://docs.npmjs.com/cli/v7/using-npm/workspaces).

```bash
# Install dependencies
npm install

# Build all packages
npm run build

# Run tests
npm run test

# Run tests with coverage
npm run test:coverage

# Type check
npm run type-check

# Lint
npm run lint
```

## Repository Structure

```
soff-monorepo/
β”œβ”€β”€ apps/
β”‚ └── docs/ # Documentation website (Next.js)
β”œβ”€β”€ packages/
β”‚ β”œβ”€β”€ soff-date/ # Holiday calculator
β”‚ β”œβ”€β”€ soff-geo/ # Geographic data
β”‚ β”œβ”€β”€ soff-id/ # ID validation
β”‚ β”œβ”€β”€ soff-mask/ # Input masking
β”‚ β”œβ”€β”€ soff-money/ # Currency utilities
β”‚ β”œβ”€β”€ soff-phone/ # Phone validation
β”‚ └── tsconfig/ # Shared TypeScript configs
β”œβ”€β”€ .github/
β”‚ └── workflows/ # CI/CD pipelines
└── turbo.json # Turborepo configuration
```

## Contributing

Contributions are welcome! Please read our [Contributing Guide](CONTRIBUTING.md) for details on our code of conduct and the process for submitting pull requests.

1. Fork the repository
2. Create your feature branch (`git checkout -b feature/amazing-feature`)
3. Commit your changes (`git commit -m 'feat: add amazing feature'`)
4. Push to the branch (`git push origin feature/amazing-feature`)
5. Open a Pull Request

## Versioning

This project uses [Changesets](https://github.com/changesets/changesets) for versioning. Each package is versioned independently.

## License

This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.

## Contributors

Thanks goes to these wonderful people ([emoji key](https://all-contributors.js.org/docs/en/emoji-key)):



Luis C. Rojas
Luis C. Rojas

πŸ’» πŸ“– 🚧 πŸš‡

This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!

---

Made with ❀️ for the LATAM developer community