mirror of
https://github.com/gamedig/node-gamedig.git
synced 2024-11-17 17:25:19 +01:00
Add install instructions
This commit is contained in:
parent
27b09c37e4
commit
081e7d44bd
1 changed files with 11 additions and 5 deletions
16
README.md
16
README.md
|
@ -4,16 +4,22 @@ node-GameDig - Game Server Query Library
|
||||||
Usage
|
Usage
|
||||||
---
|
---
|
||||||
|
|
||||||
|
```bash
|
||||||
|
npm install gamedig
|
||||||
|
```
|
||||||
|
|
||||||
```javascript
|
```javascript
|
||||||
var Gamedig = require('gamedig');
|
var Gamedig = require('gamedig');
|
||||||
Gamedig.query({
|
Gamedig.query(
|
||||||
type: 'minecraft',
|
{
|
||||||
host: 'mc.example.com',
|
type: 'minecraft',
|
||||||
callback: function(state) {
|
host: 'mc.example.com'
|
||||||
|
},
|
||||||
|
function(state) {
|
||||||
if(state.error) console.log("Server is offline");
|
if(state.error) console.log("Server is offline");
|
||||||
else console.log(state);
|
else console.log(state);
|
||||||
}
|
}
|
||||||
});
|
);
|
||||||
```
|
```
|
||||||
|
|
||||||
State Object
|
State Object
|
||||||
|
|
Loading…
Reference in a new issue