npm.io
3.0.3 • Published 6 years ago

@advanced-rest-client/response-highlighter

Licence
Apache-2.0
Version
3.0.3
Deps
3
Size
46 kB
Vulns
0
Weekly
0
DeprecatedThis package is deprecated

Published on NPM

Build Status

Published on webcomponents.org

<response-highlighter>

An element that parses the HTTP response and displays highlighted result.

<response-highlighter response-text="# Hello world" content-type="application/markdown"></response-highlighter>

Usage

Installation
npm install --save @advanced-rest-client/response-highlighter
In an html file
<html>
  <head>
    <script type="module">
      import '@advanced-rest-client/response-highlighter/response-highlighter.js';
    </script>
  </head>
  <body>
    <response-highlighter responsetext="Plain text" contenttype="text/plain"></response-highlighter>
  </body>
</html>
In a LitElement
import { LitElement, html } from 'lit-element';
import '@advanced-rest-client/response-highlighter/response-highlighter.js';

class SampleElement extends PolymerElement {
  render() {
    return html`
    <response-highlighter
      .responseText="${this.response}"
      .contentType="${this.contentType}"></response-highlighter>
    `;
  }
}
customElements.define('sample-element', SampleElement);

Development

git clone https://github.com/advanced-rest-client/response-highlighter
cd response-highlighter
npm install
Running the demo locally
npm start
Running the tests
npm test
API components

This components is a part of API components ecosystem