diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 0000000..574a299 --- /dev/null +++ b/package-lock.json @@ -0,0 +1,13 @@ +{ + "name": "starter", + "version": "1.0.0", + "lockfileVersion": 2, + "requires": true, + "packages": { + "": { + "name": "starter", + "version": "1.0.0", + "license": "ISC" + } + } +} diff --git a/package.json b/package.json index fd274dd..2d9405b 100644 --- a/package.json +++ b/package.json @@ -1,12 +1,20 @@ { "name": "starter", "version": "1.0.0", - "description": "", "main": "index.js", "scripts": { "start": "node src/main.js" }, "keywords": [], "author": "", - "license": "ISC" + "license": "ISC", + "repository": { + "type": "git", + "url": "git+https://github.com/Robensonjl/starter-promises-resolving-promises.git" + }, + "bugs": { + "url": "https://github.com/Robensonjl/starter-promises-resolving-promises/issues" + }, + "homepage": "https://github.com/Robensonjl/starter-promises-resolving-promises#readme", + "description": "" } diff --git a/src/main.js b/src/main.js index f7c0fae..b4d830e 100644 --- a/src/main.js +++ b/src/main.js @@ -1,5 +1,18 @@ const { welcome, goodbye, tell } = require("../utils/fortune-teller"); -const promise = welcome(); +const question = "should I wear sunscreen today?"; -console.log(promise); +welcome() + .catch((error) => console.error(error)) + .then(console.log) + .then(goodbye) + .then(console.log); + +tell(question) + .catch((error) => console.error(`Reference Error: ${error}`)) + .then((fortune) => { + console.log(`Your question: \"${question}\"`); + console.log(`Our answer: ${fortune}`); + }); + + \ No newline at end of file