1.0.4 • Published 4 years ago

reserve-cmd v1.0.4

Weekly downloads
5
License
MIT
Repository
github
Last release
4 years ago

REserve/cmd

Command line handler for REserve. It allows execution and output capturing of command lines.

Travis-CI Coverage Status Maintainability Package Quality Known Vulnerabilities dependencies Status devDependencies Status reserve reserve install size MIT License

Usage

{
  "handlers": {
    "cmd": "reserve-cmd"
  },
  "mappings": [{
    "match": "\\/test",
    "cmd": "./test.cmd"
  }]
}

Capturing group values substitutions can be used, space escaping is done with the character `.

Options

OptionDefault ValueExplanation
env{}Additional variables to be used in the created process (see child_process.execFile) (interpolated)
html-footer''Additional content to be added in the footer of the HTML output (interpolated)
html-header''Additional content to be added in the header of the HTML output (interpolated)
html-trackingfalseInjects JavaScript code to scroll the HTML output while executing
text-onlyfalseWhen set, the output is always text
timeout0Automatic kill of the process (see child_process.execFile)

NOTE : interpolated values are transformed as described in the custom handlers section of REserve.

Any command can be executed (use it carefully). If a process can not be started, the request ends with a 500 error.

Supported verbs

GET

The handler adapts the output based on the accepted mime-type. If text/html is found in the accept header, the content is formatted to HTML. Otherwise, the output uses text format.

1.0.4

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago