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

oolio

v0.2.0

Published

A universal API client library

Downloads

20

Readme

oolio

범용 API 클라이언트 라이브러리입니다. RESTful API를 쉽게 호출할 수 있도록 도와줍니다.

설치

npm install oolio

사용법

기본 설정

import oolio from "oolio";

// API 라우트 정의
const routes = {
  auth: {
    login: {
      method: "post",
      path: "/auth/login",
      payload: ["email", "password"],
    },
    register: {
      method: "post",
      path: "/auth/register",
      payload: ["email", "password", "name"],
    },
  },
  user: {
    getProfile: {
      method: "get",
      path: "/user/profile",
    },
    updateProfile: {
      method: "put",
      path: "/user/profile",
      payload: ["name", "avatar"],
    },
  },
};

// oolio 클라이언트 초기화
const api = oolio({
  routes,
  getAuthorizeToken: () => localStorage.getItem("token"),
  baseUrl: "https://api.example.com",
});

API 호출

// 로그인 API 호출
const response = await api.auth.login({
  email: "[email protected]",
  password: "1234",
});

// 프로필 조회
const profile = await api.user.getProfile();

// 프로필 업데이트
const updateResult = await api.user.updateProfile({
  name: "John",
  avatar: "profile.jpg",
});

라우트 설정 옵션

const routes = {
  user: {
    // GET 요청
    getProfile: {
      method: "get",
      path: "/user/profile",
    },

    // POST 요청 (데이터 전송)
    updateProfile: {
      method: "post",
      path: "/user/profile",
      payload: ["name", "age"],
    },

    // 파일 업로드
    uploadAvatar: {
      method: "post",
      path: "/user/avatar",
      payload: ["userId"],
      files: ["avatar"],
    },

    // 경로 파라미터 사용
    getUser: {
      method: "get",
      path: "/user/{userId}",
    },

    // 인증 불필요
    publicData: {
      method: "get",
      path: "/public/data",
      authorization: false,
    },
  },
};

에러 처리

try {
  const response = await api.auth.login({
    email: "[email protected]",
    password: "1234",
  });
} catch (error) {
  console.error("API Error:", {
    status: error.status,
    statusText: error.statusText,
    data: error.data,
  });
}

라우트 설정 옵션

각 라우트는 다음 속성을 가질 수 있습니다:

  • method: HTTP 메소드 (get, post, put, delete 등)
  • path: API 엔드포인트 경로
  • payload: 요청에 포함될 데이터 필드 목록 (선택사항)
  • authorization: 인증 필요 여부 (기본값: true)
  • files: 파일 업로드 필드 목록 (선택사항)

특징

  • 라우트 기반의 API 클라이언트
  • 자동 인증 토큰 처리
  • 파일 업로드 지원
  • 경로 파라미터 지원
  • FormData를 사용한 데이터 전송
  • 통일된 에러 처리 형식
  • TypeScript 지원

라이센스

MIT