Giter VIP home page Giter VIP logo

js-engine's Introduction

JavaScript Engine

The JavaScript Engine library (jse) provides an Actor based abstraction so that JavaScript code can be executed in a browser-less fashion. In-jvm support is provided in the form of Rhino and native JavaScript performance is provided by using Common Node, node.js and PhantomJS (these latter 3 are required to be installed separately).

Sample usage can be obtained by inspecting the js-engine-tester sub-project. There's a main class that illustrates essential interactions. Here is a snippet of it:

val engine = system.actorOf(Node.props(), "engine")
val f = new File(Main.getClass.getResource("test.js").toURI)
for (
  result <- (engine ? Engine.ExecuteJs(f, Seq("999"))).mapTo[JsExecutionResult]
) yield {
  println(new String(result.output.toArray, "UTF-8"))
  ...

An additional js-engine-sbt sub-project is provided that declares the a base for sbt plugins that use the engine. This sub-project has a separate release cycle to jse itself and could be spun off into its own repo at a later point in time e.g. if/when Maven/Gradle support is required. The main point here is that the core JavaScript engine library is not related to sbt at all and should be usable from other build tools.

The library is entirely reactive and uses Akka.

© Typesafe Inc., 2013

js-engine's People

Contributors

huntc avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.