cpp-editor
TypeScript icon, indicating that this package has built-in type declarations

0.1.6 • Public • Published

Getting Started with Cpp Editor

A REALLY SIMPLE package which packaging monaco-editor and React.

This project was created by yar2001.

How to use it?

Create a new editor and render it

import {
    CppEditor
} from "cpp-editor"

const renderEditor = async function() {
    let editor = new CppEditor(document.getElementId("root"));
    await editor.render();
}
renderEditor();

Get and set code

editor.setCode("#include <string>");
console.log(editor.getCode());

Enable and disable darkmode

editor.setDarkMode(true);
setTimeout(() => {
    editor.setDarkMode(false);
}, 1000);

Destroy the editor

editor.unmount();

Readme

Keywords

Package Sidebar

Install

npm i cpp-editor

Weekly Downloads

1

Version

0.1.6

License

MulanPSL

Unpacked Size

21 kB

Total Files

25

Last publish

Collaborators

  • yar2001