@alichry/jsconsole
v3.1.4
Published
Remy's web based JS console with CSS-scoped React components and configurable execution environment (iframe or top-level)
Readme
jsconsole(2)
@remy/jsconsole provides an interactive JavaScript console. This fork provides reusable React components with scoped CSS.
End-user Usage
If you simply want to use an interactive JavaScript console, see jsconsole.com
React usage
Install this package:
npm install @alichry/jsconsoleAnd in your React application, simply import and include the root component:
import { Root } from '@alichry/jsconsole';
function App() {
return (
<div>
<YourComponents />
<Root />
</div>
);
}
export default App;Options
The Root component defines the below configurable options:
defaultTheme: Choose betweenlightordark. Defaults tolightenvironment: Specify an execution environment, defaults toiframe. Passtop-levelto avoid execution of JavaScript code inside an iframe.className: Specify a CSS class name for the parent container.
Dark theme
<Root defaultTheme="dark" />Top-level JS execution
<Root environment="top-level" />