![38% of CISOs Fear They’re Not Moving Fast Enough on AI](https://cdn.sanity.io/images/cgdhsj6q/production/faa0bc28df98f791e11263f8239b34207f84b86f-1024x1024.webp?w=400&fit=max&auto=format)
Security News
38% of CISOs Fear They’re Not Moving Fast Enough on AI
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
fetch-fetchy
Advanced tools
→ Methods for each HTTP verb means no building request objects
→ API-level error handling means no checking status codes
→ Built-in response parsing means no additional checks and method calls
→ Optional one-time configuration means easy integration for your API
$ npm i --save fetch-fetchy
import { get, post } from 'fetch-fetchy';
/**
* Create a user
*/
post('/user', formData)
.then(onSuccess)
.catch(onError)
/**
* Fetch a user
*/
get('/user/hs9hsbs7')
.then(onSuccess)
.catch(onError)
The default configuration is as follows:
{
json: true,
url: window.location.origin,
headers: { 'Content-Type': 'application/json' },
mode: 'cors'
}
json
If set to true
, request data will automatically be converted to JSON.
url
The url
to be used for api
requests. When a route begins with /
, it is assumed that the request is being made to the application's API. This means that you can define /user
as the route instead of https://myapplicationdomain/user
. If you set url
to https://someotherdomain
and specify /user
as the route, the request will be made to https://someotherdomain/user
. When the route does not begin with /
, the full route will be used.
headers
The headers for requests.
mode
The request mode.
You may override these options for all requests by calling setOptions()
. The default options will be overridden using Object.assign()
. If you wish to apply options for a single request, just pass those options into that request.
import { configure } from 'fetch-fetchy';
/**
* Configure fetch-fetchy
*/
const options = {
url: 'https://myapi.com',
headers: { Authorization: `Bearer ${jwt}`},
}
configure(options);
get(route: String, options: Object) => Promise
post(route: String, body: *, options: Object) => Promise
put(route: String, body: *, options: Object) => Promise
patch(route: String, body: *, options: Object) => Promise
del(route: String, options: Object) => Promise
configure(options: Object) => Object
FAQs
A simplified fetch api
The npm package fetch-fetchy receives a total of 0 weekly downloads. As such, fetch-fetchy popularity was classified as not popular.
We found that fetch-fetchy demonstrated a not healthy version release cadence and project activity because the last version was released 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
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
Research
Security News
Socket researchers uncovered a backdoored typosquat of BoltDB in the Go ecosystem, exploiting Go Module Proxy caching to persist undetected for years.
Security News
Company News
Socket is joining TC54 to help develop standards for software supply chain security, contributing to the evolution of SBOMs, CycloneDX, and Package URL specifications.