Security News
Node.js EOL Versions CVE Dubbed the "Worst CVE of the Year" by Security Experts
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
metal-ajax
Advanced tools
Low-level Metal.js utility to perform Ajax requests. If you're looking for something higher level, take a look at fetch.
import Ajax from 'metal-ajax';
Ajax.request('/url', 'get')
.then(xhrResponse => {
// Handle response
});
Ajax.request('/url', 'post', 'requestBody')
.then(xhrResponse => {
// Handle response
});
Custom request headers and params can bet set
using a MultiMap
from metal-structs.
import {MultiMap} from 'metal-structs';
const headers = new MultiMap();
const params = new MultiMap();
headers.add('content-type', 'application/json');
params.add('foo', 'bar');
Ajax.request('/url', 'get', null, headers, params)
.then(function(xhrResponse) {
// Handle response
});
Ajax.request('/url', 'get')
.then(xhrResponse => {
// Handle response
})
.catch(error => {
// Handle error
});
In order for the progress
listener to work, the response must have
the Content-Length response
header set.
Ajax.request('/url', 'get')
.progress(progress => {
// Fires with a value between 0 and 1 representing the percent
})
.then(xhrResponse => {
// Handle response
})
Install a recent release of NodeJS if you don't have it yet.
Install local dependencies:
npm install
npm test
Check out the contributing guidelines for more information.
FAQs
Metal.js utility to perform Ajax requests
The npm package metal-ajax receives a total of 1,351 weekly downloads. As such, metal-ajax popularity was classified as popular.
We found that metal-ajax demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 10 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
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
Security News
cURL and Go security teams are publicly rejecting CVSS as flawed for assessing vulnerabilities and are calling for more accurate, context-aware approaches.
Security News
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.