colombian-plates
v1.1.0
Published
A lightweight, zero-dependency Node.js/TypeScript library to validate, format, and classify Colombian vehicle license plates.
Maintainers
Readme
Colombian Vehicle Plates Library 🇨🇴
A lightweight, zero-dependency Node.js/TypeScript library to validate, format, and classify Colombian vehicle license plates.
Features
- Validation: Check if a plate is valid (e.g.,
ABC123,ABC12D). - Classification: Identify the type of plate (Private, Motorcycle, Diplomatic, Trailer, etc.).
- Formatting: Normalizes inputs (handles lower case, spaces, dashes).
- TypeScript Support: First-class type definitions included.
Visual Examples

Installation
npm install colombian-platesUsage
Validation
import { isValid } from 'colombian-plates';
console.log(isValid('ABC123')); // true
console.log(isValid('ABC-123')); // true
console.log(isValid('ABC12D')); // true (Moto)
console.log(isValid('XYZ')); // falseClassification
import { getPlateType, PlateType } from 'colombian-plates';
const type = getPlateType('ABC123');
if (type === PlateType.PARTICULAR) {
console.log('It is a private car or public vehicle');
} else if (type === PlateType.MOTO) {
console.log('It is a motorcycle');
}React Component Usage
You can use the Plate component to render license plates in your React application.
import { Plate } from 'colombian-plates/dist/components/Plate';
// Basic usage (type inferred from plate number)
<Plate plate="ABC123" />
// Public service vehicle (White background)
<Plate plate="SIT987" type="public" />
// Motorcycle
<Plate plate="XYZ12D" />
// Custom width
<Plate plate="ABC123" width={400} />
// With city
<Plate plate="ABC123" city="BOGOTA D.C." />Supported Plate Types
| Type | Format | Example |
|------|--------|---------|
| PARTICULAR / PUBLICO | 3 Letters, 3 Numbers | ABC123 |
| MOTO | 3 Letters, 2 Numbers, 1 Letter | ABC12D |
| DIPLOMATICO | 2 Letters, 4 Numbers | CC1234 |
| REMOLQUE | R/S + 5 Numbers | R12345 |
License
MIT
