npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

vue-monaco-cdn

v2.0.3

Published

Lightweight MonacoEditor component for Vue.js using CDN

Downloads

318

Readme

vue-monaco-cdn

This is a version for Vue3. To get version for Vue2, please use vue-monaco-cdn^1.0.0 (branch v1.x)

Monaco Editor is the code editor that powers VS Code. This project aims to provide simple and lightweight Vue.js component, that downloads editor files lazily from cdn. Forked from vue-monaco and adjusted to use CDN with minimal setup.

Similar projects:

  • vue-monaco - requires bundling monaco editor files via webpack and a special webpack plugin. Sometimes this may be undesirable because:
    • it requires additional webpack configuration
    • webpack processing can lead to issues
    • it can significantly increase webpack bundle size and build time.
  • vue-monaco-editor - supports CDN but isn't maintained.

Install

yarn add vue-monaco-cdn
# or
npm install vue-monaco-cdn

Usage

<template>
  <monaco-editor
    class="editor"
    v-model="code"
    language="javascript"
  />
  </monaco-editor>
</template>

<script>
import MonacoEditor from 'vue-monaco-cdn'

export default {
  components: {
    MonacoEditor
  },

  data() {
    return {
      code: 'const noop = () => {}'
    }
  }
}
</script>

<style>
.editor {
  width: 600px;
  height: 400px;
}
</style>

Props

  • modelValue - code
  • language - programming language that code will be in. List of supported languages
  • theme - visual theme for editor
  • options - monaco editor additional options
  • url - custom CDN url. Default is "https://unpkg.com/browse/monaco-editor@latest/min". Note, that URL must point to a folder, under which path "/vs/base/worker/workerMain.js" must exist.

Methods

Use ref to interact with the MonacoEditor component in order to access methods: <MonacoEditor ref="editor"></MonacoEditor>, then this.$refs.editor.getMonaco() will be available.

Events

  • editorDidMount - fired after monaco editor was mounted. Recieves monaco instance (IStandaloneCodeEditor) as parameter. Use this event to customize monaco instance (for example, add new code formatters)
  • update:modelValue - fired whenever user changes editor content

For other events, please use getMonaco() and subscribe to them directly. See IStandaloneCodeEditor reference for full events list.

Author

vue-monaco-cli. Released under the MIT License.

Authored and maintained by leo-buneev and contributors. Huge thanks to egoist for initial webpack version.