3. What is Avatar.js?
An open-source project on java.net
A server-side JavaScript framework for the JVM
A combination of:
– The node event-driven model, module system and APIs
– Nashorn JavaScript engine (new in Java8)
– Java bindings for some native node dependencies
– Some additional native code
– Java Platform APIs
4. Avatar.js project goals
A platform for JavaScript Enterprise Applications
Compatible with the node programming model
(as much as possible)
– node applications should run with little or no modification on Avatar
– Except for modules and apps with native code
Enable using JavaEE APIs in Avatar apps
– By providing JavaScript wrappers
– By providing asynchronous adapters where necessary
– To not block the main JavaScript thread
5. Why use Avatar.js?
Can reuse Java libraries and middleware
Can take advantage of multiple cores
Can be secured using the Java security model
Can be managed using existing Java tools
– VisualVM, MBeans, Flight Recorder, Mission Control
Can access Java APIs to complement node APIs
– BigInteger, Date, Calendar, XML, SQL, Multicast, etc
Small enough for embedded usage (less than 2Mb)
6. Status – September 2013
Compatible with node v0.10.18
Most modules work
– Most reuse node JavaScript sources unmodified
– Some use Java APIs (buffer, fs, crypto, dns, timers, zlib)
Of 584 node unit tests in v0.10.18
– 470 tests pass (80%)
– Some tests (8%) are patched lightly to work with Avatar.js
7. Modules Status –
September 2013
Modules known to work
abbrev ansi async block-stream chmodr chownr colors commander
connect debug express graceful-fs inherits ini init-package-json grunt
jade lodash mime mkdirp mocha node-unit node-uuid once opener
optimist osenv passport q read redis request retry rimraf ronn semver
slide socket.io tar uglify-js uid-number underscore which winston
Modules that work with a small patch
express/ejs, grunt-contrib-uglify, lockfile, vows
Modules not yet working
coffee-script