
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
@teclone/xhr
Advanced tools
Exports list of industry categories, reusable for web project implementation
Fetch API compatible implementation in XMLHttpRequest. Fully promisified. Works in browser like environments, including React Native.
module is available on npm
npm install @teclone/xhr
There are method names for all of these six http methods get, head, options, post, delete, put that you can use to make requests.
By default, the request will never throw even on errors (unlike the Fetch api spec). You need to check the ok property of the response object.
This can be changed by setting options.throwIfNotOk to true or by calling Xhr.throwIfNotOk(true) to set this for every request. The value of throwIfNotOk in ecah request options will always be prioritized ahead of the global settings.
import { Xhr } from '@teclone/xhr';
Xhr.get(url, options).then(response => {
if (response.ok) {
// do something.
}
});
To make it seemless when you want to run in mocked browser environment, Xhr module exports install method to make this possible. Call the install method, passing in the window and document object.
Running in jsdom environment:
import JSDOM from 'jsdom';
import { Xhr } from '@teclone/xhr';
const dom = new JSDOM('<!doctype html><html><body></body></html>', {
url: 'urltomock',
pretendToBeVisual: true,
});
Xhr.install(dom.window, dom.window.document);
FAQs
Exports list of industry categories, reusable for web project implementation
We found that @teclone/xhr 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
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.