@jawis/jagov
TypeScript icon, indicating that this package has built-in type declarations

3.0.1 • Public • Published

Jagov

Show output from both node and browser in the browser

Installation

npm i jagov

Usage of Console

Capture the console data in the browser, by loading this script file:

@jawis/console/consoleCaptureMain.js

Make a component you can place where the console should be presented.

import React, { useState } from "react";
import { makeUseConsoleStream } from "@jawis/console";
import { Console } from "@jawis/jagov";

export const MyConsole: React.FC = () => {
  const [useConsoleStream] = useState(makeUseConsoleStream);

  return (
    <Console
      //use the data captured in the browser.
      useConsoleStream={useConsoleStream}
      //get console output on the server.
      apiPath={"localhost/jago"}
      projectRoot={""}
    />
  );
};

Known issues

Related work

License

MIT

Package Sidebar

Install

npm i @jawis/jagov

Weekly Downloads

0

Version

3.0.1

License

MIT

Unpacked Size

35.6 kB

Total Files

34

Last publish

Collaborators

  • jawis