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
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@

node_modules/
11 changes: 11 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
var _ = require('lodash');
var _chalk = require('chalk');
var salutations = require('./lib/salutations');
var logger = require('./lib/logger');

console.log(_chalk.blue('Hello world!'));

_.each(salutations, function(salutation) {
logger.log(salutation);
});

13 changes: 13 additions & 0 deletions lib/logger.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@

var logger = {
log: function(message, type) {
if (type = "true") {
console.log(_chalk.blue(message + "logged at info level"));
} else if (type = "false") {
console.log(_chalk.yellow(message + "logged at warning level"));
} else if (type = "error") {
console.log(_chalk.red(message + "logged at error level"));
}}
};

module.exports = logger;
4 changes: 4 additions & 0 deletions lib/salutations.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"en": "hello world",
"es": "hola mundo"
}
62 changes: 62 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

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/bpgallagher/assignment_node_hello_world.git"
},
"author": "B",
"license": "ISC",
"bugs": {
"url": "https://github.com/bpgallagher/assignment_node_hello_world/issues"
},
"homepage": "https://github.com/bpgallagher/assignment_node_hello_world#readme",
"dependencies": {
"chalk": "^2.4.1",
"lodash": "^4.17.10"
}
}
4 changes: 4 additions & 0 deletions salutations.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"en": "hello world",
"es": "hola mundo"
}