load-a-javascript-udf-library

star 21

Register User-Defined Functions written in JavaScript with FalkorDB using falkor.register()

FalkorDB By FalkorDB schedule Updated 2/4/2026

name: Load a JavaScript UDF library description: Register User-Defined Functions written in JavaScript with FalkorDB using falkor.register()

Load a JavaScript UDF library

Register User-Defined Functions (UDFs) written in JavaScript with FalkorDB.

Usage

Use the falkor.register() function within JavaScript code to register UDFs, then load the library using the FalkorDB client.

Example

from falkordb import FalkorDB

db = FalkorDB(host='localhost', port=6379)
lib = "StringUtils"
script = """
function UpperCaseOdd(s) {
  return s.split('')
    .map((c, i) => i % 2 !== 0 ? c.toUpperCase() : c)
    .join('');
};

falkor.register('UpperCaseOdd', UpperCaseOdd);
"""

db.udf_load(lib, script)

Notes

  • UDFs must be written in JavaScript
  • Use falkor.register() to make functions available in Cypher queries
  • The library name (lib) is used as a namespace for the functions
  • UDFs are stored in FalkorDB and persist across restarts
  • UDFs must be pure functions without side effects
Install via CLI
npx skills add https://github.com/FalkorDB/skills --skill load-a-javascript-udf-library
Repository Details
star Stars 21
call_split Forks 2
navigation Branch main
article Path SKILL.md
More from Creator