Skip to content

Commit acdfaa6

Browse files
committed
Update README.md
Added example usage
1 parent f75720a commit acdfaa6

File tree

1 file changed

+22
-3
lines changed

1 file changed

+22
-3
lines changed

README.md

+22-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,27 @@
11
# mcserver-js
22
A JavaScript library for MC-API server queries
33

4-
## Usage
5-
Coming Soon
4+
## Example Usage
5+
6+
```javascript
7+
// Basic Usage
8+
mcserver.ping("mc.hypixel.net", function(data, err) {
9+
if(data) {
10+
// Do what you want with the data..
11+
console.log(data.online + ' from ' + data.source);
12+
} else {
13+
// Handle the error..
14+
console.error(err);
15+
}
16+
});
17+
18+
// Change Region
19+
mcserver.region = 'US';// You can use EU or US right now
20+
21+
// Supports nodeJS / AMD:
22+
var mcserver = require('mcserver-js');
23+
require(["mcserver-js"], function(mcserver) { /* ... */ });
24+
```
625

726
## Credits
8-
Basic structure borrowed from [money.js / fx](https://github.com/openexchangerates/money.js), [underscore.js](https://github.com/jashkenas/underscore).
27+
Basic structure and readme borrowed from [money.js / fx](https://github.com/openexchangerates/money.js), [underscore.js](https://github.com/jashkenas/underscore).

0 commit comments

Comments
 (0)