npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@ribertec/directus-extension-cep-autofill

v1.0.2

Published

Auto-populate address fields using Brazilian postal codes via ViaCEP

Downloads

183

Readme

CEP Autofill for Directus

Automatically populate address fields in Directus using Brazilian postal codes (CEP). This extension integrates with the free ViaCEP API to fetch street, neighborhood, city, and state information when users enter a CEP.

Note: According to Directus CRM limitations, it's impossible to provide translations for the extension. For this reason, although this documentation is in English for marketplace standards, all the interface and validations are in Portuguese (BR).

Features

  • Brazilian CEP input with automatic formatting (xxxxx-xxx)
  • Real-time address lookup via ViaCEP API
  • Configurable field mapping for flexible collection structures
  • Server-side validation (8-digit format)
  • Visual feedback with success/error indicators
  • Formatted display component for read-only views

Installation

Via Directus Marketplace (Recommended)

  1. Navigate to your Directus project
  2. Go to SettingsExtensions
  3. Search for "CEP Autofill"
  4. Click Install

Via npm

npm install @ribertec/directus-extension-cep-autofill

Then restart your Directus instance.

Configuration

  1. Create or edit a collection with address fields (street, neighborhood, city, state)

Create or edit a collection

  1. Add a CEP field:
    • Type: String
    • Interface: Select "Entrada de CEP com Autopreenchimento"

Add a CEP field

  1. Configure field mapping in the interface options:
    • Campo de Logradouro: Enter the name of your street field (e.g., street)
    • Campo de Bairro: Enter the name of your neighborhood field (e.g., neighborhood)
    • Campo de Cidade: Enter the name of your city field (e.g., city)
    • Campo de Estado: Enter the name of your state/UF field (e.g., state)
    • Campo de Complemento: Enter complement field name

Configure field mapping

  1. Optional settings:
    • Ativar Autopreenchimento: Toggle automatic address lookup (default: on)
    • Sobrescrever Campos Preenchidos: Replace existing values when fetching (default: off)

Usage

  1. Enter a Brazilian CEP in the CEP field
  2. When you type the 8th digit, the extension automatically searches for the address
  3. If found, address fields are populated automatically
  4. A green checkmark indicates success; red icon indicates CEP not found
  5. The CEP is stored as 8 digits in the database, displayed formatted in layouts

Example

Input: 01310100 or 01310-100

Result: Automatically fills:

  • Street: Avenida Paulista
  • City: São Paulo
  • State: SP

Editing interface example

API & Data Source

This extension uses the free ViaCEP API - no API key required. The service is maintained by the Brazilian government and provides accurate postal code data for Brazil.

Requirements

  • Directus 10.10.0 or higher

License

MIT License - see LICENSE file for details