[sword-devel] JavaScript & SWORD modules

Stephan info at tetzels.de
Sun Jan 19 16:19:10 MST 2014


Hi,

> ...very immature or focused heavily on pure JS work that producing Sword
> bindings ranges from impossible (in the browser) to questionable
> (browser plugins) to an unexplored unknown (server-side plugins).

Last year I've started serveral efforts to access SWORD modules in 
Javascript. Since Javascript supports manipulating and handling binary 
data is no problem to access sword modules in Javascript if you know how 
to read them.

First I've tried to compile sword to JS with Emscripten, but without 
real success. After that I've started to work on a serverside nodejs 
implementation (pure JS and a wrapper around the native C++ lib). You 
can find the sources here:

* https://github.com/zefanja/node-swordjs
* https://github.com/zefanja/sword-addon

Because every serverside solution has the problem to solve licence and 
sword module distribution issues I've ported my efforts to browser-side JS.

The project is still a very early stage (and my free time is limited), 
but you are able to install and access sword modules in your browser. 
You can take a look at http://zefanjas.de/biblezng to see a working 
demo. Currently it supports Firefox only, because Chrome/IE don't 
support file blobs in indexedDB.

You'll find the sources on Github, too.
* the library: https://github.com/zefanja/swordjs
* the reference app: https://github.com/zefanja/biblez-ng

Perfomance is good in a the browser and acceptable on a low-end 
FirefoxOS device. But there is much room for optimizations (web workers, 
...).

Blessings,
Stephan



More information about the sword-devel mailing list