Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@bgoodman/code-edit

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@bgoodman/code-edit

A custom element encapsulating a CodeMirror instance.

  • 1.4.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Weekly downloads
 
Created
Source

code-edit

A custom element encapsulating a CodeMirror instance.

Install

npm install @bgoodman/code-edit

yarn add @bgoodman/code-edit

Usage

    <script type="module" src="./dist/index.js"></script>

    <code-edit></code-edit>

Attributes

mode

Specify code type using a language mode. Options include:

  • "htmlmixed" - default (html/css/js)
  • "javascript"
  • "typescript"
  • "markdown"

storage-key

If set, allows the editors value to persist accross sessions using window.localStorage. Data is stored as key ${window.location.href}-${this.storageKey}. If unset, the editor's value will reset each time the component loads.

Methods

getValue

Get the current editor content. You can pass it an optional argument to specify the string to be used to separate lines (defaults to "\n").

getValue(seperator?: string): Promise<string>

setValue

Set the editor content.

setValue(code: string): Promise<void>

Keywords

FAQs

Package last updated on 21 Jan 2020

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc