Unfortunately, not all functions are available — you can check the ones that are available here: List of available APIS.
So here we are downloading and building Redis 4.0.6(Redis modules was introduced on Redis 4) and then we are making Cthulhu so Lib. As you can see we just need to build Cthulhu one time and then we link Cthulhu with our custom js function. There are 3 JS functions: my_incr, my_append and echo. The function my_incr gets a key turns the content into a number and the increment 1 to the number and set back to the key and return to the user. Second function my_append does text appending on existing key. Getting the current value and appending the parameter. Both functions already exist so they are here just to show how easy is to work with JS and Redis. The last function is just an echo — Whatever string you send you will receive back. This functions can be called on the Redis-CLI but also by any client like Jedis(>=3.0.0-SNAPSHOT) or Lettuce(4.x,5.x) versions. So its possible to call this commands by any language.
Originally published at diego-pacheco.blogspot.com.