# moroboxai-editor-web

> MoroboxAI editor in browser

Latest version **0.1.1-alpha.13** (published 2023-11-01) · MIT license · 0 weekly downloads

## Install

```sh
npm install moroboxai-editor-web
pnpm add moroboxai-editor-web
yarn add moroboxai-editor-web
bun add moroboxai-editor-web
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities.

Warnings: low downloads; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.1-alpha.13 |
| Published | 2023-11-01 |
| First published | 2022-06-08 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 2 |
| Unpacked size | 2.1 MB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | moroboxai |
| Maintainers | moroboxai |

## Links

- npm: https://www.npmjs.com/package/moroboxai-editor-web
- Repository: https://github.com/moroboxai/moroboxai-editor-web
- Homepage: https://github.com/moroboxai/moroboxai-editor-web#readme
- Issues: https://github.com/moroboxai/moroboxai-editor-web/issues
- npm.io page: https://npm.io/package/moroboxai-editor-web

## Dependencies (2)

- [brace](https://npm.io/package/brace.md) ^0.11.1
- [moroboxai-editor-sdk](https://npm.io/package/moroboxai-editor-sdk.md) ^0.1.1-alpha.5

## Recent versions

- 0.1.1-alpha.13 (latest) — 2023-11-01
- 0.1.1-alpha.12 — 2023-11-01
- 0.1.1-alpha.11 — 2023-10-31
- 0.1.1-alpha.10 — 2023-10-20
- 0.1.1-alpha.9 — 2023-09-22
- 0.1.1-alpha.8 — 2023-09-22
- 0.1.1-alpha.7 — 2023-09-21
- 0.1.1-alpha.6 — 2023-09-16
- 0.1.1-alpha.5 — 2023-09-16
- 0.1.1-alpha.4 — 2023-08-29
- 0.1.1-alpha.3 — 2022-06-23
- 0.1.1-alpha.2 — 2022-06-14
- 0.1.1-alpha.1 — 2022-06-10
- 0.1.0-alpha.1 — 2022-06-08

## README

# moroboxai-editor-web

[![NPM version](https://img.shields.io/npm/v/moroboxai-editor-web.svg)](https://www.npmjs.com/package/moroboxai-editor-web)
![Node.js CI](https://github.com/moroboxai/moroboxai-editor-web/workflows/Node.js%20CI/badge.svg)
[![gitHub license](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/moroboxai/moroboxai-editor-web/blob/master/LICENSE)
[![Code Quality: Javascript](https://img.shields.io/lgtm/grade/javascript/g/moroboxai/moroboxai-editor-web.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/moroboxai/moroboxai-editor-web/context:javascript)
[![Total Alerts](https://img.shields.io/lgtm/alerts/g/moroboxai/moroboxai-editor-web.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/moroboxai/moroboxai-editor-web/alerts)

Embeddable code editor for coding AIs for [MoroboxAI](https://github.com/moroboxai) on the web.

## Install

Using npm:

```bash
npm install moroboxai-editor-web --save
```

Or:

```bash
git clone https://github.com/moroboxai/moroboxai-editor-web.git
cd moroboxai-editor-web
npm i
npm run build
```

## Usage

Create a `sample.html` file in the `moroboxai-editor-web` folder:

```html
<html>
 <div id="editor"></div> 
  
 <script type="text/javascript" src="./lib/umd/moroboxai-editor-web.js"></script>
 <script type="text/javascript">
  // Initialize the editor on our div
  const editor = MoroboxAIEditor.init({
   element: document.getElementById("editor"),
   value: 'function foo() {\n  console.log("foo");\n}\n',
   width: "500px",
   height: "400px"
  });
 </script>
</html>
```

Open `sample.html` in your browser and check the console output.

## Arguments

| Name   |      Type      |  Default |  Description |
|:----------|:-------------|:------|:------|
| element | Element || DOM element to attach the editor to |
| language | string | javascript | Selected language |
| value | string || Initial content of the editor |
| width | string || Width of the `div` element |
| height | string || Height of the `div` element |
| onLoad | func | noop | **Signature: function(value: string) => void** <br/> Function called when the Load button is clicked |
| onUnload | func | noop | **Signature: function() => void** <br/> Function called when the Unload button is clicked |

## License

This content is released under the [MIT](http://opensource.org/licenses/MIT) License.

---
_Source: https://npm.io/package/moroboxai-editor-web · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
