trait Zlib extends Object with IEventEmitter
This provides bindings to Gzip/Gunzip, Deflate/Inflate, and DeflateRaw/InflateRaw classes. Each class takes the same options, and is a readable/writable Stream.
- Annotations
- @RawJSType() @native()
- Version
7.4.0
- See also
https://nodejs.org/docs/latest/api/zlib.html
- Alphabetic
- By Inheritance
- Zlib
- IEventEmitter
- Object
- Any
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- val Z_ASCII: DataType
- val Z_BEST_COMPRESSION: CompressionLevel
- val Z_BEST_SPEED: CompressionLevel
- val Z_BINARY: DataType
- val Z_BLOCK: CompressionFlush
- val Z_BUF_ERROR: CompressionFunction
- val Z_DATA_ERROR: CompressionFunction
- val Z_DEFAULT_COMPRESSION: CompressionLevel
- val Z_DEFAULT_STRATEGY: CompressionStrategy
- val Z_DEFLATED: DeflateCompressMethod
- val Z_ERRNO: CompressionFunction
- val Z_FILTERED: CompressionStrategy
- val Z_FINISH: CompressionFlush
- val Z_FIXED: CompressionStrategy
- val Z_FULL_FLUSH: CompressionFlush
- val Z_HUFFMAN_ONLY: CompressionStrategy
- val Z_MEM_ERROR: CompressionFunction
- val Z_NEED_DICT: CompressionFunction
- val Z_NO_COMPRESSION: CompressionLevel
- val Z_NO_FLUSH: CompressionFlush
- val Z_NULL: AllocationType
- val Z_OK: CompressionFunction
- val Z_PARTIAL_FLUSH: CompressionFlush
- val Z_RLE: CompressionStrategy
- val Z_STREAM_END: CompressionFunction
- val Z_STREAM_ERROR: CompressionFunction
- val Z_SYNC_FLUSH: CompressionFlush
- val Z_TEXT: DataType
- val Z_TREES: CompressionFlush
- val Z_UNKNOWN: DataType
- val Z_VERSION_ERROR: CompressionFunction
-
def
addListener(eventName: String, listener: Function): Zlib.this.type
Alias for emitter.on(eventName, listener).
Alias for emitter.on(eventName, listener).
- Definition Classes
- IEventEmitter
emitter.addListener(eventName, listener)
- See also
on()
Example: -
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
clone(): AnyRef
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
def
createDeflate(options: |[CompressionOptions, RawOptions]): Deflate
Returns a new Deflate object with an options.
Returns a new Deflate object with an options.
zlib.createDeflate(options)
Example: -
def
createDeflateRaw(options: |[CompressionOptions, RawOptions]): DeflateRaw
Returns a new DeflateRaw object with an options.
Returns a new DeflateRaw object with an options.
zlib.createDeflateRaw(options)
Example: -
def
createGunzip(options: |[CompressionOptions, RawOptions]): Gunzip
Returns a new Gunzip object with an options.
Returns a new Gunzip object with an options.
zlib.createGunzip(options)
Example: -
def
createGzip(options: |[CompressionOptions, RawOptions]): Gzip
Returns a new Gzip object with an options.
Returns a new Gzip object with an options.
zlib.createGzip(options)
Example: -
def
createInflate(options: |[CompressionOptions, RawOptions]): Inflate
Returns a new Inflate object with an options.
Returns a new Inflate object with an options.
zlib.createInflate(options)
Example: -
def
createInflateRaw(options: |[CompressionOptions, RawOptions]): InflateRaw
Returns a new InflateRaw object with an options.
Returns a new InflateRaw object with an options.
zlib.createInflateRaw(options)
Example: -
def
createUnzip(options: |[CompressionOptions, RawOptions]): Unzip
Returns a new Unzip object with an options.
Returns a new Unzip object with an options.
zlib.createUnzip(options)
Example: -
def
deflate(buf: |[String, Buffer], callback: Function): Unit
Compress a Buffer or string with Deflate.
Compress a Buffer or string with Deflate.
zlib.deflate(buf[, options], callback)
Example: -
def
deflate(buf: |[String, Buffer], options: |[CompressionOptions, RawOptions], callback: Function): Unit
Compress a Buffer or string with Deflate.
Compress a Buffer or string with Deflate.
zlib.deflate(buf[, options], callback)
Example: -
def
deflateRaw(buf: |[String, Buffer], callback: Function): Unit
Compress a Buffer or string with DeflateRaw.
Compress a Buffer or string with DeflateRaw.
zlib.deflateRaw(buf[, options], callback)
Example: -
def
deflateRaw(buf: |[String, Buffer], options: |[CompressionOptions, RawOptions], callback: Function): Unit
Compress a Buffer or string with DeflateRaw.
Compress a Buffer or string with DeflateRaw.
zlib.deflateRaw(buf[, options], callback)
Example: -
def
deflateSync(buf: |[String, Buffer], options: |[CompressionOptions, RawOptions] = js.native): Unit
Compress a Buffer or string with Deflate.
Compress a Buffer or string with Deflate.
zlib.deflateSync(buf[, options])
Example: -
val
domain: String
- Definition Classes
- IEventEmitter
-
def
emit(name: String, args: Any*): Any
Synchronously calls each of the listeners registered for the event named eventName, in the order they were registered, passing the supplied arguments to each.
Synchronously calls each of the listeners registered for the event named eventName, in the order they were registered, passing the supplied arguments to each.
Returns true if the event had listeners, false otherwise.
- name
the event name
- args
the event arguments
- Definition Classes
- IEventEmitter
emitter.emit(name[, arg1][, arg2][, ...])
Example: -
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
finalize(): Unit
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
def
flush(callback: Function): Unit
Flush pending data.
Flush pending data. Don't call this frivolously, premature flushes negatively impact the effectiveness of the compression algorithm.
zlib.flush([kind], callback)
Example: -
def
flush(kind: CompressionFlush, callback: Function): Unit
Flush pending data.
Flush pending data. Don't call this frivolously, premature flushes negatively impact the effectiveness of the compression algorithm.
zlib.flush([kind], callback)
Example: -
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
-
def
getMaxListeners(): Int
Returns the current max listener value for the EventEmitter which is either set by emitter.setMaxListeners(n) or defaults to EventEmitter.defaultMaxListeners.
Returns the current max listener value for the EventEmitter which is either set by emitter.setMaxListeners(n) or defaults to EventEmitter.defaultMaxListeners.
- Definition Classes
- IEventEmitter
emitter.getMaxListeners()
- See also
setMaxListeners()
Example: -
def
gunzip(buf: |[String, Buffer], callback: Function): Unit
Decompress a Buffer or string with Gunzip.
Decompress a Buffer or string with Gunzip.
zlib.gunzip(buf[, options], callback)
Example: -
def
gunzip(buf: |[String, Buffer], options: |[CompressionOptions, RawOptions], callback: Function): Unit
Decompress a Buffer or string with Gunzip.
Decompress a Buffer or string with Gunzip.
zlib.gunzip(buf[, options], callback)
Example: -
def
gunzipSync(buf: |[String, Buffer], options: |[CompressionOptions, RawOptions] = js.native): Unit
Decompress a Buffer or string with Gunzip.
Decompress a Buffer or string with Gunzip.
zlib.gunzipSync(buf[, options])
Example: -
def
gzip(buf: |[String, Buffer], callback: Function): Unit
Compress a Buffer or string with Gzip.
Compress a Buffer or string with Gzip.
zlib.gzip(buf[, options], callback)
Example: -
def
gzip(buf: |[String, Buffer], options: |[CompressionOptions, RawOptions], callback: Function): Unit
Compress a Buffer or string with Gzip.
Compress a Buffer or string with Gzip.
zlib.gzip(buf[, options], callback)
Example: -
def
gzipSync(buf: |[String, Buffer], options: |[CompressionOptions, RawOptions] = js.native): Unit
Compress a Buffer or string with Gzip.
Compress a Buffer or string with Gzip.
zlib.gzipSync(buf[, options])
Example: -
def
hasOwnProperty(v: String): Boolean
- Definition Classes
- Object
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
-
def
inflate(buf: |[String, Buffer], callback: Function): Unit
Decompress a Buffer or string with Inflate.
Decompress a Buffer or string with Inflate.
zlib.inflate(buf[, options], callback)
Example: -
def
inflate(buf: |[String, Buffer], options: |[CompressionOptions, RawOptions], callback: Function): Unit
Decompress a Buffer or string with Inflate.
Decompress a Buffer or string with Inflate.
zlib.inflate(buf[, options], callback)
Example: -
def
inflateRaw(buf: |[String, Buffer], callback: Function): Unit
Decompress a Buffer or string with InflateRaw.
Decompress a Buffer or string with InflateRaw.
zlib.inflateRaw(buf[, options], callback)
Example: -
def
inflateRaw(buf: |[String, Buffer], options: |[CompressionOptions, RawOptions], callback: Function): Unit
Decompress a Buffer or string with InflateRaw.
Decompress a Buffer or string with InflateRaw.
zlib.inflateRaw(buf[, options], callback)
Example: -
def
inflateRawSync(buf: |[String, Buffer], options: |[CompressionOptions, RawOptions] = js.native): Unit
Decompress a Buffer or string with InflateRaw.
Decompress a Buffer or string with InflateRaw.
zlib.inflateRawSync(buf[, options])
Example: -
def
inflateSync(buf: |[String, Buffer], options: |[CompressionOptions, RawOptions] = js.native): Unit
Decompress a Buffer or string with Inflate.
Decompress a Buffer or string with Inflate.
zlib.inflateSync(buf[, options])
Example: -
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
def
isPrototypeOf(v: Object): Boolean
- Definition Classes
- Object
-
def
listenerCount(eventName: String): Int
Returns the number of listeners listening to the event named eventName.
Returns the number of listeners listening to the event named eventName.
- Definition Classes
- IEventEmitter
emitter.listenerCount(eventName)
Example: -
def
listeners(eventName: String): Array[Function]
Returns a copy of the array of listeners for the event named eventName.
Returns a copy of the array of listeners for the event named eventName.
- Definition Classes
- IEventEmitter
emitter.listeners(eventName)
Example: -
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
-
def
on(eventName: String, listener: Function): Zlib.this.type
Adds the listener function to the end of the listeners array for the event named eventName.
Adds the listener function to the end of the listeners array for the event named eventName. No checks are made to see if the listener has already been added. Multiple calls passing the same combination of eventName and listener will result in the listener being added, and called, multiple times.
Returns a reference to the EventEmitter so calls can be chained.
- Definition Classes
- IEventEmitter
emitter.on(eventName, listener)
Example: -
def
once(eventName: String, listener: Function): Zlib.this.type
Adds a one time listener function for the event named eventName.
Adds a one time listener function for the event named eventName. This listener is invoked only the next time eventName is triggered, after which it is removed.
- Definition Classes
- IEventEmitter
emitter.once(eventName, listener)
Example: -
def
params(level: CompressionLevel, strategy: CompressionStrategy, callback: Function): Unit
Dynamically update the compression level and compression strategy.
Dynamically update the compression level and compression strategy. Only applicable to deflate algorithm.
zlib.params(level, strategy, callback)
Example: -
def
propertyIsEnumerable(v: String): Boolean
- Definition Classes
- Object
-
def
removeAllListeners(): Zlib.this.type
Removes all listeners, or those of the specified eventName.
Removes all listeners, or those of the specified eventName.
Note that it is bad practice to remove listeners added elsewhere in the code, particularly when the EventEmitter instance was created by some other component or module (e.g. sockets or file streams).
Returns a reference to the EventEmitter so calls can be chained.
- Definition Classes
- IEventEmitter
emitter.removeAllListeners([eventName])
Example: -
def
removeAllListeners(eventName: String): Zlib.this.type
Removes all listeners, or those of the specified eventName.
Removes all listeners, or those of the specified eventName.
Note that it is bad practice to remove listeners added elsewhere in the code, particularly when the EventEmitter instance was created by some other component or module (e.g. sockets or file streams).
Returns a reference to the EventEmitter so calls can be chained.
- Definition Classes
- IEventEmitter
emitter.removeAllListeners([eventName])
Example: -
def
removeListener(eventName: String, listener: Function): Zlib.this.type
Removes the specified listener from the listener array for the event named eventName.
Removes the specified listener from the listener array for the event named eventName. removeListener will remove, at most, one instance of a listener from the listener array. If any single listener has been added multiple times to the listener array for the specified eventName, then removeListener must be called multiple times to remove each instance.
Note that once an event has been emitted, all listeners attached to it at the time of emitting will be called in order. This implies that any removeListener() or removeAllListeners() calls after emitting and before the last listener finishes execution will not remove them from emit() in progress. Subsequent events will behave as expected.
- Definition Classes
- IEventEmitter
emitter.removeListener(eventName, listener)
Example: -
def
reset(): Unit
Reset the compressor/decompressor to factory defaults.
Reset the compressor/decompressor to factory defaults. Only applicable to the inflate and deflate algorithms.
zlib.reset()
Example: -
def
setMaxListeners(n: Int): Zlib.this.type
By default EventEmitters will print a warning if more than 10 listeners are added for a particular event.
By default EventEmitters will print a warning if more than 10 listeners are added for a particular event. This is a useful default that helps finding memory leaks. Obviously, not all events should be limited to just 10 listeners. The emitter.setMaxListeners() method allows the limit to be modified for this specific EventEmitter instance. The value can be set to Infinity (or 0) for to indicate an unlimited number of listeners.
Returns a reference to the EventEmitter so calls can be chained.
- Definition Classes
- IEventEmitter
emitter.setMaxListeners(n)
Example: -
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toLocaleString(): String
- Definition Classes
- Object
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
def
unzip(buf: |[String, Buffer], callback: Function): Unit
Decompress a Buffer or string with Unzip.
Decompress a Buffer or string with Unzip.
zlib.unzip(buf[, options], callback)
Example: -
def
unzip(buf: |[String, Buffer], options: |[CompressionOptions, RawOptions], callback: Function): Unit
Decompress a Buffer or string with Unzip.
Decompress a Buffer or string with Unzip.
zlib.unzip(buf[, options], callback)
Example: -
def
unzipSync(buf: |[String, Buffer], options: |[CompressionOptions, RawOptions] = js.native): Unit
Decompress a Buffer or string with Unzip.
Decompress a Buffer or string with Unzip.
zlib.unzipSync(buf[, options])
Example: -
val
usingDomains: Boolean
- Definition Classes
- IEventEmitter
-
def
valueOf(): Any
- Definition Classes
- Object
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )