Registry / testing / ajx
library0.1.0jsnpmunverified

Simple fetch library for HTTP requests with cancellation support. Version 0.1.0, requires Node >=4. Provides a minimal API for GET requests and a CancelToken mechanism to abort requests. Less feature-rich than axios or node-fetch, intended for personal use with low overhead.

npm install ajx
INSTALL
IMPORT
SIG · AJX
A
ajx
testingjavascriptv0.1.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

ajx
const ajx = require('ajx')
import ajx from 'ajx'
CommonJS-only; no ESM support
ajx.get
ajx.get(url, {cancelToken})
ajx.get(url).then(…)
Returns Promise; use async/await or .then
CancelToken
const ct = ajx.CancelToken.new()
new ajx.CancelToken()
Static method new() creates instance; cannot use 'new'

Shows CommonJS require, async GET request, and error handling.

const ajx = require('ajx'); async function fetchExample() { try { const html = await ajx.get('http://example.com/'); console.log(html); } catch (err) { console.error('Error:', err); } } fetchExample();
Debug
Known issues
breakingPackage is in early version (0.1.0); API may change without notice.
fix
Pin to exact version and test upgrades.
affects: >=0.1.0
gotchaCancelToken.new() is a static method, not a constructor.
fix
Use ajx.CancelToken.new() instead of new ajx.CancelToken().
affects: >=0.1.0
gotchaNo ESM support; import syntax will fail.
fix
Use require('ajx') or use dynamic import() if ESM is required.
affects: >=0.1.0
Errors
Common errors & fixes
TypeError: ajx.CancelToken is not a constructor
Trying to use 'new ajx.CancelToken()' instead of static method.
fix
Use const ct = ajx.CancelToken.new();
SyntaxError: Cannot use import statement outside a module
Using ES import syntax with CommonJS package.
fix
Change to const ajx = require('ajx');
Error: ajx is not defined
Forgetting to import or require the package.
fix
Add const ajx = require('ajx'); at top of file.
Upgrade
Version history
0.1.0latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
53 hits · last 30 days
node
48
OpenAI (training)
1
Resources
packageajx
ajx — npm install ajx · libregistry