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

google-contact-saver

v1.0.2

Published

CLI tool dan library Node.js untuk menyimpan kontak ke Google Contacts dengan normalisasi nomor telepon.

Readme

Google Contact Saver

CLI tool dan library Node.js untuk menyimpan kontak ke Google Contacts dengan normalisasi nomor telepon (e.g., 08123456789 → +628123456789).

Fitur

  • Normalisasi nomor telepon otomatis.
  • Cek duplikat sebelum menyimpan.
  • Enkripsi token OAuth.
  • Validasi input nama dan nomor.
  • Logging terstruktur dengan pino.
  • Batch insert untuk menyimpan banyak kontak sekaligus.
  • Dukungan CLI dan programmatic.

Instalasi

Global (CLI)

npm install -g google-contact-saver

Local (Project)

npm install google-contact-saver

Setup Google API

  1. Aktifkan Google People API dan unduh google-credentials.json dari Google Cloud Console.
  2. Letakkan google-credentials.json di root project atau direktori kerja.
  3. Jalankan perintah login:
    google-contact-saver login

Penggunaan

CLI

Login

google-contact-saver login

Simpan Kontak Tunggal

google-contact-saver save --nama "John Doe" --nomor "08123456789"

Simpan Banyak Kontak

Buat file kontaks.json:

[
  { "nama": "John Doe", "nomor": "08123456789" },
  { "nama": "Jane Smith", "nomor": "08134567890" }
]

Jalankan perintah:

google-contact-saver batch --file kontaks.json

Programmatic (Node.js)

Simpan Kontak Tunggal

const { simpanKontak } = require("google-contact-saver");

simpanKontak({ nama: "John Doe", nomor: "08123456789" })
  .then(console.log)
  .catch(console.error);

Simpan Banyak Kontak

const { simpanBanyakKontak } = require("google-contact-saver");

const kontaks = [
  { nama: "John Doe", nomor: "08123456789" },
  { nama: "Jane Smith", nomor: "08134567890" }
];

simpanBanyakKontak(kontaks)
  .then(console.log)
  .catch(console.error);

Logging

  • Menggunakan pino untuk logging terstruktur.
  • Level logging dapat dikonfigurasi via environment variable:
    LOG_LEVEL=debug google-contact-saver save --nama "John" --nomor "08123456789"

CLI Commands

| Perintah | Deskripsi | Contoh | |-----------|--------------------------------------------|---------------------------------------------| | login | Autentikasi OAuth dengan Google. | google-contact-saver login | | save | Simpan kontak tunggal. | google-contact-saver save --nama "John" --nomor "08123456789" | | batch | Simpan banyak kontak dari file JSON. | google-contact-saver batch --file kontaks.json |

Troubleshooting

Error: "Token tidak ditemukan"

  • Pastikan Anda sudah menjalankan:
    google-contact-saver login

Error: "Nomor tidak valid"

  • Pastikan nomor telepon hanya mengandung angka, spasi, +, -, atau ().
  • Contoh nomor valid:
    • 08123456789
    • +628123456789
    • 0812-3456-789

Update Package

Jika ada pembaruan, update package dengan:

npm update -g google-contact-saver