Oni StratifiedJS (previously Apollo)
JavaScript HTML Emacs Lisp Perl Roff Python Other
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
emacs support for '::' operator Sep 2, 2015
examples/xbrowser Install a handler on window.onerror to give better stacktraces for ce… Sep 22, 2016
modules sys::withEvalContext for sandboxed SJS evaluation Jul 31, 2018
node_modules remove stale nodejs/tar module Feb 13, 2018
src '__raw_until': support for embeding raw unparsed code in SJS files Jul 30, 2018
test
tools rename array::union and array::difference to array::array_union and a… May 14, 2018
vim add vim/.gitignore May 1, 2014
.gitignore ignore espree & eslint deps Mar 20, 2015
.travis.yml test modern node versions in travis. Nov 20, 2016
CHANGELOG.md update changelog Jul 15, 2015
LICENSE remove old rocket webserver (it's now under tools/, since we still us… Jan 11, 2014
README.md merge sjs syntax support for vim Apr 20, 2014
appveyor.yml fix appveyor branch config Jan 9, 2015
bower.json begin version 0.20 Sep 23, 2014
package.json remove stale nodejs/tar module Feb 13, 2018
sjs got async retraction working on SIGINT/HUP May 28, 2014
sjs.cmd Rename `apollo` scripts to `sjs` Jun 11, 2013
stratified-aot.js module compilation: replace use of 'eval' by 'new Function' Jul 29, 2018
stratified-node.js '__raw_until': support for embeding raw unparsed code in SJS files Jul 30, 2018
stratified.js '__raw_until': support for embeding raw unparsed code in SJS files Jul 30, 2018

README.md

Oni StratifiedJS - Multi-Platform Stratified JavaScript Implementation

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 sjs executable (provided you have nodejs installed).

For client-side use, just include stratified.js in your html, as described at onilabs.com/stratifiedjs.

For a complete sjs web app stack, check out conductance.io.

Prebuilt packages:

Users of the bower or npm package managers can install the stratifiedjs package using either of these tools. npm users should install globally (npm install -g) to add the sjs binary to your $PATH.

What's in this repository:

stratified.js

  • 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 sjs to get a serverside SJS REPL.
  • See also this StratifiedJS Google Group post

modules/

  • 'Oni StratifiedJS Standard Module Library'
  • All MIT-licensed.
  • Runs server-side or client-side.
  • Documentation at onilabs.com/modules.

src/

  • build tools and source code from which stratified.js and stratified-node.js are assembled.

emacs/

  • StratifiedJS syntax highlighting support for emacs (GPL).

vim/

  • StratifiedJS syntax highlighting support for vim (Vim licence, GPL compatible).

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

LOCATION_WHERE_STRATIFIED_JS_WAS_LOADED_FROM/modules

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 require('sjs:http').

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 file: protocol. You can use a standard web server to serve stratified.js and the modules/ directory, or load stratified.js & modules/ from http://code.onilabs.com/ as described at onilabs.com/stratifiedjs.