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

@mdevsky/idphone

v1.0.6

Published

Utilitas untuk mengecek provider dari nomor telepon.

Readme

idphone

idphone berfungsi untuk validasi nomor tlepon indonesia

Getting Started

Prerequisites

  • Node.js 14+

✨ Fitur Utama

  • 📝 Validasi Nomor - Verifikasi format nomor telepon Indonesia
  • 🔄 Normalisasi Dinamis - Konversi otomatis ke format 62xxxxx, 08xxxxx, +62xxxxx
  • 🏢 Cek Provider - Identifikasi operator seluler (Telkomsel, Indosat, XL, dll)
  • Performa Tinggi - Proses cepat dan efisien
  • 🎯 Mudah Digunakan - Syntax sederhana

📋 Format yang Didukung

idphone mendukung berbagai format nomor telepon Indonesia:

  • 08xxxxxxxxxx (Format lokal)
  • 62xxxxxxxxxx (Format internasional tanpa +)
  • +62xxxxxxxxxx (Format internasional dengan +)

📦 Instalasi

npm install idphone

atau menggunakan yarn:

yarn add idphone

🚀 Cara Penggunaan

Import Module

import { IdPhone } from "idphone";

Validasi Nomor

Cek apakah nomor telepon valid:

// Validasi nomor telepon
console.log(IdPhone.isValid("085878885384")); // true
console.log(IdPhone.isValid("0085878885384")); // false (format salah)
console.log(IdPhone.isValid("081234567890")); // true

Cek Provider

Identifikasi operator seluler dari nomor:

let number = new IdPhone();

// Cek provider nomor
console.log(number.checkProvider("08xxxxxx", "08"));
/*
 Output: 
{
    number: 08xxxxxx,
    provider: [indosat],
    normalize: 08xxxxxx,
    isValid: true,
    validMessage: number is valid
}
*/

Contoh Penggunaan Lengkap

import { IdPhone } from "idphone";

const phone = new IdPhone();

// Validasi dan normalisasi
const phoneNumber = "085878885384";

if (IdPhone.isValid(phoneNumber)) {
  console.log("Nomor valid!");

  // Cek provider
  const provider = phone.checkProvider(phoneNumber);
  console.log("Provider:", provider.provider); // Indosat
} else {
  console.log("Nomor tidak valid!");
}

📚 API Reference

IdPhone.isValid(phoneNumber)

Memvalidasi apakah nomor telepon memiliki format yang benar.

Parameters:

  • phoneNumber (string): Nomor telepon yang akan divalidasi

Returns:

  • boolean: true jika valid, false jika tidak valid

Example:

IdPhone.isValid("089999999999"); // true

checkProvider(phoneNumber, normalizeType)

Mengidentifikasi operator seluler dari nomor telepon.

Parameters:

  • phoneNumber (string): Nomor telepon yang akan dicek
  • normalizeType (string)(opsional): type normalisasi nomor

Returns:

  • object: Objek berisi informasi nomor
    • provider (array): Nama operator (Telkomsel, Indosat, XL, Axis, Three, dll)
    • number (string): nomor yang diidentifikasi
    • normalize (string): nomor yang telah di normalisasi
    • isValid (boolean): hasil validasi nomor
    • validMessage (string): pesan valid

Example:

const phone = new IdPhone();
phone.checkProvider("08xxxxxx");

🎯 Provider yang Didukung

idphone dapat mengenali berbagai operator seluler Indonesia:

  • 📱 Telkomsel (0811, 0812, 0813, 0821, 0822, 0823, 0852, 0853)
  • 📱 Indosat (0814, 0815, 0816, 0855, 0856, 0857, 0858)
  • 📱 XL Axiata (0817, 0818, 0819, 0859, 0877, 0878)
  • 📱 Axis (0838, 0831, 0832, 0833)
  • 📱 Three (0895, 0896, 0897, 0898, 0899)
  • 📱 Smartfren (0881, 0882, 0883, 0884, 0885, 0886, 0887, 0888, 0889)

🛠️ Teknologi

  • Runtime: Node.js
  • Language: JavaScript/ES6+
  • Module System: ES Modules

💡 Contoh Kasus Penggunaan

1. Validasi Form Registrasi

import { IdPhone } from "idphone";

function validateRegistrationForm(data) {
  if (!IdPhone.isValid(data.phoneNumber)) {
    return {
      valid: false,
      message: "Nomor telepon tidak valid",
    };
  }

  return { valid: true };
}

3. Analisis Provider untuk Marketing

import { IdPhone } from "idphone";

function analyzeCustomerProviders(phoneNumbers) {
  const phone = new IdPhone();
  const providerStats = {};

  phoneNumbers.forEach((number) => {
    const { provider } = phone.checkProvider(number);
    providerStats[provider] = (providerStats[provider] || 0) + 1;
  });

  return providerStats;
}

🤝 Kontribusi

Kontribusi sangat diterima! Jika Anda ingin berkontribusi:

  1. Fork repository ini
  2. Buat branch fitur baru (git checkout -b feature/AmazingFeature)
  3. Commit perubahan Anda (git commit -m 'Add some AmazingFeature')
  4. Push ke branch (git push origin feature/AmazingFeature)
  5. Buat Pull Request

📝 Changelog

Version 1.0.0

  • ✨ Fitur validasi nomor telepon
  • ✨ Normalisasi dinamis ke berbagai format
  • ✨ Pengecekan provider operator seluler
  • ✨ Support format 08, 62, dan +62

📄 Lisensi

Distributed under the MIT License. See LICENSE for more information.

👨‍💻 Author

mdevSky