{"_id":"cliff","_rev":"207642","name":"cliff","description":"Your CLI formatting friend.","dist-tags":{"latest":"0.1.10"},"maintainers":[{"name":"indexzero","email":"charlie.robbins@gmail.com"},{"name":"jcrugzz","email":"jcrugzz@gmail.com"}],"time":{"modified":"2021-06-03T13:45:54.000Z","created":"2011-05-30T03:55:51.243Z","0.1.10":"2014-12-06T21:43:37.201Z","0.1.9":"2014-09-15T21:11:01.568Z","0.1.8":"2012-06-18T20:02:47.755Z","0.1.7":"2012-02-09T20:52:37.733Z","0.1.6":"2012-02-08T08:05:26.717Z","0.1.5":"2011-09-12T17:41:54.773Z","0.1.4":"2011-09-11T05:10:21.154Z","0.1.3":"2011-06-21T18:43:42.542Z","0.1.2":"2011-06-08T03:13:46.716Z","0.1.1":"2011-05-30T19:19:08.471Z","0.1.0":"2011-05-30T03:55:51.243Z"},"users":{"fgribreau":true,"ajduke":true,"goliatone":true,"humantriangle":true,"hughsk":true,"f124275809":true,"zhouanbo":true,"nguru":true,"ahmed-dinar":true,"capitainegloomy":true},"author":{"name":"Charlie Robbins","email":"charlie.robbins@gmail.com"},"repository":{"type":"git","url":"http://github.com/flatiron/cliff.git"},"versions":{"0.1.10":{"name":"cliff","description":"Your CLI formatting friend.","version":"0.1.10","author":{"name":"Charlie Robbins","email":"charlie.robbins@gmail.com"},"repository":{"type":"git","url":"http://github.com/flatiron/cliff.git"},"keywords":["cli","logging","tools","winston"],"dependencies":{"colors":"~1.0.3","eyes":"~0.1.8","winston":"0.8.x"},"devDependencies":{"vows":"0.8.x"},"main":"./lib/cliff","scripts":{"test":"vows test/*-test.js --spec"},"engines":{"node":">= 0.4.0"},"gitHead":"3baf40a73432a26303f080176c7d13fe293bc1d8","bugs":{"url":"https://github.com/flatiron/cliff/issues"},"homepage":"https://github.com/flatiron/cliff","_id":"cliff@0.1.10","_shasum":"53be33ea9f59bec85609ee300ac4207603e52013","_from":".","_npmVersion":"2.1.9","_nodeVersion":"0.10.33","_npmUser":{"name":"indexzero","email":"charlie.robbins@gmail.com"},"maintainers":[{"name":"indexzero","email":"charlie.robbins@gmail.com"},{"name":"jcrugzz","email":"jcrugzz@gmail.com"}],"dist":{"shasum":"53be33ea9f59bec85609ee300ac4207603e52013","size":241980,"noattachment":false,"key":"/cliff/-/cliff-0.1.10.tgz","tarball":"http://registry.cnpm.dingdandao.com/cliff/download/cliff-0.1.10.tgz"},"directories":{},"publish_time":1417902217201,"_cnpm_publish_time":1417902217201,"_hasShrinkwrap":false},"0.1.9":{"name":"cliff","description":"Your CLI formatting friend.","version":"0.1.9","author":{"name":"Nodejitsu Inc.","email":"info@nodejitsu.com"},"repository":{"type":"git","url":"http://github.com/flatiron/cliff.git"},"maintainers":[{"name":"indexzero","email":"charlie.robbins@gmail.com"},{"name":"jcrugzz","email":"jcrugzz@gmail.com"}],"keywords":["cli","logging","tools","winston"],"dependencies":{"colors":"0.x.x","eyes":"0.1.x","winston":"0.8.x"},"devDependencies":{"vows":"0.7.x"},"main":"./lib/cliff","scripts":{"test":"vows test/*-test.js --spec"},"engines":{"node":">= 0.4.0"},"gitHead":"66462b3de5ddab850675e8e6ac077645d0bfc425","bugs":{"url":"https://github.com/flatiron/cliff/issues"},"homepage":"https://github.com/flatiron/cliff","_id":"cliff@0.1.9","_shasum":"a211e09c6a3de3ba1af27d049d301250d18812bc","_from":".","_npmVersion":"1.4.23","_npmUser":{"name":"jcrugzz","email":"jcrugzz@gmail.com"},"dist":{"shasum":"a211e09c6a3de3ba1af27d049d301250d18812bc","size":241967,"noattachment":false,"key":"/cliff/-/cliff-0.1.9.tgz","tarball":"http://registry.cnpm.dingdandao.com/cliff/download/cliff-0.1.9.tgz"},"directories":{},"publish_time":1410815461568,"_cnpm_publish_time":1410815461568,"_hasShrinkwrap":false},"0.1.8":{"name":"cliff","description":"Your CLI formatting friend.","version":"0.1.8","author":{"name":"Nodejitsu Inc.","email":"info@nodejitsu.com"},"repository":{"type":"git","url":"git://github.com/flatiron/cliff.git"},"maintainers":[{"name":"indexzero","email":"charlie.robbins@gmail.com"},{"name":"jcrugzz","email":"jcrugzz@gmail.com"}],"keywords":["cli","logging","tools","winston"],"dependencies":{"colors":"0.x.x","eyes":"0.1.x","winston":"0.6.x"},"devDependencies":{"vows":"0.5.x"},"main":"./lib/cliff","scripts":{"test":"vows test/*-test.js --spec"},"engines":{"node":">= 0.4.0"},"_npmUser":{"name":"indexzero","email":"charlie.robbins@gmail.com"},"_id":"cliff@0.1.8","optionalDependencies":{},"_engineSupported":true,"_npmVersion":"1.1.2","_nodeVersion":"v0.6.18","_defaultsLoaded":true,"dist":{"shasum":"43ca8ad9fe3943489693ab62dce0cae22509d272","size":240863,"noattachment":false,"key":"/cliff/-/cliff-0.1.8.tgz","tarball":"http://registry.cnpm.dingdandao.com/cliff/download/cliff-0.1.8.tgz"},"directories":{},"publish_time":1340049767755,"_cnpm_publish_time":1340049767755,"_hasShrinkwrap":false},"0.1.7":{"name":"cliff","description":"Your CLI formatting friend.","version":"0.1.7","author":{"name":"Nodejitsu","email":"info@nodejitsu.com"},"repository":{"type":"git","url":"git://github.com/flatiron/cliff.git"},"keywords":["cli","logging","tools","winston"],"dependencies":{"colors":"0.x.x","eyes":"0.1.x","winston":"0.5.x"},"devDependencies":{"vows":"0.5.x"},"main":"./lib/cliff","scripts":{"test":"vows test/*-test.js --spec"},"engines":{"node":">= 0.4.0"},"_npmUser":{"name":"indexzero","email":"charlie.robbins@gmail.com"},"_id":"cliff@0.1.7","optionalDependencies":{},"_engineSupported":true,"_npmVersion":"1.1.0-2","_nodeVersion":"v0.6.7","_defaultsLoaded":true,"dist":{"shasum":"9b41d84d9f09be12b698d8617501548a10957a37","size":240829,"noattachment":false,"key":"/cliff/-/cliff-0.1.7.tgz","tarball":"http://registry.cnpm.dingdandao.com/cliff/download/cliff-0.1.7.tgz"},"maintainers":[{"name":"indexzero","email":"charlie.robbins@gmail.com"},{"name":"jcrugzz","email":"jcrugzz@gmail.com"}],"directories":{},"publish_time":1328820757733,"_cnpm_publish_time":1328820757733,"_hasShrinkwrap":false},"0.1.6":{"name":"cliff","description":"Your CLI formatting friend.","version":"0.1.6","author":{"name":"Nodejitsu","email":"info@nodejitsu.com"},"repository":{"type":"git","url":"git://github.com/nodejitsu/cliff.git"},"keywords":["cli","logging","tools","winston"],"dependencies":{"colors":"0.x.x","eyes":"0.1.x","winston":"0.5.x"},"devDependencies":{"vows":"0.5.x"},"main":"./lib/cliff","scripts":{"test":"vows test/*-test.js --spec"},"engines":{"node":">= 0.4.0"},"_npmUser":{"name":"indexzero","email":"charlie.robbins@gmail.com"},"_id":"cliff@0.1.6","optionalDependencies":{},"_engineSupported":true,"_npmVersion":"1.1.0-2","_nodeVersion":"v0.6.7","_defaultsLoaded":true,"dist":{"shasum":"19cc9bf18bbae80d661b65e5dc8c7188f1efa54e","size":240830,"noattachment":false,"key":"/cliff/-/cliff-0.1.6.tgz","tarball":"http://registry.cnpm.dingdandao.com/cliff/download/cliff-0.1.6.tgz"},"maintainers":[{"name":"indexzero","email":"charlie.robbins@gmail.com"},{"name":"jcrugzz","email":"jcrugzz@gmail.com"}],"directories":{},"publish_time":1328688326717,"_cnpm_publish_time":1328688326717,"_hasShrinkwrap":false},"0.1.5":{"name":"cliff","description":"Your CLI formatting friend.","version":"0.1.5","author":{"name":"Nodejitsu","email":"info@nodejitsu.com"},"repository":{"type":"git","url":"git://github.com/nodejitsu/cliff.git"},"keywords":["cli","logging","tools","winston"],"dependencies":{"colors":"0.x.x","eyes":"0.1.x","winston":"0.5.x"},"devDependencies":{"vows":"0.5.x"},"main":"./lib/cliff","scripts":{"test":"vows test/*-test.js --spec"},"engines":{"node":">= 0.4.0"},"_npmJsonOpts":{"file":"/Users/Charlie/.npm/cliff/0.1.5/package/package.json","wscript":false,"contributors":false,"serverjs":false},"_id":"cliff@0.1.5","_engineSupported":true,"_npmVersion":"1.0.23","_nodeVersion":"v0.4.11","_defaultsLoaded":true,"dist":{"shasum":"d515a5801f16b712c45607711da05bae70327058","size":240911,"noattachment":false,"key":"/cliff/-/cliff-0.1.5.tgz","tarball":"http://registry.cnpm.dingdandao.com/cliff/download/cliff-0.1.5.tgz"},"maintainers":[{"name":"indexzero","email":"charlie.robbins@gmail.com"},{"name":"jcrugzz","email":"jcrugzz@gmail.com"}],"directories":{},"publish_time":1315849314773,"_cnpm_publish_time":1315849314773,"_hasShrinkwrap":false},"0.1.4":{"name":"cliff","description":"Your CLI formatting friend.","version":"0.1.4","author":{"name":"Nodejitsu","email":"info@nodejitsu.com"},"repository":{"type":"git","url":"git://github.com/nodejitsu/cliff.git"},"keywords":["cli","logging","tools","winston"],"dependencies":{"colors":"0.x.x","eyes":"0.1.x","winston":"0.4.x"},"devDependencies":{"vows":"0.5.x"},"main":"./lib/cliff","scripts":{"test":"vows test/*-test.js --spec"},"engines":{"node":">= 0.4.0"},"_npmJsonOpts":{"file":"/Users/Charlie/.npm/cliff/0.1.4/package/package.json","wscript":false,"contributors":false,"serverjs":false},"_id":"cliff@0.1.4","_engineSupported":true,"_npmVersion":"1.0.23","_nodeVersion":"v0.4.11","_defaultsLoaded":true,"dist":{"shasum":"21e42c66e09c0bd7dca795ffcc11f68b95cbd2d1","size":240903,"noattachment":false,"key":"/cliff/-/cliff-0.1.4.tgz","tarball":"http://registry.cnpm.dingdandao.com/cliff/download/cliff-0.1.4.tgz"},"maintainers":[{"name":"indexzero","email":"charlie.robbins@gmail.com"},{"name":"jcrugzz","email":"jcrugzz@gmail.com"}],"directories":{},"publish_time":1315717821154,"_cnpm_publish_time":1315717821154,"_hasShrinkwrap":false},"0.1.3":{"name":"cliff","description":"Your CLI formatting friend.","version":"0.1.3","author":{"name":"Nodejitsu","email":"info@nodejitsu.com"},"repository":{"type":"git","url":"git://github.com/nodejitsu/cliff.git"},"keywords":["cli","logging","tools","winston"],"dependencies":{"colors":"0.x.x","eyes":"0.1.x","winston":"0.3.x"},"devDependencies":{"vows":"0.5.x"},"main":"./lib/cliff","scripts":{"test":"vows test/*-test.js --spec"},"engines":{"node":">= 0.4.0"},"_id":"cliff@0.1.3","_engineSupported":true,"_npmVersion":"1.0.10","_nodeVersion":"v0.4.8","_defaultsLoaded":true,"dist":{"shasum":"9a3573030e3f50f1afdaeb14bb99860f8ddb6c90","size":239965,"noattachment":false,"key":"/cliff/-/cliff-0.1.3.tgz","tarball":"http://registry.cnpm.dingdandao.com/cliff/download/cliff-0.1.3.tgz"},"directories":{},"publish_time":1308681822542,"maintainers":[{"name":"indexzero","email":"charlie.robbins@gmail.com"},{"name":"jcrugzz","email":"jcrugzz@gmail.com"}],"_cnpm_publish_time":1308681822542,"_hasShrinkwrap":false},"0.1.2":{"name":"cliff","description":"Your CLI formatting friend.","version":"0.1.2","author":{"name":"Nodejitsu","email":"info@nodejitsu.com"},"repository":{"type":"git","url":"git://github.com/nodejitsu/cliff.git"},"keywords":["cli","logging","tools","winston"],"dependencies":{"colors":"0.x.x","eyes":"0.1.x","winston":"0.3.x"},"devDependencies":{"vows":"0.5.x"},"main":"./lib/cliff","scripts":{"test":"vows test/*-test.js --spec"},"engines":{"node":">= 0.4.0"},"_id":"cliff@0.1.2","_engineSupported":true,"_npmVersion":"1.0.10","_nodeVersion":"v0.4.8","_defaultsLoaded":true,"dist":{"shasum":"a8ade9fe923222017d26741e4cca1e5b421348bc","size":5498,"noattachment":false,"key":"/cliff/-/cliff-0.1.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/cliff/download/cliff-0.1.2.tgz"},"directories":{},"publish_time":1307502826716,"maintainers":[{"name":"indexzero","email":"charlie.robbins@gmail.com"},{"name":"jcrugzz","email":"jcrugzz@gmail.com"}],"_cnpm_publish_time":1307502826716,"_hasShrinkwrap":false},"0.1.1":{"name":"cliff","description":"Your CLI formatting friend.","version":"0.1.1","author":{"name":"Nodejitsu","email":"info@nodejitsu.com"},"repository":{"type":"git","url":"git://github.com/nodejitsu/cliff.git"},"keywords":["cli","logging","tools","winston"],"dependencies":{"colors":"0.x.x","eyes":"0.1.x","winston":"0.2.x"},"devDependencies":{"vows":"0.5.x"},"main":"./lib/cliff","scripts":{"test":"vows test/*-test.js --spec"},"engines":{"node":">= 0.4.0"},"_id":"cliff@0.1.1","_engineSupported":true,"_npmVersion":"1.0.6","_nodeVersion":"v0.4.8","_defaultsLoaded":true,"dist":{"shasum":"170a079ee055a8cd0416282ac725f10d1ca6201b","size":5498,"noattachment":false,"key":"/cliff/-/cliff-0.1.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/cliff/download/cliff-0.1.1.tgz"},"directories":{},"publish_time":1306783148471,"maintainers":[{"name":"indexzero","email":"charlie.robbins@gmail.com"},{"name":"jcrugzz","email":"jcrugzz@gmail.com"}],"_cnpm_publish_time":1306783148471,"_hasShrinkwrap":false},"0.1.0":{"name":"cliff","description":"Your CLI formatting friend.","version":"0.1.0","author":{"name":"Nodejitsu","email":"info@nodejitsu.com"},"repository":{"type":"git","url":"git://github.com/nodejitsu/cliff.git"},"keywords":["cli","logging","tools","winston"],"dependencies":{"colors":"0.x.x","eyes":"0.1.x","winston":"0.2.x"},"devDependencies":{"vows":"0.5.x"},"main":"./lib/cliff","scripts":{"test":"vows test/*-test.js --spec"},"engines":{"node":">= 0.4.0"},"_id":"cliff@0.1.0","_engineSupported":true,"_npmVersion":"1.0.6","_nodeVersion":"v0.4.8","_defaultsLoaded":true,"dist":{"shasum":"5a9097b26e548199507e3aed42cb761916a9b90a","size":5301,"noattachment":false,"key":"/cliff/-/cliff-0.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/cliff/download/cliff-0.1.0.tgz"},"directories":{},"publish_time":1306727751243,"maintainers":[{"name":"indexzero","email":"charlie.robbins@gmail.com"},{"name":"jcrugzz","email":"jcrugzz@gmail.com"}],"_cnpm_publish_time":1306727751243,"_hasShrinkwrap":false}},"readme":"# cliff\n\nCLI output formatting tools: \"Your CLI Formatting Friend\".\n\n## Installation\n\n### Installing npm (node package manager)\n```\n  curl http://npmjs.org/install.sh | sh\n```\n\n### Installing cliff\n```\n  [sudo] npm install cliff\n```\n\n## Usage\nThere are a number of methods available in Cliff for common logging tasks in command-line tools. If you're looking for more usage, checkout the [examples in this repository][3]:\n\n1. Logging rows of data\n2. Inspecting Objects\n\n### Logging rows of data\n\n**cliff.stringifyRows(rows[, colors])**\n\nTakes a set of Arrays and row headers and returns properly formatted and padded rows. Here's a sample:\n\n``` js\n  var cliff = require('../lib/cliff');\n\n  var rows = [\n    ['Name',  'Flavor',    'Dessert'],\n    ['Alice', 'cherry',    'yogurt'],\n    ['Bob',   'carmel',    'apples'],\n    ['Joe',   'chocolate', 'cake'],\n    ['Nick',  'vanilla',   'ice cream']\n  ];\n\n  console.log(cliff.stringifyRows(rows, ['red', 'blue', 'green']));\n```\n\n![output from string-rows.js][string-rows]\n\n**cliff.putRows(level, rows[, colors])**\n\nThe `putRows` method is a simple helper that takes a set of Arrays and row headers and logs properly formatted and padded rows (logs `stringifyRows` to [winston][0]). Here's a quick sample:\n\n``` js\n  var cliff = require('../lib/cliff');\n\n  var rows = [\n    ['Name',  'Flavor',    'Dessert'],\n    ['Alice', 'cherry',    'yogurt'],\n    ['Bob',   'carmel',    'apples'],\n    ['Joe',   'chocolate', 'cake'],\n    ['Nick',  'vanilla',   'ice cream']\n  ];\n\n  cliff.putRows('data', rows, ['red', 'blue', 'green']);\n```\n\nThe resulting output on the command-line would be:\n\n![output from put-rows.js][put-rows]\n\n**cliff.stringifyObjectRows(objs, properties[, colors])**\n*used to be: cliff.rowifyObjects(objs, properties, colors)*\n\nTakes a set of Objects and the properties to extract from them and returns properly formatted and padded rows. Here's a sample:\n\n``` js\n  var cliff = require('../lib/cliff');\n\n  var objs = [], obj = {\n    name: \"bazz\",\n    address: \"1234 Nowhere Dr.\",\n  };\n\n  for (var i = 0; i < 10; i++) {\n    objs.push({\n      name: obj.name,\n      address: obj.address,\n      id: Math.random().toString()\n    });\n  }\n\n  console.log(cliff.stringifyObjectRows(objs, ['id', 'name', 'address'], ['red', 'blue', 'green']));\n```\n\n![output from string-object-rows.js][string-object-rows]\n\n**cliff.putObjectRows(level, objs, properties[, colors])**\n\nTakes a set of Objects and the properties to extract from them and it will log to the console. (it prints `stringifyObjectRows` with [winston][0]). Here's a sample:\n\n``` js\n  var cliff = require('../lib/cliff');\n\n  var objs = [], obj = {\n    name: \"bazz\",\n    address: \"1234 Nowhere Dr.\",\n  };\n\n  for (var i = 0; i < 10; i++) {\n    objs.push({\n      name: obj.name,\n      address: obj.address,\n      id: Math.random().toString()\n    });\n  }\n\n  cliff.putObjectRows('data', objs, ['id', 'name', 'address']);\n```\n\n![output from string-object-rows.js][string-object-rows]\n\n**Colors Parameter**\n\nThe `colors` parameter is an array that colors the first row. It uses the [colors.js][2]. You can use any of those.\n\n``` js\n  var cliff = require('../lib/cliff');\n\n  var rows = [\n    ['Name',        'Flavor',              'Dessert'],\n    ['Alice'.grey,  'cherry'.cyan,         'yogurt'.yellow],\n    ['Bob'.magenta, 'carmel'.rainbow,      'apples'.white],\n    ['Joe'.italic,  'chocolate'.underline, 'cake'.inverse],\n    ['Nick'.bold,   'vanilla',             'ice cream']\n  ];\n\n  cliff.putRows('data', rows, ['red', 'blue', 'green']);\n```\n\nThe resulting output on the command-line would be:\n\n![output from puts-rows-colors.js][put-rows-colors]\n\n### Inspecting Objects\n\n**cliff.inspect(obj)**\n\nThe `inspect` method is a lightweight wrapper to a pre-configured [eyes][1] inspector. If you wish to change the coloring of objects that are logged using `cliff` you only need to override `cliff.inspect` with a new [eyes][1] inspector. Here is how to use it:\n\n``` js\n  var cliff = require('../lib/cliff');\n\n  console.log(cliff.inspect({\n    literal: \"bazz\",\n    arr: [\n      \"one\",\n      2,\n    ],\n    obj: {\n      host: \"localhost\",\n      port: 5984,\n      auth: {\n        username: \"admin\",\n        password: \"password\"\n      }\n    }\n  }));\n```\n\n![output from inspect.js][inspect]\n\n**cliff.putObject(obj, [rewriters, padding])**\n\nThe `putObject` method is a simple helper function for prefixing and styling inspected object output from [eyes][1]. Here's a quick sample:\n\n``` js\nvar cliff = require('cliff');\n\ncliff.putObject({\n  literal: \"bazz\",\n  arr: [\n    \"one\",\n    2,\n  ],\n  obj: {\n    host: \"localhost\",\n    port: 5984,\n    auth: {\n      username: \"admin\",\n      password: \"password\"\n    }\n  }\n});\n```\n\nThe resulting output on the command-line would be: \n\n![output from put-object.js][put-object]\n\n## Run Tests\n\nAll of the cliff tests are written in [vows][4], and cover all of the use cases described above.\n\n```\n  npm test\n```\n\n## Motivation\n\nCliff is the swiss army knife of CLI formatting tools. It is based on highly flexible and powerful libraries: \n\n* [winston][0]: A multi-transport async logging library for node.js\n* [eyes][1]: A customizable value inspector for node.js\n* [colors][2]: Get colors in your node.js console like what \n\n\n#### Author: [Charlie Robbins](http://twitter.com/indexzero)\n\n[0]: http://github.com/indexzero/winston\n[1]: http://github.com/cloudhead/eyes.js\n[2]: http://github.com/marak/colors.js\n[3]: http://github.com/flatiron/cliff/tree/master/examples\n[4]: http://vowsjs.org\n\n[inspect]: https://github.com/flatiron/cliff/raw/master/assets/inspect.png\n[put-object-rows]: https://github.com/flatiron/cliff/raw/master/assets/put-object-rows.png\n[put-object]: https://github.com/flatiron/cliff/raw/master/assets/put-object.png\n[put-rows-colors]: https://github.com/flatiron/cliff/raw/master/assets/put-rows-colors.png\n[put-rows]: https://github.com/flatiron/cliff/raw/master/assets/put-rows.png\n[string-object-rows]: https://github.com/flatiron/cliff/raw/master/assets/string-object-rows.png\n[string-rows]: https://github.com/flatiron/cliff/raw/master/assets/string-rows.png","_attachments":{},"homepage":"https://github.com/flatiron/cliff","bugs":{"url":"https://github.com/flatiron/cliff/issues"}}