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

livecord

v1.0.2

Published

Livecord API için resmi JavaScript/TypeScript istemci kütüphanesi

Readme

🚀 Livecord

Livecord API için resmi JavaScript/TypeScript istemci kütüphanesi

Modern, tip-güvenli ve kullanımı kolay bir API client kütüphanesi.

📦 Kurulum

npm install livecord
yarn add livecord
pnpm add livecord

🏁 Hızlı Başlangıç

ES Modules / TypeScript

import { livecord } from 'livecord';

const client = livecord('YOUR_API_KEY');

// Guild'ları getir
const guilds = await client.getGuilds();
if (guilds.success) {
  console.log('Guild'lar:', guilds.data);
}

// Kullanıcı bilgisi getir
const user = await client.getUser('123456789');
if (user.success) {
  console.log('Kullanıcı:', user.data);
}

CommonJS

const { livecord } = require('livecord');

const client = livecord('YOUR_API_KEY');

async function main() {
  const guilds = await client.getGuilds();
  console.log(guilds);
}

main();

🎯 API Kullanımı

Client Oluşturma

Basit Yöntem

import { livecord } from 'livecord';

const client = livecord('YOUR_API_KEY');

Detaylı Konfigürasyon

import { LivecordClient } from 'livecord';

const client = new LivecordClient({
  apiKey: 'YOUR_API_KEY',
  baseURL: 'https://api.livecord.tr' // İsteğe bağlı
});

Guild İşlemleri

Tüm Guild'ları Getir

const guilds = await client.getGuilds();

if (guilds.success) {
  console.log('Guild sayısı:', guilds.data.length);
  guilds.data.forEach(guild => {
    console.log(`${guild.name} (${guild.id})`);
  });
} else {
  console.error('Hata:', guilds.error);
}

Belirli Bir Guild Getir

const guild = await client.getGuild('123456789');

if (guild.success) {
  console.log('Guild:', guild.data.name);
  console.log('Üye sayısı:', guild.data.memberCount);
} else {
  console.error('Guild bulunamadı:', guild.error);
}

Kullanıcı İşlemleri

Kullanıcı Bilgisi Getir

const user = await client.getUser('123456789');

if (user.success) {
  console.log('Kullanıcı:', user.data.username);
  console.log('Bot mu?', user.data.bot);
} else {
  console.error('Kullanıcı bulunamadı:', user.error);
}

Sicil (Ceza Kayıtları) İşlemleri

Kullanıcının Sicil Kayıtlarını Getir

// Tüm sicil kayıtları
const sicilKayitlari = await client.getSicilByUserId('123456789');

if (sicilKayitlari.success) {
  console.log('Toplam ceza sayısı:', sicilKayitlari.data.length);
  sicilKayitlari.data.forEach(sicil => {
    console.log(`${sicil.type}: ${sicil.reason}`);
    console.log('Guild:', sicil.guildId);
    console.log('Moderatör:', sicil.moderatorId);
    console.log('Aktif:', sicil.active);
    console.log('Tarih:', sicil.createdAt);
    if (sicil.duration) console.log('Süre:', sicil.duration, 'dakika');
  });
}

// Sadece aktif kayıtlar
const aktifSiciller = await client.getSicilByUserId('123456789', { active: true });
console.log('Aktif ceza sayısı:', aktifSiciller.data.length);

Ham API İstekleri

Daha gelişmiş kullanım için ham API istekleri gönderebilirsiniz:

const response = await client.rawRequest('/custom-endpoint', {
  method: 'POST',
  body: { data: 'example' }
});

if (response.success) {
  console.log('Yanıt:', response.data);
}

🔧 Konfigürasyon

API Anahtarını Güncelleme

client.setApiKey('NEW_API_KEY');

📝 TypeScript Desteği

Bu kütüphane tam TypeScript desteğiyle gelir. Tüm metodlar ve yanıtlar tip-güvenlidir:

import { LivecordClient, Guild, User, LivecordResponse } from 'livecord';

const client = new LivecordClient({ apiKey: 'YOUR_API_KEY' });

// Tip-güvenli kullanım
const guilds: LivecordResponse<Guild[]> = await client.getGuilds();
const user: LivecordResponse<User> = await client.getUser('123456789');

🛡️ Hata Yönetimi

Tüm API çağrıları standart bir yanıt formatı döner:

interface LivecordResponse<T> {
  success: boolean;
  data?: T;
  error?: string;
  message?: string;
}

Hata Kontrolü

const result = await client.getUser('invalid-id');

if (!result.success) {
  console.error('Hata oluştu:', result.error);
  return;
}

// Başarılı durumda result.data kullanılabilir
console.log('Kullanıcı:', result.data.username);

📚 API Endpoints

| Method | Endpoint | Açıklama | |--------|----------|----------| | getGuilds() | GET /guilds | Tüm guild'ları getirir | | getGuild(id) | GET /guild/:id | Belirli guild bilgisini getirir | | getUser(id) | GET /user/:id | Belirli kullanıcı bilgisini getirir | | getSicilByUserId(id, options?) | GET /sicil/:userId | Kullanıcının sicil kayıtlarını getirir |

🌟 Özellikler

  • Modern ES2020+ JavaScript
  • Tam TypeScript desteği
  • ESM ve CommonJS desteği
  • Async/await API
  • Kapsamlı hata yönetimi
  • Tip-güvenli yanıtlar
  • Sıfır bağımlılık
  • Browser ve Node.js desteği

🔗 Bağlantılar

📄 Lisans

MIT License - Detaylar için LICENSE dosyasına bakın.

🤝 Katkıda Bulunma

Katkılarınızı bekliyoruz! Lütfen önce bir issue açın veya mevcut issue'lara göz atın.


Livecord ile Discord botlarınızı ve uygulamalarınızı geliştirme deneyiminizi artırın! 🚀