njs is a subset of the JavaScript language that allows extending nginx functionality. njs is created in compliance with ECMAScript 5.1 (strict mode) with some ECMAScript 6 and later extensions. The compliance is still evolving.
let context = try JSContext()
let result = try context.evaluate("40 + 2")
assertEqual(try result.toString(), "42")
let sef = """
(function(){
return { property: 'test' }
})()
"""
let object = try context.evaluate(sef)
assertEqual(try object["property"]?.toString(), "test")
git clone https://github.com/nginx/njs
cd njs
./configure
make -j8
export NJS=/path/to/cloned/njs
./run_tests