Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/hatemhosny/monaco-editor-esm-cdn
ESM build of Monaco Editor which can be loaded from CDNs.
https://github.com/hatemhosny/monaco-editor-esm-cdn
Last synced: about 1 month ago
JSON representation
ESM build of Monaco Editor which can be loaded from CDNs.
- Host: GitHub
- URL: https://github.com/hatemhosny/monaco-editor-esm-cdn
- Owner: hatemhosny
- License: mit
- Created: 2024-07-31T00:12:01.000Z (4 months ago)
- Default Branch: main
- Last Pushed: 2024-07-31T00:43:44.000Z (4 months ago)
- Last Synced: 2024-10-01T14:09:56.159Z (about 2 months ago)
- Language: JavaScript
- Homepage: https://livecodes.io/?x=id/dgzkpnfzzbq
- Size: 2.76 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# monaco-editor-esm-cdn
This is an ESM build of Monaco Editor which can be loaded from CDN.
## Usage
The editor is bundled as ESM. It can be used like this:
[try in LiveCodes](https://livecodes.io/?x=id/dgzkpnfzzbq)
```html
import { monaco } from "https://cdn.jsdelivr.net/npm/monaco-editor-esm-cdn/monaco.js";
monaco.editor.create(document.getElementById("container"), {
value: `function x() {\n\tconsole.log("Hello world!");\n}`,
language: "javascript",
});```
Alternatively, options can be specified, by using the `loadMonaco` function:
```js
import { loadMonaco } from "https://cdn.jsdelivr.net/npm/monaco-editor-esm-cdn/load-monaco.js";const baseUrl = "https://cdn.jsdelivr.net/npm/monaco-editor-esm-cdn/dist/";
const monaco = await loadMonaco({ baseUrl, injectStyles: false });
```## Build
```bash
npm run build
```## License
MIT License