1.0.0 • Published 9 years ago

express-table-router v1.0.0

Weekly downloads
2
License
MIT
Repository
github
Last release
9 years ago

express-table-router

Build Status Dependency status Dev Dependencies Status NPM Status Gittip

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