Skip to content
natto is an example/offshoot of otto that implements an event loop (supporting setTimeout/setInterval)
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
terst Initial commit Apr 27, 2014
Makefile Initial commit Apr 27, 2014
README.markdown Initial commit Apr 27, 2014
natto.go Initial commit Apr 27, 2014
natto_test.go

README.markdown

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

You can’t perform that action at this time.