
Security News
ECMAScript 2025 Finalized with Iterator Helpers, Set Methods, RegExp.escape, and More
ECMAScript 2025 introduces Iterator Helpers, Set methods, JSON modules, and more in its latest spec update approved by Ecma in June 2025.
Simplest fETCH wrapper I could come up with to reduce boilerplate code when using fetch
on a daily basis while keeping as much compatibility with standard as possible
setch
functions with default optionsnpm i setch
// basics, see docs for details
import { setch, makeSetch, mime } from 'setch'
// capture common parameters for reuse
const setchMyApi = makeSetch(
baseUrlString, // final url will be baseUrlString + urlString
{ headers: { accept: mime.json } }, // will be merged with options, headers too
200, // expected status, will throw if it isn't, can be overridden and flexible, see docs
)
// same as setch, but uses captured parameters too
const json = await setchMyApi(urlString, options).then(r => r.json())
but there's not much to it really, have a look at source if you're curious :^)
FAQs
Simplest fetch wrapper
The npm package setch receives a total of 419 weekly downloads. As such, setch popularity was classified as not popular.
We found that setch demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers 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
ECMAScript 2025 introduces Iterator Helpers, Set methods, JSON modules, and more in its latest spec update approved by Ecma in June 2025.
Security News
A new Node.js homepage button linking to paid support for EOL versions has sparked a heated discussion among contributors and the wider community.
Research
North Korean threat actors linked to the Contagious Interview campaign return with 35 new malicious npm packages using a stealthy multi-stage malware loader.