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

tckn-utils

v1.0.0

Published

Türkiye Cumhuriyeti Kimlik Numarası (TCKN) doğrulama ve üretim araçları

Readme

tckn-utils

Türkiye Cumhuriyeti Kimlik Numarası (TCKN) doğrulama ve üretim araçları.

🚀 Kurulum

npm install tckn-utils

veya

bun add tckn-utils

📖 Kullanım

import { verify, generate, format } from 'tckn-utils';

// TCKN Doğrulama
console.log(verify('12345678901')); // false - geçersiz TCKN
console.log(verify(12345678901)); // false - number olarak da kullanabilirsiniz

// Geçerli rastgele TCKN üretme
const randomTCKN = generate();
console.log(randomTCKN); // "98765432109" - rastgele geçerli TCKN
console.log(verify(randomTCKN)); // true - üretilen TCKN her zaman geçerlidir

// TCKN Temizleme
console.log(format('123-456-789-01')); // "12345678901" - sadece rakamlar
console.log(format('123 456 789 01')); // "12345678901" - boşluklar temizlenir

🔧 API

verify(tckn: string | number): boolean

Verilen TCKN'nin geçerli olup olmadığını kontrol eder.

Parametreler:

  • tckn: Doğrulanacak TCKN (string veya number)

Döndürür:

  • boolean: TCKN geçerli ise true, değilse false

Örnek:

verify('98765432109'); // true veya false
verify(98765432109);   // number olarak da kabul eder

generate(): string

Geçerli rastgele bir TCKN üretir.

Döndürür:

  • string: 11 haneli geçerli TCKN

Örnek:

const newTCKN = generate();
console.log(newTCKN); // "12345678901" - rastgele geçerli TCKN

format(tckn: string | number): string

TCKN'yi temizler ve düzenler (sadece rakamları alır).

Parametreler:

  • tckn: Temizlenecek TCKN (string veya number)

Döndürür:

  • string: Temizlenmiş TCKN

Örnek:

format('12345678901'); // "12345678901"
format('123-456-789-01'); // "12345678901" - rakam olmayan karakterleri temizler
format('123 456 789 01'); // "12345678901" - boşlukları temizler

🧮 TCKN Algoritması

TCKN algoritması şu kurallara göre çalışır:

  1. 11 haneli bir sayıdır
  2. İlk hane 0 olamaz
  3. 10. hane: 1, 3, 5, 7 ve 9. hanelerin toplamının 7 katından, 2, 4, 6 ve 8. hanelerin toplamının çıkarılmasıyla elde edilen değerin 10'a bölümünden kalan
  4. 11. hane: İlk 10 hanenin toplamının 10'a bölümünden kalan

🧪 Test

Projeyi test etmek için:

bun run dev

🔨 Build

bun run build

📄 Lisans

MIT

🤝 Katkıda Bulunma

Katkılarınızı bekliyoruz! Issue açabilir veya pull request gönderebilirsiniz.