NameMCWrapper
ES6 Promise based wrapper for NameMC.com
📖 Documentation |
---|
npm i namemcwrapper
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"
});
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!
});
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!