
Security News
pnpm 11.5 Adds Support for Recognizing npm Staged Publishes
pnpm 11.5 now recognizes npm staged publish approvals in release metadata, preventing those releases from being mistaken for lower-trust package publishes.
pixui-fetch
Advanced tools
优化后的 fetch。
安装:
pnpm add pixui-fetch
import { PixFetch } from 'pixui-fetch'
PixFetch("http://www.xxx")
.then(response => {console.log("Success")})
.catch(error => {console.log("Failed")})
传统 fetch 不会关心 AJAX 是否成功,他只关心从服务器发送请求和接收响应,如果响应失败我们需要抛出异常。
所以如果请求响应为404,但此时仍然会执行 then 里设置的 resolve 回调,如果需要处理404的情况需要额外在 resolve 里使用 response.ok 进行判断后抛出异常。
pix-fetch 对这种请求结果进行了优化,如果请求结果为2xx,则会执行 then 绑定的 resolve 回调,如果为非2xx或者请求失败则都走 reject 回调
fetch('http://localhost:8080')
.then(response => {
if (response.ok) {
return response.json()
} else {
return Promise.reject('ERROR')
}
})
.then(data => console.log('Success'))
.catch(error => console.log('Failed'));
PixFetch("http://www.localhost:8080")
.then(response => {console.log("Success")})
.catch(error => {console.log("Failed")})
FAQs
PixUI Fetch
We found that pixui-fetch demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
pnpm 11.5 now recognizes npm staged publish approvals in release metadata, preventing those releases from being mistaken for lower-trust package publishes.

Security News
Federal audit finds NIST lacked a plan to clear the NVD backlog, wasted funds on duplicate work, and delayed use of CISA data.

Research
/Security News
A mini Shai-Hulud campaign compromised Red Hat Cloud Services npm packages to steal developer and CI/CD secrets during installation.