Permalink
Browse files

render a minimal table

  • Loading branch information...
1 parent 32f8298 commit 203f6823b39290ae1aecaa985fc0918d50d0ffd4 @dominictarr committed Mar 4, 2013
Showing with 17 additions and 13 deletions.
  1. +17 −13 index.js
View
@@ -66,19 +66,23 @@ exports.parentDirs = parentDirs
if(!module.parent)
exports(process.cwd(), function (err, pkgs) {
console.log(
- tablify(pkgs.map(function (p) {
- return {
- name : p.name,
- version : p.version,
- path : path.relative(process.cwd(), p.path)
- }
- }), {
- row_start: ' ', row_end: ' ', spacer: ' ',
- keys: ['name', 'version', 'path'],
- row_sep_char: ' ',
- show_index: false,
- has_header: false
- })
+ (
+ tablify(pkgs.map(function (p) {
+ return {
+ name : p.name,
+ version : p.version,
+ path : path.relative(process.cwd(), p.path)
+ }
+ }), {
+ row_start: ' ', row_end: ' ', spacer: ' ',
+ keys: ['name', 'version', 'path'],
+ row_sep_char: ' ',
+ 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.