{"name":"jsome","version":"2.1.3","description":"Make your JSON look AWESOME!","main":"script.js","repository":{"type":"git","url":"git+https://github.com/Javascipt/Jsome.git"},"keywords":["colors","json","console","log","format","pretty","print"],"author":{"name":"Khalid REHIOUI","email":"Array.prototype@gmail.com","url":"http://github.com/javascipt"},"license":"MIT","bugs":{"url":"https://github.com/Javascipt/Jsome/issues"},"homepage":"https://github.com/Javascipt/Jsome#readme","dependencies":{"chalk":"^1.1.1","colors":"^1.1.2"},"gitHead":"55a8f5ae4dc5984cf27603badbf8585ffbadb2a7","_id":"jsome@2.1.3","scripts":{},"_shasum":"bce9e879995f6ddc48ae4fbe55503d22bb4dcaea","_from":".","_npmVersion":"2.14.3","_nodeVersion":"4.1.0","_npmUser":{"name":"javascript","email":"Array.prototype@gmail.com"},"dist":{"shasum":"bce9e879995f6ddc48ae4fbe55503d22bb4dcaea","tarball":"http://registry-npm.ywwl.com/jsome/download/jsome-2.1.3.tgz","integrity":"sha512-yJ/d1etk25TppwK1ebJB9268/w9f+G/vfXA7432VKsMzrEmLHYxJVrp5ww0u0KnZELfmatj1GF4I2/Hvv+cfEg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC0BvxOZQYfZRF2/1ioHwpJKOzj1qFigX27WMRppZURYAIgDQZpJqH1sBnA3Rux5z1FNQvKCBFCKQz9lko/4LmNKQc="}],"size":35489,"noattachment":false,"key":"/jsome/-/jsome-2.1.3.tgz"},"maintainers":[{"name":"javascript","email":"Array.prototype@gmail.com"}],"directories":{},"readme":"Make your JSON objects look AWESOME!\n====================================\n\n![Jsome](https://api.travis-ci.org/Javascipt/Jsome.svg)\n![Jsome](https://david-dm.org/Javascipt/Jsome.svg)\n![Jsome](https://img.shields.io/npm/dm/jsome.svg)\n\n![Downloads stats](https://nodei.co/npm/jsome.png?downloadRank=true&stars=true)\n\n![Jsome](https://raw.githubusercontent.com/Javascipt/Jsome/master/logo.png)\n\nThis package allows you to give style to your JSON on your console!\n\n## Installation :\n\n```bash\n  $ npm install jsome\n```\n\nif you need to use jsome as a command line, you may need to instal it globally\n\n```bash\n  $ [sudo] npm install -g jsome\n```\n\n## How does it work ?\n\n#### Command line :\n\nUsing jsome as a command line, you need to run the following command that takes the path to your json file as argument\n\n```bash\n  $ jsome /path/to/your/json/file.json\n  $ jsome [options] /path/to/your/json/file.json\n```\n\nYou can also send a json string through a pipe (`|`)\n\n```bash\n  $ cat /path/to/your/json/file.json | jsome\n```\n\nThe options available are :\n- `-c`: to enable or disable colors (defualt value: true)\n- `-l`: to enable or disable levels (default value: false)\n- `-s`: to specify the number of tabulation spaces (default value: 2)\n- `-r`: to specify valid JSON as output (default value: true)\n\nexamples :\n\n```bash\n  $ jsome -c false /path/to/your/file.json\n  $ jsome -c false -l true /path/to/your/file.json\n  $ jsome -s 4 /path/to/your/file.json\n```\n\n##### Module :\n\nOn your nodejs application, when you need to console.log a json object, all you need to do is to use the jsome function\n\n```javascript\n    var jsome = require('jsome');\n    jsome([{\"id\":1,\"email\":\"Khalid@Morocco.ma\",\"active\":true},{\"id\":2,\"email\":\"Someone@somewhere.com\",\"active\":false},{\"id\":3,\"email\":\"chinese@bamboo.tree\",\"active\":true}]);\n```\n\nThen your json object will be displayed on the console in a pretty format with Awsome colors !\nHere is the result :\n\n![jsome](https://raw.githubusercontent.com/Javascipt/Jsome/master/examples/example1.png)\n\nThe `jsome` function returns the object passed as argument so that when debugging, you can print the value of an object without having to change a lot on your code\n\n```javascript\n\n    // instead of \n    \n    var foo = {\n      bar : obj\n    }\n    jsome (obj);\n    \n    // you can do this :\n    \n    var foo = {\n      bar : jsome(obj)\n    }\n    \n```\n\nYou can add some points to show levels of elements... very helpful when you are dealing with complex json objects\n\n```javascript\n    jsome.level.show = true;\n```\n\n![jsome](https://raw.githubusercontent.com/Javascipt/Jsome/master/examples/example2.png)\n\nThe object `jsome.level` has as default value the following json :\n\n```javascript\n  jsome.level = {\n      'show'    : false\n    , 'char'    : '.'\n    , 'color'   : 'red'\n    , 'spaces'  : 2\n    , 'start'   : 0\n  }\n```\n\nYou can change the level char, its color ( [see chalk package](http://npmjs.org/package/chalk) ) and the number of spaces for each level.\n\nYou can also display your json starting from a specific level to avoid displaying your json starting from the extreme left. You can do that by changing the value `jsome.level.start`.\n\nYou can configure the colors of the displayed json by changing the values of the `jsome.colors` object which has as default these values.\n\n```javascript\n  jsome.colors = {\n      'num'   : 'cyan'    // stands for numbers\n    , 'str'   : 'magenta' // stands for strings\n    , 'bool'  : 'red'     // stands for booleans\n    , 'regex' : 'blue'    // stands for regular expressions\n    , 'undef' : 'grey'    // stands for undefined\n    , 'null'  : 'grey'    // stands for null\n    , 'attr'  : 'green'   // objects attributes -> { attr : value }\n    , 'quot'  : 'yellow'  // strings quotes -> \"...\"\n    , 'punc'  : 'yellow'  // commas seperating arrays and objects values -> [ , , , ]\n    , 'brack' : 'yellow'  // for both {} and []\n  }\n```\n\nYou can not only use the color value as string but also you can use an array to specify the background color or you can make things look bold  ( [see chalk package for more details](http://npmjs.org/package/chalk) )\n\n\n```javascript\n  jsome.colors.bool  = ['green' , 'bgRed']\n  jsome.colors.attr  = ['green' , 'bold']\n  jsome.colors.quot  = ['yellow', 'bold']\n  jsome.colors.punc  = ['yellow', 'bold']\n  jsome.colors.brack = ['yellow', 'bold']\n```\n![jsome](https://raw.githubusercontent.com/Javascipt/Jsome/master/examples/example3.png)\n\n\nWhen you have a json as a string, instead of passing by `JSON.parse` function, you can just call the parse function of jsome\n\n```javascript\n  jsome(JSON.parse('[1,2,3]'));\n```\n\nbecomes:\n\n```javascript\n  jsome.parse('[1,2,3]');\n```\n\nIf you need to disable the colors:\n\n```javascript\n  jsome.params.colored = false;\n```\n\nIf you need JSON which pases linting:\n\n```javascript\n  jsome.params.lintable = true;\n```\n\nWhen you have a very long json to display, don't make your code blocking... you can enable the asynchronous mode.\n\n```javascript\n  jsome.params.async = true;\n\n  jsome(longJson, function () {\n      /* Your code here */\n  });\n```\n\nThe default value of `params` is:\n\n```javascript\n  jsome.params = {\n      'colored' : true\n    , 'async'   : false\n    , 'lintable': false\n  }\n```\n\nIn order to get the colored string without printing it on the console :\n\n```javascript\n   var coloredString = jsome.getColoredString(obj)\n```\n","publish_time":1444633403499,"_cnpm_publish_time":1444633403499,"dist-tags":{"latest":"2.5.0"}}