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 🙏

© 2025 – Pkg Stats / Ryan Hefner

datocms-plugin-phone-number

v1.1.1

Published

A powerful DatoCMS plugin that transforms standard fields into smart phone number inputs with country code selection. Validates and formats numbers according to international standards while providing flexible output options (text or JSON) to seamlessly i

Readme

DatoCMS Plugin: Phone Number

A powerful DatoCMS plugin that transforms standard fields into smart phone number inputs with country code selection. Validates and formats numbers according to international standards while providing flexible output options (text or JSON) to seamlessly integrate with your development workflow.

Cover image for the plugin

✨ Features

  • Global Phone Number Validation: Eliminate invalid phone numbers in your data with support for all countries worldwide
  • Seamless Integration: Built on react-phone-number-input and Google's libphonenumber-js for industry-standard validation
  • Flexible Field Support: Works with both text fields and JSON fields
  • Smart Formatting: When enabled on text inputs, automatically formats phone numbers to ensure consistency in your code
  • Rich Data: When used with JSON fields, provides the phone number with valuable additional metadata

The plugin ensures you'll never worry about invalid phone numbers in your DatoCMS projects again. Simply enable it on your desired fields and enjoy reliable, properly formatted phone data throughout your content.

📋 Setup & Usage

Installation

Add this plugin via DatoCMS Settings > Plugins > Add (/admin/plugins/new).

Enabling on a Field

  1. Navigate to your model settings in DatoCMS
  2. Select the Text or JSON field you want to enhance
  3. In the Presentation tab, select "Phone Number" from the Field Editor dropdown
  4. Save your changes

Configuration Options

  • Include countries: Select countries you would like to include
  • Exclude countries: Select countries you would like to exclude
  • Default country: Select the default country. This will be automatically set when the field is empty

You can only use include or exclude countries, not both. When one is filled, the other is disabled. You will have to empty it before you can use the other. Based on the included or excluded countries the options in the default country will be updated.

Data Output

  • For Text fields: Stores the formatted international phone number as a string
    {
      "phoneNumber": "+31612345678",
    }
  • For JSON fields: Stores comprehensive phone data
    {
      "phoneNumber": {
        "country": "NL",
        "countryCallingCode": "31",
        "nationalNumber": "612345678",
        "number": "+31612345678",
        "__countryCallingCodeSource": "FROM_NUMBER_WITH_PLUS_SIGN"
      }
    }

👥 Contributing

See contributing.md.