Skip to content

JavaScriptKit/njs

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

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

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

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •