Learn about our RFC process, Open RFC meetings & more.Join in the discussion! »

apeman-ui

3.0.9 • Public • Published

apeman-ui

Build Status Code Climate Code Coverage npm Version JS Standard

UI server for apeman

Installation

Install apeman-ui module via npm.

$ npm install apeman-ui -g

Usage

  1. Prepare an Apemanfile.js at your project root.
  2. Run the command via CLI.

Apemanfile.js

/** Example of Apemanfile.js */
 
'use strict'
 
module.exports = {
  $cwd: __dirname,
  $pkg: { /* ... */ },
  $proto: [ /* ... */ ],
  $ui: {
    'user': {
      profile () {
        return Promise.resolve(`
<html><!-- ... ---></html>
`)
      }
    }
  }
}
 

Then,

$ apeman-ui
CLI Options
$ apeman-ui -h
 
  Usage: apeman-ui [options] 
 
  UI server for apeman
 
  Options:
 
    -h, --help                           output usage information
    -V, --version                        output the version number
    -v, --verbose                        Show verbose logs
    -c, --configuration <configuration>  Pathname of Apemanfile
 
  Examples:
 
  $ apeman-ui                   # __description_of_command_usage__ 
 
 

Programmatic API

apeman-ui also provide programmatic API.

Firstly, install the module locally.

$ npm install apeman-ui --save-dev

Then,

#!/usr/bin/env
 
'use strict'
 
const apemanUi = require('apeman-ui')
const co = require('co')
 
co(function * () {
  yield apemanUi({})
}).catch((err) => console.error(err))
 
Programmatic Options
Key Description Default
port Port number to invoke
configuration Pathname of Apemanfile

License

This software is released under the MIT License.

Links

Install

npm i apeman-ui

DownloadsWeekly Downloads

3

Version

3.0.9

License

MIT

Last publish

Collaborators

  • avatar