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

siputzx-api

v0.0.1

Published

Module Wrapper For Siputzx API

Downloads

19

Readme

SiputzxAPI Wrapper

Wrapper TypeScript untuk SiputzxAPI (https://api.siputzx.my.id) dengan kemampuan otomatis mengambil endpoint.

Instalasi

npm install siputzx-api

Cara Penggunaan

Penggunaan Dasar

import { SiputzxAPI } from 'siputzx-api';

// Inisialisasi client API
const api = new SiputzxAPI({
  BASE_URL: 'https://api.siputzx.my.id',  // Opsional, default ke URL ini
  apikey: 'your-api-key'                  // Opsional
});

// Semua endpoint akan otomatis diambil dari API
await api.initializeEndpoints();

// Metode request generik
async function contohRequest() {
  // Request GET
  const getData = await api.get('/api/endpoint', { param1: 'value1' });
  console.log(getData);
  
  // Request POST
  const postData = await api.post('/api/endpoint', { param1: 'value1' });
  console.log(postData);
}

contohRequest().catch(console.error);

Menggunakan Endpoint AI

import { SiputzxAPI } from 'siputzx-api';

const api = new SiputzxAPI();
await api.initializeEndpoints();

async function testAIEndpoints() {
  try {
    // Menggunakan Llama 3.3
    const llama33Response = await api.ai.llama33({ 
      prompt: 'Be a helpful assistant', 
      text: 'hi' 
    });
    console.log('Respons Llama 3.3:', llama33Response);
    
    // Menggunakan Meta Llama 3.3-70B
    const metaLlamaResponse = await api.ai.metaLlama33_70BInstructTurbo({ 
      content: 'hai' 
    });
    console.log('Respons Meta Llama:', metaLlamaResponse);
    
    // Menggunakan Nous Hermes
    const nousHermesResponse = await api.ai.nousHermes({ 
      content: 'hai' 
    });
    console.log('Respons Nous Hermes:', nousHermesResponse);
    
    // Menggunakan Joko Sijawa
    const jokoResponse = await api.ai.joko({ 
      content: 'hai' 
    });
    console.log('Respons Joko:', jokoResponse);
  } catch (error) {
    console.error('Error:', error);
  }
}

testAIEndpoints();

Auto-Discovery Endpoint

Wrapper ini secara otomatis mengambil dan menyiapkan semua endpoint yang tersedia dari API. Semua endpoint dikelompokkan berdasarkan kategori (seperti "ai" untuk AI endpoints).

import { SiputzxAPI } from 'siputzx-api';

async function explorerEndpoints() {
  const api = new SiputzxAPI();
  
  // Tunggu hingga endpoint selesai di-load
  await api.initializeEndpoints();
  
  // Dapatkan endpoint yang tersedia
  const endpoints = await api.getEndpoints();
  
  // Cek kategori yang tersedia
  console.log('Kategori yang tersedia:', Object.keys(endpoints.routes));
  
  // Contoh pengaksesan kategori "Ai"
  if (endpoints.routes.Ai) {
    console.log('Endpoint AI:', endpoints.routes.Ai.endpoints.map(e => e.name));
  }
  
  // Menggunakan endpoint dari kategori yang ditemukan secara dinamis
  const categoryKeys = Object.keys(api);
  console.log('Kategori yang tersedia di wrapper:', categoryKeys.filter(k => typeof api[k] === 'object'));
}

explorerEndpoints();

Melihat Parameter Contoh

Setiap endpoint memiliki parameter contoh yang dapat diakses:

import { SiputzxAPI } from 'siputzx-api';

async function checkExampleParams() {
  const api = new SiputzxAPI();
  await api.initializeEndpoints();
  
  // Akses parameter contoh untuk endpoint Llama33
  if (api.ai && api.ai.llama33) {
    console.log('Parameter contoh untuk Llama33:', api.ai.llama33.exampleParams);
    // Output: { prompt: 'Be a helpful assistant', text: 'hi' }
  }
}

checkExampleParams();

Fitur

  • 🚀 Otomatis mengambil endpoint dari API
  • 🔍 Auto-discovery endpoint berdasarkan kategori
  • 📝 Parameter contoh untuk setiap endpoint
  • 🔄 Dukungan metode HTTP (GET, POST)
  • 🔐 Dukungan API key authentication