Back to all posts

What is Utils-Do and How It Might Help You Build Applications for the Dominican Republic

Sep 20, 2019 1 min read Engineering
What is Utils-Do and How It Might Help You Build Applications for the Dominican Republic

Introduction

On one occasion, I was developing a local web application whose requirement was to segment users by municipality. Since the app was designed for the Dominican Republic (where I was born and currently live), I tried to find a package that could speed up the process.

As expected, I found nothing. That’s why I decided to create Utils-Do.


What is Utils-Do?

Utils-Do is a JavaScript package created to provide commonly used functions when building applications for the Dominican Republic’s local market.


What Can You Do?

Currently, the library exports two main objects:

  • Geo — Handles methods related to the geographic information of the country.
  • Validator — Provides validation for common Dominican data formats.

Geo Utilities

The Geo object contains methods to work with provinces and municipalities.

const { Geo } = require("utils-do");

Geo.getProvinces();
// ["Azua", "Bahoruco", "Barahona", "Dajabón", "Duarte", "El Seibo", "Elías Piña", "Espaillat", "Hato Mayor", ...]

Geo.getMunicipalitiesOf("La Romana");
// { Guaymate: [], La Romana: ["Caleta"], Villa Hermosa: ["Cumayasa"] }

Geo.getProvinceByMunicipality("Santo Domingo Este");
// ["Santo Domingo"]

Validator Utilities

The Validator object includes methods for checking common Dominican data patterns, such as ID cards and telephone numbers.

const { Validator } = require("utils-do");

Validator.isAnIde("DO45879189"); 
// false

Validator.isATel("8095564125"); 
// true

Validator.formatToTel("8095564125"); 
// "(809) 556-4125"

Purpose of the Repository

This is an open-source project designed to centralize all the functions developers might need when creating applications for the Dominican market.

  • Written entirely in JavaScript
  • Contains no external dependencies
  • Available via npm and GitHub

You can learn more about this package and its usage by visiting its repositories.


Spotted a typo or have a suggestion? Send me a note.

Get new posts in your inbox

No spam. Just practical notes on engineering, cloud, and AI.