Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules/
29 changes: 29 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
@@ -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);

});
23 changes: 23 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -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"
}
}