underscore JavaScript Library für XPages ServerSide JavaScript (SSJS)

If you’re building web or mobile apps, most probably you know the underscore library from underscorejs.org. If not, you should have a look at it. It contains a lot of useful basic functions that eases developer’s daily work a lot.

Today I had to implement some fancy stuff regarding JavaScript arrays in XPages ServerSide JavaScript (SSJS). And I really missed my beloved underscore library…. so I had a look at the source and tried to use it as library in SSJS.

For sure, it didn’t work right out of the box. There were several issues because SSJS is no real JavaScript… but anyway, I managed to workaround most issues and now it seems to work.

If you’re interested, download this source: jbuss_underscore. Have a look at the notes at the beginning, it listens some underscore functions that cannot work in SSJS.

There is a good chance that some functions doesn’t work yet, if so, leave a comment at this post and I will try to fix it.

If you’re curious: look for “!! jbuss” markers in the code, these are the pieces I needed to change.


Comments are closed.