namemcwrapper
TypeScript icon, indicating that this package has built-in type declarations

2.4.2 • Public • Published

...

NameMCWrapper

ES6 Promise based wrapper for NameMC.com

📖 Documentation

Version Version Build Status WakaTime Stats Discord Server

Install 📦

npm i namemcwrapper

Usage 🔧

Check all available methods in 📖 Documentation.

import { NameMC, API } from "namemcwrapper"; // ESM
// OR
const { NameMC, API } = require("namemcwrapper"); // CommonJS

const nameMc = new NameMC();

// Get player skin history
nameMc.skinHistory({ nickname: "MrZillaGold" })
    .then((skins) => console.log(skins))
    .catch((error) => console.log(error));

const api = new API();

// Get player friends from API
api.profile.friends({ 
    target: "2e9d9da1-97e9-4564-890b-6f056c4e372f"
});

CloudFlare bypass

Error: Request failed with status code 403

NameMC often uses CloudFlare to protect against DDoS attacks. If you want the library to work at such times, you need to deploy your own CloudProxy instance.

NameMCWrapper fully supports CloudProxy.

new NameMC({
    proxy: "http://192.168.1.51:25565/v1", // CloudProxy URL
    cloudProxy: {}
    // CloudProxy options.
    // Optional.
    // To enable CloudProxy support, you cannot delete an object!
});

Warning

Since NameMC does not provide an open API, this library is based on the parsing of HTML site pages. If the changes affect the HTML used for parsing, the library may break at any time and not give the expected result. I will try to update it as soon as possible. Use at your own risk!

/namemcwrapper/

    Package Sidebar

    Install

    npm i namemcwrapper

    Weekly Downloads

    14

    Version

    2.4.2

    License

    MIT

    Unpacked Size

    109 kB

    Total Files

    61

    Last publish

    Collaborators

    • mrzillagold