beanify-markdown
TypeScript icon, indicating that this package has built-in type declarations

3.0.7 • Public • Published

beanify-markdown

A tool for outputting routing information into .md files

Install

npm install beanify-markdown --save

with yarn

yarn add beanify-markdown

Usage

base example

const Beanify = require('beanify')
const Plugin = require('beanify-markdown')
const beanify = Beanify({})

beanify
  .register(Plugin, {
    dir: 'out'
  })
  .route({
    url: 'math.asin',
    md: {
      name: 'asin',
      desc: 'function returns the arcsine (in radians) of a number'
    },
    handler (req, rep) {}
  })
  .ready(e => {
    e && beanify.$log.error(e.message)
    beanify.print()
  })

with beanify-url.

const Beanify = require('beanify')
const beanifyAjv = require('beanify-ajv')
const beanifyUrl = require('beanify-url')
const Plugin = require('beanify-markdown')
const beanify = Beanify({})

beanify
  .register(Plugin, {
    dir: '.out-url'
  })
  .register(beanifyAjv, {
    ajv: {
      useDefaults: true,
      coerceTypes: true
    }
  })
  .register(beanifyUrl)
  .route({
    url: 'math.:action',
    md: {
      name: 'math.action',
      desc: 'function returns the arcsine (in radians) of a number'
    },
    schema: {
      body: {
        type: 'number'
      },
      attribute: {
        type: 'object',
        properties: {
          token: {
            type: 'string'
          }
        }
      },
      params: {
        type: 'object',
        properties: {
          action: {
            type: 'string'
          }
        }
      }
    },
    handler (req, rep) {}
  })
  .route({
    url: 'time.:action',
    md: {
      name: 'time.action'
    },
    schema: {
      body: {
        type: 'number'
      },
      attribute: {
        type: 'object',
        properties: {
          token: {
            type: 'string'
          }
        }
      },
      params: {
        type: 'object',
        properties: {
          action: {
            type: 'string'
          }
        }
      }
    },
    handler (req, rep) {}
  })
  .ready(e => {
    e && beanify.$log.error(e.message)
    beanify.print()
  })

Options

  • dir: .md document output directory
  • title: Title of README.md file

Route Decorators

  • markdown: alias md
    • name: interface name
    • description: interface description.alias desc

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 3.0.7
    0
    • latest

Version History

Package Sidebar

Install

npm i beanify-markdown

Weekly Downloads

0

Version

3.0.7

License

MIT

Unpacked Size

11.6 kB

Total Files

11

Last publish

Collaborators

  • beanjs