From 356d1e2ddd0a488bda962866ad7f6ebce3f14bba Mon Sep 17 00:00:00 2001 From: Anartz Mugika Date: Thu, 3 Jan 2019 08:02:37 +0100 Subject: [PATCH] Update instructions --- README.md | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index ee46256..19d620e 100644 --- a/README.md +++ b/README.md @@ -15,9 +15,15 @@ npm install proyecto-1b-api-github ``` const api = require('proyecto-1b-api-github'); -api.obtenerDatosDeUsuario('mugan86') - .then( - respuesta => console.log(respuesta) - ). - catch(error => console.log(error)); +api.obtenerDatosDeUsuario('mugan86').then( + data => { + console.log(data); + if (data.message === undefined) { // OK message + console.log('OK'); + console.log(data.login); + } else { + console.log(data.message); // ERROR message + } + } +); ``` \ No newline at end of file