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

@zelord/e-fetch

v1.0.2

Published

JavaScript의 'fetch' API를 편리하게 사용할 수 있도록 도와주는 TypeScript 기반의 라이브러리입니다.

Downloads

10

Readme

e-fetch

개요

e-fetch는 JavaScript의 'fetch' API를 편리하게 사용할 수 있도록 도와주는 TypeScript 기반의 라이브러리입니다. 이 라이브러리는 HTTP 요청을 다양한 메소드기반으로 사용할 수 있습니다.

특징

  • 'GET', 'POST', 'PUT', 'DELETE' 메서드를 통한 HTTP 요청
  • 다양한 응답 데이터의 Content-Type에 따라 적절한 타입(JSON, HTML, text)으로 응답처리
  • response status code에 따른 에러 메세지를 생성하고 오류반환
  • requestOptions 객체를 통해 headers 옵션포함하여 요청

설치방법

npm install @zelord/e-fetch

사용방법 (JS)

GET요청
fetchWrapper.get(url)

fetchWrapper.get('https://jsonplaceholder.typicode.com/posts/1')

fetchWrapper.get(url, headers)

fetchWrapper.get('https://jsonplaceholder.typicode.com/posts/1', {
  headers: {
    'Content-Type': 'application/json',  
    'Custom-Header': 'CustomValue',      
  }
})

POST요청
fetchWrapper.post(url, body)

fetchWrapper.post('https://jsonplaceholder.typicode.com/posts', {
  title: 'foo',
  body: 'bar',
  userId: 1,
});

fetchWrapper.post(url, body, header)

fetchWrapper.post('https://jsonplaceholder.typicode.com/posts', {
  title: 'foo',
  body: 'bar',
  userId: 1,
}, {
  headers: {
    'Content-Type': 'application/json',  
    'Custom-Header': 'CustomValue',      
  }
});

PUT요청
fetchWrapper.put(url, body)

fetchWrapper.put('https://jsonplaceholder.typicode.com/posts/1', {
  id: 1,
  title: 'foo',
  body: 'bar',
  userId: 1,
});

fetchWrapper.put(url, body, headers)

fetchWrapper.put('https://jsonplaceholder.typicode.com/posts/1', {
  id: 1,
  title: 'foo',
  body: 'bar',
  userId: 1,
}, {
  headers: {
    'Content-Type': 'application/json',  
    'Custom-Header': 'CustomValue',      
  }
});

DELETE요청
fetchWrapper.delete(url)

fetchWrapper.delete('https://jsonplaceholder.typicode.com/posts/1');

예시 코드

const { fetchWrapper } = require('@zelord/e-fetch')

async function runExample() {
  try {
    const getResponse = await fetchWrapper.get('https://jsonplaceholder.typicode.com/posts/1');
    console.log('GET response:', getResponse);

    const postResponse = await fetchWrapper.post('https://jsonplaceholder.typicode.com/posts', {
      title: 'foo',
      body: 'bar',
      userId: 1,
    });
    console.log('POST response:', postResponse);

    const putResponse = await fetchWrapper.put('https://jsonplaceholder.typicode.com/posts/1', {
      id: 1,
      title: 'foo',
      body: 'bar',
      userId: 1,
    });
    console.log('PUT response:', putResponse);

    const deleteResponse = await fetchWrapper.delete('https://jsonplaceholder.typicode.com/posts/1');
    console.log('DELETE response:', deleteResponse);
  } catch (error) {
    console.error('Error:', error);
  }
}

runExample();

라이센스

이 프로젝트는 MIT 라이센스를 따릅니다. 자세한 내용은 LICENSE 파일을 참조하십시오.