npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

x-mcjs

v1.1.0

Published

X-mcjs is a modern, lightweight, and fully-featured HTTP client SDK for Node.js designed to simplify API integration and request management. It provides a clean and intuitive interface for handling GET, POST, PUT, PATCH, DELETE, HEAD, and OPTIONS requests

Readme

Installation

Install using npm:

npm install x-mcjs

Install using yarn:

yarn add x-mcjs

Install using pnpm:

pnpm add x-mcjs

Usage

x-mcjs supports both CommonJS and ES Modules.

CommonJS

const Kyxzz = require('x-mcjs');

(async () => {
  const { data } = await Kyxzz.get('/ai/gpt', {
    q: 'Hello World'
  });

  console.log(data);
})();

ES Modules

import Kyxzz from 'x-mcjs';

const { data } = await Kyxzz.get('/ai/gpt', {
  q: 'Hello World'
});

console.log(data);

Base URL

The package automatically uses the configured API URL.

Example:

await Kyxzz.get('/ai/gpt');

Automatically requests:

GET https://your-api-domain.com/api/ai/gpt

No need to manually write the full URL.


GET Request

const { data } = await Kyxzz.get('/ai/gpt', {
  q: 'Testing'
});

console.log(data);

POST Request

const { data } = await Kyxzz.post('/user/create', {
  username: 'Xyraa',
  age: 20
});

console.log(data);

Query Parameters

All additional properties are automatically converted into query parameters.

await Kyxzz.get('/search', {
  q: 'Naruto',
  page: 1,
  limit: 10
});

Generated URL:

/search?q=Naruto&page=1&limit=10

Custom Headers

await Kyxzz.get('/ai/gpt', {
  q: 'Hello',
  headers: {
    Authorization: 'Bearer YOUR_TOKEN'
  }
});

Retry Requests

Automatically retry failed requests.

await Kyxzz.get('/ai/gpt', {
  q: 'Hello',
  retry: 3
});

Cache Responses

Cache a request for 60 seconds.

await Kyxzz.get('/anime', {
  cache: 60000
});

Timeout

Abort a request after 10 seconds.

await Kyxzz.get('/ai/gpt', {
  timeout: 10000
});

Upload Files

const form = new FormData();

form.append(
  'image',
  imageFile
);

const res =
  await Kyxzz.postForm(
    '/upload',
    form
  );

console.log(res.data);

Abort Requests

const controller =
  Kyxzz.cancelToken();

Kyxzz.get('/ai/gpt', {
  signal: controller.signal
});

controller.abort();

Request Hooks

Before Request

Kyxzz.hook(
  'beforeRequest',
  ({ url }) => {
    console.log(
      'Request:',
      url
    );
  }
);

After Response

Kyxzz.hook(
  'afterResponse',
  response => {
    console.log(
      'Status:',
      response.status
    );
  }
);

Error Handler

Kyxzz.hook(
  'onError',
  error => {
    console.error(error);
  }
);

Response Structure

Successful requests return:

{
  data: {},
  status: 200,
  ok: true,
  headers: {},
  url: '',
  metrics: {
    duration: 52
  },
  rateLimit: {
    limit: '100',
    remaining: '99',
    reset: '123456789'
  }
}

Failed Request

When a network error occurs:

{
  creator: 'Xyraa Kyxzz',
  status: false,
  data: {
    message: 'Api invalid',
    error: 'fetch failed'
  }
}

Author

Xyraa Kyxzz

GitHub: https://github.com/Xyraakyzzz


License

MIT