diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..c2658d7 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +node_modules/ diff --git a/index.js b/index.js new file mode 100644 index 0000000..00796c2 --- /dev/null +++ b/index.js @@ -0,0 +1,29 @@ +var _ = require('lodash'); +const chalk = require('chalk'); +var logger = require('./lib/logger'); +var messages = require('./data/logs.json'); + +//chalk works +console.log(chalk.green( + 'I am a green line ' + + chalk.blue.underline.bold('with a blue substring') + + ' that becomes green again!' +)); + +//lodash works +const array = [1,2,3]; + +_.each (array, function(n) { + console.log(`${n} potato`); +}) + + +// testing the logger +logger.log('Messaged logged at ERROR level','error'); + + +// logging from JSON +_.each (messages, function(value) { + logger.log(value.message, value.level); + +}); diff --git a/package.json b/package.json new file mode 100644 index 0000000..a54b3ae --- /dev/null +++ b/package.json @@ -0,0 +1,23 @@ +{ + "name": "assignment_node_hello_world", + "version": "1.0.0", + "description": "assignment_node_hello_world ===========================", + "main": "index.js", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/memyselfandhai/assignment_node_hello_world.git" + }, + "author": "", + "license": "ISC", + "bugs": { + "url": "https://github.com/memyselfandhai/assignment_node_hello_world/issues" + }, + "homepage": "https://github.com/memyselfandhai/assignment_node_hello_world#readme", + "dependencies": { + "chalk": "^2.2.0", + "lodash": "^4.17.4" + } +}