Commit
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,6 @@ | ||
require('colors'); | ||
var cardinal = require('cardinal'); | ||
var cardinalColors = require('cardinal/colors'); | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
thlorenz
|
||
var path = require('path'); | ||
var mout = require('mout'); | ||
var archy = require('archy'); | ||
|
@@ -162,14 +164,27 @@ StandardRenderer.prototype._search = function (results) { | |
|
||
StandardRenderer.prototype._info = function (data) { | ||
var str; | ||
var highlightedJson; | ||
|
||
// If the response is the whole package info | ||
// render the appropriate template | ||
if (typeof data === 'object' && data.name && data.versions) { | ||
str = template.render('std/info.std', data); | ||
} else { | ||
// TODO: colorize/highlight json | ||
str = '\n' + stringifyObject(data, { indent: ' ' }) + '\n'; | ||
|
||
highlightedJson = cardinal.highlight(stringifyObject(data, { indent: ' ' }), { | ||
theme: { | ||
String: { | ||
_default: cardinalColors.cyan | ||
This comment has been minimized.
Sorry, something went wrong.
thlorenz
|
||
}, | ||
Identifier: { | ||
_default: cardinalColors.green | ||
} | ||
}, | ||
json: true | ||
}); | ||
|
||
str = '\n' + highlightedJson + '\n'; | ||
} | ||
|
||
this._write(process.stdout, str); | ||
|
this breaks with cardinal@0.4.2.
do:
var colors = require('ansicolors');
instead, since that is what it uses now. (npm install ansicolors
first)