Opensourcetechブログ

OpensourcetechによるNGINX/Kubernetes/Zabbix/Neo4j/Linuxなどオープンソース技術に関するブログです。

nginx njs-0.2.0 リリース!

 

こんにちは、鯨井貴博@opensourcetechです。

 

 

 nginx njs-0.2.0がリリースされました。

f:id:opensourcetech:20180405103916p:plain

nginx news

 

 

ちなみにnjsとは、nginx で ECMAScript(Javascript)を利用いた拡張機能です。

-------

njs is a subset of the JavaScript language that allows implementing location and variable handlers in http and stream. njs is created in compliance with ECMAScript 5.1 with some ECMAScript 6 extensions. The compliance is still evolving.

-------

日本語訳 by Google翻訳

njsはJavaScript言語のサブセットで、httpとストリームで位置と変数ハンドラを実装できます。 njsはECMAScript 5.1に準拠して作成され、いくつかのECMAScript 6拡張があります。 コンプライアンスはまだ進化し続けています。

From About njs

 

パッケージをインストールすることにより、

ngx_http_js_module / ngx_stream_js_module のモジュールが使用出来るようになります。

Module ngx_http_js_module

Module ngx_stream_js_module

 

 

インストールは、パッケージやソースから可能です。

f:id:opensourcetech:20180405104425p:plain

f:id:opensourcetech:20180405104440p:plain

http://nginx.org/en/docs/njs_about.html#install

 

 

 

現時点でサポートされている機能

http://nginx.org/en/docs/njs_about.html#supported

-------

Boolean values, numbers, strings, objects, arrays, functions, and regular expressions
ES5.1 operators, ES7 exponentiation operators
ES5.1 statements: var, if, else, switch, for, for in, while, do while, break, continue, return, try, catch, throw, finally
ES6 Number and Math properties and methods
String methods:
ES5.1: fromCharCode, concat, slice, substring, substr, charAt, charCodeAt, indexOf, lastIndexOf, toLowerCase, toUpperCase, trim, search, match, split, replace
ES6: fromCodePoint, codePointAt, includes, startsWith, endsWith, repeat
non-standard: fromUTF8, toUTF8, fromBytes, toBytes
Object methods:
ES5.1: create (support without properties list), keys, defineProperty, defineProperties, getOwnPropertyDescriptor, getPrototypeOf, hasOwnProperty, isPrototypeOf, preventExtensions, isExtensible, freeze, isFrozen, seal, isSealed
Array methods:
ES5.1: isArray, slice, splice, push, pop, unshift, shift, reverse, sort, join, concat, indexOf, lastIndexOf, forEach, some, every, filter, map, reduce, reduceRight
ES6: of, fill, find, findIndex
ES7: includes
ES5.1 Function methods: call, apply, bind
ES5.1 RegExp methods: test, exec
ES5.1 Date methods
ES5.1 JSON object
ES5.1 global functions: isFinite, isNaN, parseFloat, parseInt, decodeURI, decodeURIComponent, encodeURI, encodeURIComponent
Error objects: Error, EvalError, InternalError, RangeError, ReferenceError, SyntaxError, TypeError, URIError
setTimeout, clearTimeout functions
File system methods (Node.js style): fs.readFile, fs.readFileSync, fs.appendFile, fs.appendFileSync, fs.writeFile, fs.writeFileSync
Crypto methods (Node.js style): crypto.createHash, crypto.createHmac

 

未サポートの機能

http://nginx.org/en/docs/njs_about.html#not_supported

-------

ES6 let and const declarations
labels
arguments array
eval function
setInterval, setImmediate functions
non-integer fractions (.235), binary literals (0b0101)

 

 

github.com

www.facebook.com

twitter.com

www.instagram.com

 

 

にほんブログ村 IT技術ブログ Linuxへ
Linux

にほんブログ村 IT技術ブログ オープンソースへ
オープンソース

 

Opensourcetech by Takahiro Kujirai