Port of nisetango to javascript