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

pnslab-ai-sdk

v1.0.0

Published

PNS AI Hub SDK - AI 서비스를 쉽게 사용할 수 있는 JavaScript/Node.js SDK

Readme

@pns-lab/ai-sdk

PNS AI Hub 서비스를 쉽게 사용할 수 있는 JavaScript/Node.js SDK입니다.

설치

npm install @pns-lab/ai-sdk

빠른 시작

import { AIClient } from '@pns-lab/ai-sdk';

// 클라이언트 생성
const client = new AIClient({
  apiKey: 'pns_sk_live_xxx',      // API 키
  encryptionKey: 'your_64_hex'     // 암호화 키
});

// AI와 대화
const response = await client.chat('안녕하세요!');
console.log(response.text);

스트리밍

// 실시간 스트리밍 응답
for await (const chunk of client.chatStream('긴 이야기를 해줘')) {
  process.stdout.write(chunk);
}

모델 선택

// Claude Sonnet 4.5 (기본값, 가장 추천)
const response = await client.chat('질문', { model: 'claude-sonnet-4.5' });

// Nova Lite (빠른 응답)
const response = await client.chat('질문', { model: 'nova-lite' });

옵션 설정

const response = await client.chat('창의적인 이야기를 해줘', {
  model: 'claude-sonnet-4.5',
  maxTokens: 2000,        // 최대 응답 길이
  temperature: 0.9,       // 창의성 (0.0~1.0)
  system: '당신은 창의적인 작가입니다'  // 시스템 프롬프트
});

사용량 확인

const usage = await client.getUsage();
console.log(`이번 달 사용: ${usage.currentMonthTokens.toLocaleString()} 토큰`);
console.log(`남은 토큰: ${usage.remainingTokens.toLocaleString()}`);

에러 처리

import { AIClient, AuthenticationError, TokenLimitError } from '@pns-lab/ai-sdk';

try {
  const response = await client.chat('안녕');
} catch (error) {
  if (error instanceof AuthenticationError) {
    console.log('API 키가 올바르지 않습니다');
  } else if (error instanceof TokenLimitError) {
    console.log('이번 달 토큰 한도를 초과했습니다');
  }
}

API 키 발급

API 키는 PNS Portal에서 발급받을 수 있습니다.

요구사항

  • Node.js 18.0.0 이상

라이선스

MIT License