Socket
Socket
Sign inDemoInstall

executor-editor

Package Overview
Dependencies
0
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    executor-editor

Display and evaluate your JavaScript code


Version published
Maintainers
1
Install size
68.6 kB
Created

Readme

Source

Executor Editor v2.0

executor-editor

:hammer: Display and evaluate your JavaScript code.

npm version downloads count dependencies snyk

Demo 🎉

https://piecioshka.github.io/executor-editor/demo/

Features

  • :white_check_mark: Embed any programming code
  • :white_check_mark: Highlight JavaScript syntax
  • :white_check_mark: Auto-evaluate the JavaScript code
  • :white_check_mark: Execute code on demand
  • :white_check_mark: Layout modes: horizontal, vertical
  • :white_check_mark: Multiple instance on single page
  • :white_check_mark: Support skins
  • :white_check_mark: Display errors in red color

Installation

npm install executor-editor

or

bower install executor-editor

Usage

  1. Add CSS class executor-editor to HTML element:

    <pre class="executor-editor">
    class Cake {
        toString() {
            return '[Cake]';
        }
    }
    
    console.log(String(new Cake()));
    </pre>
    
  2. Add on the bottom of page, example before </body>

    <link href="/path/to/executor-editor/dist/executor-editor.css"/>
    <link href="/path/to/executor-editor/dist/skins/blue-skin.css"/>
    <link href="/path/to/executor-editor/dist/skins/normal-skin.css"/>
    
    <script src="/path/to/executor-editor/dist/executor-editor.js"></script>
    <script>ExecutorEditor.setup();</script>
    

API

All settings you can pass by HTML attributes.

data-autoevaluate

  • Default: true

  • Options: true | false

  • Example:

    <pre class="executor-editor" data-autoevaluate="false">
        [...]
    </pre>
    

data-autofocus

  • Default: true

  • Options: true | false

  • Example:

    <pre class="executor-editor" data-autofocus="true">
        [...]
    </pre>
    

data-skin

  • Default: normal

  • Options: normal | blue

  • Example:

    <pre class="executor-editor" data-skin="blue">
        [...]
    </pre>
    

Purpose

The project was created for presentation slides, to embed code and quickly execute it.

License

The MIT License @ 2015-2019

Keywords

FAQs

Last updated on 10 Sep 2019

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc