Skip to content

shama/javascript-editor

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

javascript-editor

codemirror + esprima powered html5 javascript editor component

based originally on htmleditor by mrdoob

features

  • JS syntax highlighting
  • JS errors are detected and highlighted as you code
  • by default if you drop a .js file on the editor it will load the contents
  • modular and installable with NPM

usage

use it with browserify

npm install javascript-editor
var editor = require('javascript-editor')

editor({ container: document.querySelector('#editor') })

editor.on('change', function() {
  var value = editor.getValue()
})

default options

var defaults = {
	value: "// hello world\n",
	container: document.body,
	mode: "javascript",
	lineNumbers: true,
	matchBrackets: true,
	indentWithTabs: false,
	tabSize: 2,
	indentUnit: 2,
	updateInterval: 500,
	dragAndDrop: true
}

license

BSD

About

codemirror + esprima powered html5 javascript editor component

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%