Skip to content

Latest commit

 

History

History
29 lines (21 loc) · 766 Bytes

README.markdown

File metadata and controls

29 lines (21 loc) · 766 Bytes

natto

-- import "github.com/robertkrimen/natto"

Package natto is an example/offshoot of otto that implements an event loop (supporting setTimeout/setInterval).

http://godoc.org/github.com/robertkrimen/natto

otto: http://github.com/robertkrimen/otto (http://godoc.org/github.com/robertkrimen/otto)

Usage

func Run

func Run(src string) error

Run will execute the given JavaScript, continuing to run until all timers have finished executing (if any). The VM has the following functions available:

<timer> = setTimeout(<function>, <delay>, [<arguments...>])
<timer> = setInterval(<function>, <delay>, [<arguments...>])
clearTimeout(<timer>)
clearInterval(<timer>)

-- godocdown http://github.com/robertkrimen/godocdown