Security News
pnpm 10.0.0 Blocks Lifecycle Scripts by Default
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
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,208 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
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
Product
Socket now supports uv.lock files to ensure consistent, secure dependency resolution for Python projects and enhance supply chain security.
Research
Security News
Socket researchers have discovered multiple malicious npm packages targeting Solana private keys, abusing Gmail to exfiltrate the data and drain Solana wallets.