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.
letcontext=tryJSContext()letresult=try context.evaluate("40 + 2")assertEqual(try result.toString(),"42")letsef=""" (function(){ return { property: 'test' } })()"""letobject=try context.evaluate(sef)assertEqual(tryobject["property"]?.toString(),"test")git clone https://github.com/nginx/njs
cd njs
./configure
make -j8
export NJS=/path/to/cloned/njs
./run_tests