Skip to content

Commit

Permalink
render a minimal table
Browse files Browse the repository at this point in the history
  • Loading branch information
dominictarr committed Mar 4, 2013
1 parent 32f8298 commit 203f682
Showing 1 changed file with 17 additions and 13 deletions.
30 changes: 17 additions & 13 deletions index.js
Expand Up @@ -66,19 +66,23 @@ exports.parentDirs = parentDirs
if(!module.parent) if(!module.parent)
exports(process.cwd(), function (err, pkgs) { exports(process.cwd(), function (err, pkgs) {
console.log( console.log(
tablify(pkgs.map(function (p) { (
return { tablify(pkgs.map(function (p) {
name : p.name, return {
version : p.version, name : p.name,
path : path.relative(process.cwd(), p.path) version : p.version,
} path : path.relative(process.cwd(), p.path)
}), { }
row_start: ' ', row_end: ' ', spacer: ' ', }), {
keys: ['name', 'version', 'path'], row_start: ' ', row_end: ' ', spacer: ' ',
row_sep_char: ' ', keys: ['name', 'version', 'path'],
show_index: false, row_sep_char: ' ',
has_header: false show_index: false,
}) has_header: false
})
).split(/---+/g).join('').split('\n').map(function(e) {
return e.trim()
}).join('\n').trim()
) )
}) })


0 comments on commit 203f682

Please sign in to comment.