Skip to content

Commit 4f9133c

Browse files
committed
feat(log-level): Create package
1 parent 950b62b commit 4f9133c

File tree

2 files changed

+69
-0
lines changed

2 files changed

+69
-0
lines changed

main.js

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
(function () {
2+
'use strict';
3+
4+
const color = require('colors');
5+
6+
function info() {
7+
var message = [('[SUCCESS]'.green)],
8+
args = Array.prototype.slice.call(arguments);
9+
10+
console.log.apply(console, message.concat(args));
11+
}
12+
13+
function warning() {
14+
var message = [('[WARNING]'.yellow)],
15+
args = Array.prototype.slice.call(arguments);
16+
17+
console.log.apply(console, message.concat(args));
18+
}
19+
20+
function error() {
21+
var message = [('[ERROR]'.red)],
22+
args = Array.prototype.slice.call(arguments);
23+
24+
console.log.apply(console, message.concat(args));
25+
}
26+
27+
function highlight() {
28+
var arg = Array.prototype.slice.call(arguments)[0].magenta;
29+
30+
console.log.apply(console, [arg]);
31+
}
32+
33+
module.exports = {
34+
info: info,
35+
warning: warning,
36+
error: error,
37+
highlight: highlight
38+
};
39+
})()

package.json

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
{
2+
"name": "log-level",
3+
"version": "1.0.0",
4+
"description": "A simple package to colorize the logging output",
5+
"main": "main.js",
6+
"scripts": {
7+
"test": "echo \"Error: no test specified\" && exit 1"
8+
},
9+
"repository": {
10+
"type": "git",
11+
"url": "git+https://github.com/mimarec/log-level.git"
12+
},
13+
"keywords": [
14+
"logger",
15+
"log",
16+
"logger-color",
17+
"log-color",
18+
"console",
19+
"console-color"
20+
],
21+
"author": "Miguel María Martínez Echeverría",
22+
"license": "MIT",
23+
"bugs": {
24+
"url": "https://github.com/mimarec/log-level/issues"
25+
},
26+
"homepage": "https://github.com/mimarec/log-level#readme",
27+
"dependencies": {
28+
"colors": "^1.1.2"
29+
}
30+
}

0 commit comments

Comments
 (0)