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 🙏

© 2024 – Pkg Stats / Ryan Hefner

cathay-fetch

v2.3.5

Published

* 封装了isomorphic * 封装统一response为json * 默认status处理(目前主要PC) * 400 通用错误交互处理 * 306 RESTFUL URL REDIRECT

Downloads

30

Readme

About

  • 封装了isomorphic
  • 封装统一response为json
  • 默认status处理(目前主要PC)
    • 400 通用错误交互处理
    • 306 RESTFUL URL REDIRECT

使用方法(与原生fetch保持一致)

fetch(url, options)

example


import fetch from '@cathay/fetch';

fetch('./test.json', {
    body: {
        "a1": 1,
        "a2": 2
    }
}).then((resultJson)=>{
    console.log(daresultJsonta);
})

options默认值

另外, options设置了默认值, 默认值为

{
    credentials: 'include',
    headers: {
        'Content-Type': 'application/json'
    }
}

History

2.3.5

  • 修改DingTalkAppId
  • 修改DingTalk回调地址

2.3.1

  • 更新库
  • 添加虎符集成

2.2.8

  • 错误文案提醒更改
  • eslint format

2.2.7

  • update font-size to 14px

2.2.6

  • 文案优化
  • 样式优化

2.2.5

  • 更改链接地址

2.2.4

  • memory only /api url
  • 增减黑名单域名 ,memory不记录,目前有bbs

2.2.1

  • username支持中文编码

2.2.0

  • 去掉username校验,以便可以花名登陆

2.1.20

  • bugfix of PUT content-type

2.1.17

  • inverse this.fetchCanBeRecover about times calc

2.1.16

  • bugfix of this.fetchCanBeRecover

2.1.14

  • status: 399 -> 306
  • 恢复 README

2.0.0

  • 默认 POST -> GET

0.5.0

  • 修改nginx默认不支持下划线变量的问题, 参见:http://stackoverflow.com/questions/22856136/why-underscores-are-forbidden-in-http-header-names

0.4.0

  • 除404外,增加400, 500错误,直接Promise.reject

0.3.0

  • options中扩展jsonPrefixBody属性, 废弃isJava第三参数

0.2.0

  • bugfix
  • 工程化更改, 发布前需要进行build

0.1.0

初始版本,核心功能