Skip to content

Commit d11b530

Browse files
committed
Npm init + project structure
1 parent e39ef15 commit d11b530

File tree

4 files changed

+84
-0
lines changed

4 files changed

+84
-0
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/node_modules/

generator.js

Whitespace-only changes.

package.json

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
{
2+
"name": "jsome",
3+
"version": "2.0.0",
4+
"description": "Make your JSONE look AWESOME!",
5+
"main": "script.js",
6+
"repository": {
7+
"type": "git",
8+
"url": "git+https://github.com/Javascipt/Jsome.git"
9+
},
10+
"keywords": [
11+
"colors",
12+
"json",
13+
"console",
14+
"log",
15+
"format",
16+
"pretty",
17+
"print"
18+
],
19+
"author": "Khalid REHIOUI <[email protected]> (http://github.com/javascipt)",
20+
"license": "MIT",
21+
"bugs": {
22+
"url": "https://github.com/Javascipt/Jsome/issues"
23+
},
24+
"homepage": "https://github.com/Javascipt/Jsome#readme",
25+
"dependencies": {
26+
"colors": "^1.1.2",
27+
"than": "0.0.8"
28+
}
29+
}

script.js

+54
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
require('colors');
2+
require('than');
3+
4+
5+
var generator = require("./generator")
6+
7+
, colors = {
8+
"num" : "cyan",
9+
"str" : "magenta",
10+
"bool" : "red",
11+
"undef" : "grey",
12+
"null" : "grey",
13+
"attr" : "green",
14+
"quot" : "magenta",
15+
"punc" : "yellow",
16+
"brack" : "yellow"
17+
}
18+
19+
, level = {
20+
"show" : false,
21+
"char" : ".",
22+
"color" : "yellow",
23+
"spaces" : 4
24+
}
25+
26+
, params = {
27+
"colored" : true,
28+
"async" : false
29+
}
30+
31+
module.exports = (function (generator) {
32+
33+
function jsome(json, callBack) {
34+
35+
if(!jsome.params.async) {
36+
console.log(generator.start(json));
37+
return json;
38+
}
39+
40+
generator.start.than(json, function (data) {
41+
console.log.than(data, function () {
42+
callBack(json);
43+
});
44+
});
45+
46+
}
47+
48+
jsome.colors = colors;
49+
jsome.level = level;
50+
jsome.params = params;
51+
52+
return jsome;
53+
54+
})(generator);

0 commit comments

Comments
 (0)