Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

History

20 Commits

Repository files navigation

NJS

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.

Usage

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")

Building njs from source

git clone https://github.com/nginx/njs
cd njs
./configure
make -j8

Useful commands

export NJS=/path/to/cloned/njs
./run_tests

About

Deprecated

Resources

Stars

0 stars

Watchers

1 watching

Forks

Contributors

Languages