Oni StratifiedJS (previously known as "Oni Apollo") is the reference StratifiedJS Language implementation + a supporting set of modules. It runs server-side (based on NodeJS) as well as client-side (cross-browser).
For an overview see onilabs.com/stratifiedjs.
Please post questions to the StratifiedJS Google Group.
How to run/install
For server-side use, you can just execute the
(provided you have nodejs installed).
For client-side use, just include
stratified.js in your html,
as described at onilabs.com/stratifiedjs.
Users of the bower or npm
package managers can install the
stratifiedjs package using either of
npm users should install globally (
npm install -g)
to add the
rocket binaries in your
What's in this repository:
- Client-side cross-browser StratifiedJS runtime.
- ~25kB gzipped, MIT-licensed.
- For more information please read the docs at onilabs.com/stratifiedjs.
stratified-node.js, 'sjs' executable
- Server-side StratifiedJS runtime for NodeJS.
- If you've got NodeJS installed, just run
sjsto get a serverside SJS REPL.
- See also this StratifiedJS Google Group post
- A simple web server. Run
rocketto start a webserver on port 7070, serving the current directory. Run
rocket -hfor options.
- 'Oni StratifiedJS Standard Module Library'
- All MIT-licensed.
- Runs server-side or client-side.
- Documentation at onilabs.com/modules.
- build tools and source code from which stratified.js and stratified-node.js are assembled.
How to build
Everything is already pre-built.
No need to compile anything unless you change something in the src/ directory. In that case, you can use the src/build/make-sjs tool to reassemble stratified.js and stratified-node.js. The build process should work on most unixy environments out of the box (in particular it requires CPP - the C preprocessor).
Considerations for client-side use
Note that, by default, if you load standard library modules using code such as
var http = require('sjs:http');
the module will be requested from
This location can only be inferred if you load stratified.js in the
'normal' way. If you rename stratified.js to something else, or you
don't load it through a <script> tag, you'll need to manually
configure the 'sjs' hub before you can make calls such as
To (re-)configure the 'sjs hub', you can use code such as this:
require.hubs.unshift( ["sjs:", "http://code.mydomain.com/sjs-mirror/modules/"] ]); // all modules addressed as 'sjs:' will now be loaded from the // location above.
Note that many browsers cannot load modules over the
protocol. You can use
rocket to serve up the current directory
locally. Alternatively, you can serve stratified.js and the modules/
directory with a different web server, or load stratified.js &
modules/ from http://code.onilabs.com/ as described at