express-table-router
Print a table associated with a express router
Install
npm install express-table-router
Usage
tableRouter = require 'express-table-router' --save
You can pass a default settings for each table:
options =
style: head: ['green']
tableRouter = require('express-table-router')(options)
See cli-table for more information about the options.
Later in your code need to pass a router express Object and optionally a specific options for the table:
tableOne = table.create(router.stack)
tableOne.show()
Also you can chain methods:
tableOne = table.create(router.stack).show()
An example of pattern for print table and register in express:
for route in ["client", "address", "direction", "contact"]
router = require "./api/#{route}"
app.use router
table.create(router.stack).show()
License
MIT © Kiko Beats