
Product
Introducing the Alert Details Page: A Better Way to Explore Alerts
Socket's new Alert Details page is designed to surface more context, with a clearer layout, reachability dependency chains, and structured review.
extend the whatwg fetch - fetch spec,
makes it easier to use.
config - set options
set() - set http header
send() - send body data
query() - set query string
append() - append form data
text() - convert response body to string
json() - convert response body to object
default options
{
mode: 'cors',
cache: 'no-cache',
credentials: 'same-origin'
}
efetch.get(url, options)
.config({
credentials: 'omit'
})
.query({
type: 1
})
.query({
name: 'hello'
})
.then(function(res) {
// fetch response
})
.catch(function(err) {
// ...
})
// get json body
efetch.get(url, options)
.query({
type: 1
})
.send({
name: 'hello'
})
.json()
.then(function(data) {
// response body
})
.catch(function(err) {
// ...
})
// get text body
efetch.get(url, options)
.query({
type: 1
})
.send({
name: 'hello'
})
.text()
.then(function(data) {
// response body
})
.catch(function(err) {
// ...
})
// send json
efetch.post(url, options)
.send({
type: 1
})
.send({
name: 'hello'
})
.then(function(res) {
// fetch response
})
.catch(function(err) {
// ...
})
// send urlencoded
efetch.post(url, options)
.send('type=1')
.send('name=hello')
.then(function(res) {
// fetch response
})
.catch(function(err) {
// ...
})
// send urlencoded
efetch.post(url, options)
.set('content-type', 'application/x-www-form-urlencoded')
.send({
type: 1,
name: 'hello'
})
.then(function(res) {
// fetch response
})
.catch(function(err) {
// ...
})
// set header
efetch.post(url, options)
.set({
'content-type': 'application/json'
})
.send({
type: 1
})
.send({
name: 'hello'
})
.then(function(res) {
// fetch response
})
.catch(function(err) {
// ...
})
// send form (upload file)
efetch.post(url, options)
.append({
filename: 'user.png'
})
.append({
file: document.querySelector('input[type="file"]')files[0]
})
.then(function(res) {
// fetch response
})
.catch(function(err) {
// ...
})
MIT
FAQs
extend the whatwg fetch, makes it easier to use
We found that efetch 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.

Product
Socket's new Alert Details page is designed to surface more context, with a clearer layout, reachability dependency chains, and structured review.

Product
Campaign-level threat intelligence in Socket now shows when active supply chain attacks affect your repositories and packages.

Research
Malicious PyPI package sympy-dev targets SymPy users, a Python symbolic math library with 85 million monthly downloads.