mirror of
https://github.com/gamedig/node-gamedig.git
synced 2024-11-17 09:18:31 +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
|
||||
---
|
||||
|
||||
```bash
|
||||
npm install gamedig
|
||||
```
|
||||
|
||||
```javascript
|
||||
var Gamedig = require('gamedig');
|
||||
Gamedig.query({
|
||||
type: 'minecraft',
|
||||
host: 'mc.example.com',
|
||||
callback: function(state) {
|
||||
Gamedig.query(
|
||||
{
|
||||
type: 'minecraft',
|
||||
host: 'mc.example.com'
|
||||
},
|
||||
function(state) {
|
||||
if(state.error) console.log("Server is offline");
|
||||
else console.log(state);
|
||||
}
|
||||
});
|
||||
);
|
||||
```
|
||||
|
||||
State Object
|
||||
|
|
Loading…
Reference in a new issue