Share your code. npm Orgs help your team discover, share, and reuse code. Create a free org »

glsl-editor

1.0.0 • Public • Published

glsl-editor experimental

CodeMirror-powered GLSL editor component.

Usage

NPM

editor = Editor(options)

Creates a new editor, where options is passed directly onto CodeMirror. You can find a full list here.

Additionally, the container option determines which DOM element to attach the editor to. By default, this will be document.body.

editor.resize()

Automatically resize the editor to fill its parent element. This on creating the editor but you'll want to call it again when the window is resized.

editor.getValue()

Gets the text content of the editor.

editor.setValue(value)

Sets the text content of the editor to value.

editor.editor

The CodeMirror editor instance.

require('glsl-editor/css')

require('glsl-editor/theme')

Inlines the base CodeMirror CSS and a default theme respectively. Useful for just getting started quickly, but entirely optional.

License

MIT. See LICENSE.md for details.

install

npm i glsl-editor

Downloadsweekly downloads

9

version

1.0.0

license

MIT

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability