Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/macdja38/minecraft-jsonapi
https://github.com/macdja38/minecraft-jsonapi
Last synced: 28 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/macdja38/minecraft-jsonapi
- Owner: macdja38
- Created: 2017-09-10T21:07:46.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2017-10-08T07:04:37.000Z (about 7 years ago)
- Last Synced: 2024-11-23T01:53:17.311Z (about 1 month ago)
- Language: JavaScript
- Size: 256 KB
- Stars: 0
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Features
Simple yet powerful [minecraft JSONAPI](https://github.com/alecgorge/jsonapi) module
# Actual real life documentation
[Documentation](https://macdja38.github.io/minecraft-jsonapi)
# Method docs
[rest](http://mcjsonapi.com/apidocs/)# Usage
### Import
```js
const Minecraft = require("minecraft-jsonapi");
```### Options
```js
const options = {
host: "127.0.0.1",
port: "25565",
https: false,
username: "username",
password: "password",
};
```### Rest Call
```js
const minecraft = Minecraft.createRequest();const resultPromise = minecraft.add("server.performance").dispatch(options);
resultPromise.then(console.log).catch(console.error);
```### Streaming API
```js
const minecraft = Minecraft.createRequest();minecraft.add("console", []).add("chat", []).follow(options, console.log)
```