jocly/examples/node/list-games.js
2017-04-27 13:35:38 +02:00

11 lines
291 B
JavaScript

var jocly = require("../..");
jocly.listGames()
.then((games)=>{
var gameNames = Object.keys(games).map((gameName) => {
return games[gameName].title;
});
process.stdout.write(Object.keys(games).length+" games: "+gameNames.join(", ")+"\n");
});