Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/mrzillagold/namemcwrapper

📦 ES6 Promise based wrapper for NameMC.com
https://github.com/mrzillagold/namemcwrapper

minecraft namemc wrapper

Last synced: 3 months ago
JSON representation

📦 ES6 Promise based wrapper for NameMC.com

Awesome Lists containing this project

README

        


...

NameMCWrapper


ES6 Promise based wrapper for NameMC.com

| 📖 [Documentation](https://mrzillagold.github.io/NameMCWrapper/index.html) |
| ------------------------------------------------------------------------- |



Version


Version


Build Status


WakaTime Stats


Discord Server

## Install 📦
`npm i namemcwrapper`

## Usage 🔧
Check all available methods in [📖 Documentation](https://mrzillagold.github.io/NameMCWrapper/index.html).
```js
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`](https://github.com/NoahCardoza/CloudProxy) instance.

NameMCWrapper fully supports [`CloudProxy`](https://github.com/NoahCardoza/CloudProxy).

```js
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!