# HG changeset patch # User Yaroslav Zhuravlev # Date 1688643068 -3600 # Node ID 703d3450cd817e5e4726862430b6648ec7c989f6 # Parent 8899986c36221e749fb8ca8c1debed86ad5aa241 Added mini-tocs in sections of njs Reference. diff --git a/xml/en/docs/njs/reference.xml b/xml/en/docs/njs/reference.xml --- a/xml/en/docs/njs/reference.xml +++ b/xml/en/docs/njs/reference.xml @@ -9,7 +9,7 @@
+ rev="111">
@@ -38,6 +38,43 @@ List of all njs properties and methods c
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
r.args{}
r.done()
r.error()
r.finish()
r.headersIn{}
r.headersOut{}
r.httpVersion
r.internal
r.internalRedirect()
r.log()
r.method
r.parent
r.remoteAddress
r.requestBody
r.requestBuffer
r.requestText
r.rawHeadersIn{}
r.rawHeadersOut{}
r.responseBody
r.responseBuffer
r.responseText
r.return()
r.send()
r.sendBuffer()
r.sendHeader()
r.setReturnValue()
r.status
r.subrequest()
r.uri
r.rawVariables{}
r.variables{}
r.warn()
+
+ + The HTTP request object is available only in the ngx_http_js_module module. All string properties of the object are @@ -647,6 +684,28 @@ only first 2048 bytes of the string can
+ + + + + + + + + + + + + + + + + + +
s.allow()
s.decline()
s.deny()
s.done()
s.error()
s.log()
s.off()
s.on()
s.remoteAddress
s.rawVariables{}
s.send()
s.sendDownstream()
s.sendUpstream()
s.status
s.setReturnValue()
s.variables{}
s.warn()
+
+ + The stream session object is available only in the ngx_stream_js_module module. @@ -916,6 +975,19 @@ only first 2048 bytes of the string can
+ + + + + + + + + +
Headers()
Headers.append()
Headers.delete()
Headers.get()
Headers.getAll()
Headers.forEach()
Headers.has()
Headers.set()
+
+ + The Headers interface of the Fetch API is available since 0.5.1. @@ -1009,6 +1081,22 @@ or adds the header if it does not alread
+ + + + + + + + + + + + +
Request()
Request.arrayBuffer()
Request.bodyUsed
Request.cache
Request.credentials
Request.headers
Request.json()
Request.method
Request.mode
Request.text()
Request.url
+
+ + The Request interface of the Fetch API is available since 0.7.10. @@ -1132,6 +1220,23 @@ Contains the URL of the request.
+ + + + + + + + + + + + + +
Response()
Response.arrayBuffer()
Response.bodyUsed
Response.headers
Response.json()
Response.ok
Response.redirected
Response.status
Response.statusText
Response.text()
Response.type
Response.url
+
+ + The Response interface is available since 0.5.1. @@ -1261,6 +1366,21 @@ The URL of the response.
+ + + + + + + + + + + +
ngx.build
ngx.conf_file_path
ngx.conf_prefix
ngx.error_log_path
ngx.fetch()
ngx.log()
ngx.prefix
ngx.version
ngx.version_number
ngx.worker_id
+
+ + The ngx global object is available since 0.5.0. @@ -1437,6 +1557,22 @@ the value is between 0 + + + + + + + + + + + + +
сrypto.getRandomValues()
сrypto.subtle.encrypt()
сrypto.subtle.decrypt()
сrypto.subtle.deriveBits()
сrypto.subtle.deriveKey()
сrypto.subtle.digest()
сrypto.subtle.exportKey()
сrypto.subtle.generateKey()
сrypto.subtle.importKey()
сrypto.subtle.sign()
сrypto.subtle.verify()
+
+ + The crypto object is a global object that allows using cryptographic functionality (since 0.7.0). @@ -2873,6 +3009,15 @@ object that contains the data whose sign
+ + + + + +
CryptoKey.algorithm
CryptoKey.extractable
CryptoKey.type
CryptoKey.usages
+
+ + The CryptoKey object represents a cryptographic key obtained from one of the SubtleCrypto methods: @@ -2976,6 +3121,13 @@ key for deriving bits
+ + + +
CryptoKeyPair.privateKey
CryptoKeyPair.publicKey
+
+ + The CryptoKeyPair is a dictionary object of the WebCrypto API that represents an asymmetric key pair. @@ -3005,6 +3157,16 @@ representing the public key.
+ + + + + + +
njs.version
njs.version_number
njs.dump()
njs.memoryStats
njs.on()
+
+ + The njs object is a global object that represents the current VM instance (since 0.2.0). @@ -3071,6 +3233,15 @@ The callback is called without arguments
+ + + + + +
process.argv
process.env
process.pid
process.ppid
+
+ + The process object is a global object that provides information about the current process (0.3.3). @@ -3276,6 +3447,16 @@ 4
+ + + + + + +
TextDecoder()
TextDecoder.prototype.encoding
TextDecoder.prototype.fatal
TextDecoder.prototype.ignoreBOM
TextDecoder.prototype.decode()
+
+ + The TextDecoder produces a stream of code points from a stream of bytes @@ -3285,7 +3466,7 @@ from a stream of bytes -TextDecoder([[encoding], +TextDecoder([[encoding], options]) Creates a new TextDecoder object @@ -3366,6 +3547,14 @@ By default is false.
+ + + + +
TextEncoder()
TextEncoder.prototype.encode()
TextEncoder.prototype.encodeInto()
+
+ + The TextEncoder object produces a byte stream with UTF-8 encoding from a stream of code points @@ -3375,7 +3564,7 @@ from a stream of code points -TextEncoder() +TextEncoder() Returns a newly constructed TextEncoder that will generate a byte stream with UTF-8 encoding. @@ -3422,6 +3611,13 @@ the number of bytes modified in the dest
+ + + +
clearTimeout()
setTimeout()
+
+ + clearTimeout(timeout) @@ -3460,6 +3656,13 @@ clearTimeout(t);
+ + + +
atob()
btoa()
+
+ + atob(encodedData) @@ -3518,6 +3721,58 @@ const decodedData = atob(encodedData); /
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Buffer.alloc()
Buffer.allocUnsafe()
Buffer.byteLength()
Buffer.compare()
Buffer.concat()
Buffer.from(array)
Buffer.from(arrayBuffer)
Buffer.from(buffer)
Buffer.from(object)
Buffer.from(string)
Buffer.isBuffer()
Buffer.isEncoding()
buffer[]
buf.buffer
buf.byteOffset
buf.compare()
buf.copy()
buf.equals()
buf.fill()
buf.includes()
buf.indexOf()
buf.lastIndexOf()
buf.length
buf.readIntBE()
buf.readIntLE()
buf.readUIntBE()
buf.readUIntLE()
buf.readDoubleBE
buf.readDoubleLE()
buf.readFloatBE()
buf.readFloatLE()
buf.subarray()
buf.slice()
buf.swap16()
buf.swap32()
buf.swap64()
buf.toJSON()
buf.toString()
buf.write()
buf.writeIntBE()
buf.writeIntLE()
buf.writeUIntBE()
buf.writeUIntLE()
buf.writeDoubleBE()
buf.writeDoubleLE()
buf.writeFloatBE()
buf.writeFloatLE()
+
+ + Buffer.alloc(size[, @@ -3895,7 +4150,7 @@ Reads a 32-bit, little-endian float from at the specified offset. -buf.subarray[start[, +buf.subarray([start[, end]]) Returns a new buf @@ -3909,7 +4164,7 @@ the same result as that of end equal to is returned. -buf.slice[start[, +buf.slice([start[, end]]) Returns a new buf @@ -4099,6 +4354,13 @@ at the specified offset a
+ + + +
crypto.createHash()
crypto.createHmac()
+
+ + Since 0.7.0, extended crypto API is available as a global @@ -4140,6 +4402,13 @@ The algorithm can be
+ + + +
hash.update()
hash.digest()
+
+ + hash.update(data) @@ -4188,6 +4457,13 @@ undefined
+ + + +
hmac.update()
hmac.digest()
+
+ + hmac.update(data) @@ -4231,6 +4507,30 @@ undefined
+ + + + + + + + + + + + + + + + + + + + +
fs.accessSync()
fs.appendFileSync()
fs.fstatSync()
fs.lstatSync()
fs.mkdirSync()
fs.openSync()
fs.promises.open()
fs.readSync()
fs.readdirSync()
fs.readFileSync()
fs.realpathSync()
fs.renameSync()
fs.rmdirSync()
fs.statSync()
fs.symlinkSync()
fs.writeSync()
fs.writeSync()
fs.unlinkSync()
fs.writeFileSync()
+
+ + The File System module provides operations with files. @@ -4783,6 +5083,17 @@ the name of the file fs.Dirent<
+ + + + + + + +
filehandle.close()
filehandle.fd
filehandle.read()
filehandle.stat()
filehandle.write(buf)
filehandle.write(str)
+
+ + The FileHandle object is an object wrapper for a numeric file descriptor (0.7.7). @@ -5285,6 +5596,17 @@ but fails if the file already exists
+ + + + + + + +
querystring.decode()
querystring.encode()
querystring.escape()
querystring.parse()
querystring.stringify()
querystring.unescape()
+
+ + The Query String module provides support for parsing and formatting URL query strings (0.4.3). @@ -5461,6 +5783,19 @@ and should not be used directly.
+ + + + + + + + + +
xml.parse()
xml.c14n()
xml.exclusiveC14n()
xml.serialize()
xml.serializeToString()
XMLDoc
XMLNode
XMLAttr
+
+ + The XML module allows working with XML documents (since 0.7.10). The XML module object is returned by @@ -5780,6 +6115,15 @@ the attribute value of abc + + + + + +
zlib.deflateRawSync()
zlib.deflateSync()
zlib.inflateRawSync()
zlib.inflateSync()
+
+ + The zlib module provides compression functionality using the “deflate” and “inflate” algorithms (since 0.7.12).