Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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
- Host: GitHub
- URL: https://github.com/mrzillagold/namemcwrapper
- Owner: MrZillaGold
- License: mit
- Created: 2020-04-15T06:15:54.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2023-03-06T22:58:24.000Z (almost 2 years ago)
- Last Synced: 2024-10-10T16:46:45.996Z (4 months ago)
- Topics: minecraft, namemc, wrapper
- Language: TypeScript
- Homepage: https://npmjs.com/package/namemcwrapper
- Size: 3.58 MB
- Stars: 13
- Watchers: 1
- Forks: 2
- Open Issues: 13
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
NameMCWrapper
ES6 Promise based wrapper for NameMC.com
| 📖 [Documentation](https://mrzillagold.github.io/NameMCWrapper/index.html) |
| ------------------------------------------------------------------------- |## 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"); // CommonJSconst 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!